-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong result only if another rule is present #57
Comments
Original comment by: skvadrik |
Reproduced, looking into it. Original comment by: skvadrik |
Since 0.13.7, re2c tries to merge common suffixes in regexps. It's a bug in the merging algorithm. Anothe rule just re-uses 'escaped_char', which triggers the error. Original comment by: skvadrik |
Fixed, see https://sourceforge.net/p/re2c/code-git/ci/1a97c678d5ae0dac02234ee65d9bd847dd43c449 Will soon release 0.14.2 with this bugfix included. If the larger example is open source code, it will be great to add it to re2c test collection. Original comment by: skvadrik |
Original comment by: skvadrik |
Released re2c-0.14.2 with bugfix. Could you send me your real-world example? I will add it to re2c test collection (and it won't break next time). Original comment by: skvadrik |
Is this it? https://github.com/jgm/cmark/blob/master/src/scanners.re Original comment by: starseeker |
Very likely, thanks! Original comment by: skvadrik |
Thanks for the quick response. Version 0.14.2 fixes the issue. The link provided by Cliff is correct. Original comment by: nwellnhof |
* master: Updated version to 0.14.4.dev Release 0.14.3. Added simple test for yacc-style brackets (see patch #27) Fixed '#27 re2c crashes reading files containing %{ %}' (patch by Rui) Makefile.am: dropped distfiles for MSVC (they are broken anyway) Added full another test for bug #57. Updated version to 0.14.3.dev Release 0.14.2. Fixed bug #57: Wrong result only if another rule is present Updated version to 0.14.2.dev Release 0.14.1. Pad version with '0' instead of nulls
When making regexp alternative, only 'RegExp::PRIVATE' attribute should be propagated. Propagating 'RegExp::SHARED' attribute is a mistake, as can be observed from the following example: name = "smth1"; "smth2" | name | "smth3" { ... } name { ... } Here, 'name' must have 'RegExp::PRIVATE' attribute, but it gets broken after alternation. See #bug57 or test 'bug57.re' for full working example.
The following program produces the wrong result
If the first rule
[<]...
is removed, the correct result is produced:This could be reproduced with re2c 0.13.7.5 and 0.14.1. Versions 0.13.5 and 0.13.6 work fine.
(This is a reduced testcase. The problem was discovered in a more complicated scanner in libcmark.)
Original comment by: nwellnhof
The text was updated successfully, but these errors were encountered: