Skip to content

Wrap expr in expr before enclosing with curly braces - #263

Merged
lorenzwalthert merged 5 commits into
r-lib:masterfrom
lorenzwalthert:token_insertion
Oct 27, 2017
Merged

lorenzwalthert merged 5 commits into
r-lib:masterfrom
lorenzwalthert:token_insertion

Conversation

@lorenzwalthert

@lorenzwalthert lorenzwalthert commented Oct 25, 2017 •

Copy link
Copy Markdown
Collaborator

Found a way around it as outlined in #257. However, the problem that token_before and token_after get outdated after tokens were inserted persists. It's kind of a chicken and egg problem because if we first insert the tokens, we need to already have the line breaks set for which we need token_before and token_after (at least in the current code, and it might be necessary to do so to access tokens from neighbouring nests). Anyways I think we should merge that quickly since it seems to be substantial bug.

The column parent in the nested parse table also get's outdated with this approach, but I think we can consider removing it after we computed the nested parse data since it appears to me to be not of any further use.

@lorenzwalthert

Copy link
Copy Markdown
Collaborator Author

See #77 for an earlier (short) discussion on the ordering of the transformations.

@krlmlr krlmlr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good. If we don't need the parents column, maybe remove it altogether?

Always add parenthesis to both if-else part with strict = TRUE if expr is multiline. Closes r-lib#229.
@lorenzwalthert
lorenzwalthert force-pushed the token_insertion branch 2 times, most recently from 70b0ebc to 06e8063 Compare October 26, 2017 19:12
Delete column parent in parse table after parse data is nested.
@lorenzwalthert

Copy link
Copy Markdown
Collaborator Author

Yes, parent and id removed altogether worked out.

@lorenzwalthert
lorenzwalthert merged commit 85f3e9c into r-lib:master Oct 27, 2017
@lorenzwalthert
lorenzwalthert deleted the token_insertion branch October 27, 2017 07:01
@lorenzwalthert
lorenzwalthert restored the token_insertion branch November 11, 2017 09:48
@lorenzwalthert
lorenzwalthert deleted the token_insertion branch November 21, 2017 09:11
krlmlr added a commit that referenced this pull request Nov 27, 2017
- Adapt documentation (#290).
- Add roundtrip (#287).
- Fix AppVeyor builds.
- Fix token insertion / comment interaction (#279).
- Clarify labelling strategy (#285).
- Fixing and extending Rstudioaddins (#283).
- Fix eq assign parsing (#276).
- style_files -> vectorized style_file (#273).
- Refactoring (#270).
- Fix CI (#275).
- Fix covr (#274).
- Renaming files (#271).
- Handle styling of an unsaved active file (#243).
- Test R 3.1 and R 3.2 (#249).
- Allow empty {} without line break (#261).
- Wrap expr in expr before enclosing with curly braces (#263).
- Avoid checking for hard-coded dot (#262).
- Account for dependency renaming (utf8 changed to enc) (#264).
- Indention of function declaration and closing braces (#260).
- Only remove line break before closing with strict option (#252).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants