Skip to content

Strange output with terminal priorities #1488

Closed Answered by erezsh
vivien000 asked this question in Q&A
Discussion options

You must be logged in to vote

The second line works because when parsing, Lark can use information from the parser to help the lexer choose the correct terminal, using the "contextual lexer".

This information isn't available when just lexing, so it chooses the more specific terminal, without regard for context.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by vivien000
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants