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

Parser: refactor 'foo.%` call parsing #10351

Merged
merged 1 commit into from
Feb 14, 2021

Conversation

makenowjust
Copy link
Contributor

Fixed #10296

Currently, % call parsing is specialized like if current_char == '%' way in the parser, to avoid a confliction with %-string literals. However, the lexer has wants_def_or_macro_name flag for such things, we should use this instead of the custom if way.

The commit fixes the formatter also to set wants_def_or_macro_name flag correctly.

Fixed crystal-lang#10296

Currently, `%` call parsing is specialized like `if current_char == '%'`
way in the parser, to avoid a confliction with `%`-string literals.
However, the lexer has `wants_def_or_macro_name` flag for such things,
we should use this instead of custom `if` way.

The commit fixes the formatter also to set `wants_def_or_macro_name`
flag correctly.
@asterite asterite merged commit 1c8a41e into crystal-lang:master Feb 14, 2021
@makenowjust makenowjust deleted the fix-10296-percent-call branch February 14, 2021 16:38
@bcardiff bcardiff added this to the 1.0.0 milestone Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatter bug while parsing % call
4 participants