Skip to content

Help with simple usage #415

Closed Answered by alecthomas
LGMAM asked this question in Q&A
Discussion options

You must be logged in to vote

Traditional lexer/parsers like Participle operate in two independent phases: the lexer extracts named tokens from the raw text, then the parser uses those tokens to construct an AST. Your lexer only has tokens for "Ident", so when it encounters "==" it fails. You'll need to define rules for any possible text you might encounter. Also note that the rules are tried in order, first match wins.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LGMAM
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
Converted from issue

This discussion was converted from issue #414 on August 28, 2024 19:28.