Open jeertmans opened 1 year ago
Thanks for the very detailed report. I think I've some idea of what's happening here, namely:
\
which is a potential match.b
and continues to match whole \begin
which is a potential match.{
, doesn't find it, so it settles on the last correctly matched pattern, which it incorrectly assumes to be 1 instead of 2.I'll see what I can do about it today.
Happy to see you back @maciejhirsz :D
I hope you will find how to solve this! Do not hesitate if I can help!
Hello! For the context, I am writing a TeX file parser, and I use
Logos==0.12.1
to create a lexer.You can find a (reduced) version of my
Token
implementation:When I run my test suite, see reduced version below, it works fine. However, when I add the enum variant
DocumentBegin
, which should not be matches by anything in within the test suite, I get an error saying that\begin
now matches tokenBackslash
. This does not make sense to me, sinceBlackslash
should only match\\
, and nothing else.If I comment out the
Backslash
token, then\begin
matchesMacroName
, but notEnvironmentBegin
.After reading the documentation, testing on different versions of
Logos
, I still cannot understand why this does not work as expected.Can someone help me about this?
Test suite
Test outputs
Without
DocumentBegin
variantWith
DocumentBegin
variantWith
DocumentBegin
variant, withoutBackslash
variant