Skip to content

Backquoted identifiers #65

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

Merged
merged 2 commits into from
Jan 4, 2023
Merged

Conversation

keynmol
Copy link
Collaborator

@keynmol keynmol commented Jan 3, 2023

Copy of #51 but I force-pushed the branch on a closed PR and can no longer reopen it.

@keynmol keynmol marked this pull request as ready for review January 3, 2023 21:43
grammar.js Outdated
Comment on lines 782 to 784
// inside ` corresponds roughly to charNoBackQuoteOrNewline in Scala 3 EBNF
_char_no_back_quote_or_newline: $=> /[^\n`]+/,
identifier: $ => choice($._plainid, seq('`', $._char_no_back_quote_or_newline, '`')),
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you use seq(...) wouldn't the current grammar allow newline in between the backquote and $._char_no_back_quote_or_newline? i.e.

val `

test-this` = 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right, I changed it from a regex, and it is indeed incorrect.
Using token.immediate also didn't work (and I didn't have the patience to experiment given that the grammar takes 2 minutes at least to regenerate)

It's back to original form in 0d94e6e

@keynmol keynmol force-pushed the backquoted-identifiers branch from 9d6f778 to dfe6998 Compare January 4, 2023 08:09
Copy link
Collaborator

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

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

👍🏼 Thanks @keynmol!

@ckipp01 ckipp01 merged commit fe1d87f into tree-sitter:master Jan 4, 2023
@keynmol keynmol deleted the backquoted-identifiers branch January 4, 2023 09:07
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.

3 participants