Skip to content
Discussion options

You must be logged in to vote

The issue is that two of your tokens have overlapping regex patterns: Ident and Text.

You're matching "Text" in TextNode, but Ident has higher precedence in the lexer rules, so Text will never be produced. You can fix this by either changing TextNode to this:

	Value string `parser:"(@Ident | @Text)"`

Or fixing your lexer rules to remove the ambiguity. I'd suggest doing this.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@struckchure
Comment options

Comment options

You must be logged in to vote
1 reply
@struckchure
Comment options

Answer selected by alecthomas
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 #437 on May 25, 2025 03:51.