-
Couldn't load subscription status.
- Fork 0
Refactor underscore ban #1
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
base: lw/21584
Are you sure you want to change the base?
Refactor underscore ban #1
Conversation
mandolaerik
commented
Nov 17, 2023
- Refactor underscore ban
- Remove old underscore ban
- Ensure discard refs work with new API
| and compat.discard_ref_shadowing not in dml.globals.enabled_compat): | ||
| report(ESYNTAX(site, '_', "reserved identifier")) | ||
| @prod_dml14 | ||
| @lex.TOKEN(ident_rule('ident_or_underscore', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer ident_or_discard_ref.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to investigate a bit more as to why I ran into reduce/reduce conflicts...
| 'ELLIPSIS' : '<i>"..."</i>', | ||
| '<empty>' : '<empty>' | ||
| '<empty>' : '<empty>', | ||
| '_' : '<b>_</b>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the token be named DISCARDREF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disagree weakly. Other keyword-formed tokens are named as the keyword.
| 'FOREACH', 'IN', 'IS', 'LAYOUT', 'LOCAL', 'LOG', 'SELECT', | ||
| 'SIZEOFTYPE', 'TYPEOF', 'UNDEFINED', 'VECT', '_WARNING', 'WHERE', | ||
| 'EACH', 'SESSION', 'SEQUENCE', | ||
| 'EACH', 'SESSION', 'SEQUENCE', '_', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be 1.4 exclusive, no? Way I went about it in my WIP work was, in dmllex14:
keywords_dml14['_'] = 'DISCARDREF'
tokens.add('DISCARDREF')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, although somewhat 'tomato tomato'.
|
@mandolaerik what was previously a shift/reduce conflict that could be resolved via Your approach where both |
d56cfe8 to
7fe389c
Compare
dd7d5d7 to
9854d98
Compare