-
Notifications
You must be signed in to change notification settings - Fork 64
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
Keywords design #53
Comments
Specifying keywords should probably look like this, to match the {
'kw-while': 'while',
'kw-else': 'else',
} (With an accompanying public helper function for generating such dicts, from a naming function and a list of keyword literals.) |
@nathan You designed most of the Moo API; do you have any suggestions for this? :-) |
If token types are gonna be renamed, will this impact error messages? E.g. |
Well… Maybe you shouldn't…
Perhaps just make it an error for keywords (i.e. literal string matches) to appear after a non-keyword rule. Then it's obvious that they take precedence. |
Keywords are now explicit. |
ignoreCase
option, which is currently missing from Moo (see Case insensitive keywords? #46). Note that this can only apply to keyword literals, not RegExps; we can't compile arbitrary regexps to their case-insensitive equivalents! Thevalue
of the emitted token would always be the originally specified literal (i.e. case-normalised).type
of tokens, not their valueswitch
, rather than using a dict)The text was updated successfully, but these errors were encountered: