Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap expr in expr before enclosing with curly braces #263

Merged
merged 5 commits into from Oct 27, 2017

Conversation

lorenzwalthert
Copy link
Collaborator

@lorenzwalthert lorenzwalthert commented Oct 25, 2017

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
Collaborator Author

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

Copy link
Member

@krlmlr krlmlr left a comment

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
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.

None yet

2 participants