Skip to content

Help with 'Token ___ can never be matched.' error? #765

Answered by msujew
martaver asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @martaver,

in theory it's a feature, in practice it's a bug. We perform an optimization where we put whitespace terminals in the front of the lexer array, as that improves performance, see here. However the way we identify such tokens is by identifying whether they are able to parse a single whitespace character (' ').

You can work around this by either overriding the token builder and move the token manually to the back of the array or modify the terminal regex in a way that it is not able to parse a single whitespace character.

Replies: 2 comments

Comment options

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