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

Fixed issue #2457 #7361

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

wizard7377
Copy link
Contributor

Fixed the issue of not allowing white space before commas that separated function arguments

@@ -605,7 +605,10 @@ fn expression<'a>(
.parse(arena, state, min_indent)?;

let (p2, rest, rest_state) = zero_or_more(skip_first(
backtrackable(byte(b',', EType::TFunctionArgument)),
backtrackable(skip_first(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than doing skip_first, I think we need to be preserving this space in the tree. Otherwise we could accidentally lose a comment when formatting, for example.

Rather than separately tracking spaces before/after the comma, we should probably just merge them. There's a handy merge_spaces function for just that purpose.

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