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

[POC] feat: Allow the parser to direct the which tokens it expects from the lexer #673

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Marwes
Copy link
Contributor

@Marwes Marwes commented Jul 5, 2022

AKA lexer modes.

Quick-ish experiment to investigate if it is feasible to use lalrpop for https://github.com/influxdata/flux . Seems to work for the purpose of allowing division (/) and regex /a.+/ to co-exist in a grammar. The code is in a hacky state right now though due to the neecessary addition of LexerIterator so there would need to be more work before this could be merged. I also don't know how well this scales to other grammars. Implementation is based on a cursory understanding of the paper mentioned here #195 (comment) .

Closes #195

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.

have parser offer lexer feedback as to which tokens are expected
2 participants