Closed gahr closed 2 years ago
The internals of the regex lib compilation to DFA are a lot faster. Because I was afraid of breaking anything, I did a lot of testing besides the usual barrage of tests. But alas, it seems there is a problem marking the accepting states that determine which of the patterns matched, giving the atom
precedence over int
. I will fix this ASAP.
I found the problem for this regression issue. I will release an update soon after some more testing, just to be sure.
Fixed. The problem was a subtle optimization in the DFA construction that failed in very rare cases. Thanks for reporting this issue.
Thanks, I confirm it's fixed in 112e2de2.
Please don't forget to tag a 3.2.1 release, thanks!
Here's a stripped down version of a grammar I'm using
whitespace [\x00\x09\x0A\x0C\x0D\x20]+ digit [0-9] integer -? {digit}+ atom [^][()<>{}/%\x00\x09\x0A\x0C\x0D\x20]+
%%
{whitespace} { / ignore white space / } {integer} { std::cout << "int: " << str() << "\n"; } {atom} { std::cout << "atom: " << str() << "\n"; } . { throw "undefined"; }
%%
int main(int argc, char **argv) { std::istringstream input{ argv[1] }; return Lexer(input).lex(); }
$ ./sample 1234 int: 1234
./sample 1234 atom: 1234