Change parser mode and state with a token output #679
Unanswered
TheOnlyTails
asked this question in
Q&A
Replies: 1 comment 2 replies
-
So first of all, I think you're framing this in an unhelpful way in your head. Chumsky is a declarative API: it's specifically designed to avoid needing to think about parser 'state' in this way. To implement this, you'll probably want to look into the context-sensitive parsers, such as |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm building a lexer, and I want it to, given a closing brace (
}
), produce a different token depending on the current parser state, and then change the state for the next token. I've looked at the docs a bunch but I can't find the exact way to do what I want, and I'd appreciate some help.In this specific case, the state is this struct:
Beta Was this translation helpful? Give feedback.
All reactions