-
Notifications
You must be signed in to change notification settings - Fork 290
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
Contextual keywords with custom lexer #112
Comments
The ideal would be to get the behaviour of the default lexer, where I can just use literals inline and not have to lex them separately at all. |
@jnicklas the workaround you listed is what I have done when modeling contextual keywords, but it might indeed be nice to have this more as a "builtin" feature. Contextual keywords don't mesh well with the "lexer-parser" divide that LALRPOP is based on. :( |
I guess I could imagine some sort of option that makes a "pseudo-terminal" identifier that is equal to a given set of other terminals. e.g. if you could say "let |
Closing in favor of #195 |
I'm trying to write a parser for GraphQL with LALRPOP. Since GraphQL has some rather odd lexing rules I have to use a custom lexer. Unfortunately, GraphQL also uses contextual keywords a lot. I haven't been able to figure out how to get both a custom lexer and contextual keywords working with LALRPOP.
One thing I can do to work around this is define a rule which maps all keywords to their respective string, kind of like this:
But this is very tedious, and it feels like there must be a better way.
The text was updated successfully, but these errors were encountered: