My understanding of the token disambiguation documentation is that the first example should work as I'd expect, with Else and ElseIf being matched independently, with higher priority than Other. Do I have that wrong? And is the last example exposing a bug?
I'm working on a lexer for a language where I'd like to have
else
andelse if
lexed as separate tokens, but I'm running into suprising behaviour.In the following example you can see that
else
has been lexed asOther
:Removing the space from
else if
allowselse
to be parsed asElse
:Keeping the space in
else if
, but removing some of the characters fromElse
causes it to be unexpectedly matched.My understanding of the token disambiguation documentation is that the first example should work as I'd expect, with
Else
andElseIf
being matched independently, with higher priority thanOther
. Do I have that wrong? And is the last example exposing a bug?Thanks for your time and the great library!