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 var"" nonstandard identifiers in var nodes #127

Merged
merged 1 commit into from
Oct 30, 2022
Merged

Conversation

c42f
Copy link
Member

@c42f c42f commented Oct 21, 2022

Useful to hold associated trivia (delimiter and var prefix) and indicate in a clean way that var"" was used.

Part of #88

@c42f c42f mentioned this pull request Oct 21, 2022
33 tasks
@c42f
Copy link
Member Author

c42f commented Oct 21, 2022

Hmm ok. So k == K"Identifier" doesn't work for identifiying identifiers after this change. Not hard to fix, just need to decide between

  • Using K"var" for the head and adding an is_identifier predicate
  • Using K"Identifier" for the head

Also the presence of var"" needs to be covered by the parser tests in various places after this change

@c42f
Copy link
Member Author

c42f commented Oct 26, 2022

So... I feel like

  • A K"var" head is a nice unambiguous representation of the concrete syntax
  • A plain symbol (as exists currently and as Expr uses) is clearly a nice representation of the abstract syntax
  • An internal node with head K"Identifier" would be a weird halfway solution between these

So let's go with K"var" head I guess

Useful to hold associated trivia (delimiter and var prefix) and indicate
in a clean way that var"" was used.
@c42f c42f force-pushed the c42f/var-wrapper branch from 10dccf0 to ebc1182 Compare October 30, 2022 06:18
@c42f c42f merged commit 1bf1787 into main Oct 30, 2022
@c42f c42f deleted the c42f/var-wrapper branch October 30, 2022 06:28
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.

1 participant