Open skneko opened 3 years ago
Turns out, the bug is caused by [+-]
Right now, the parser interprets this as a range from +
to ]
. We'll need to rework the regex parser a bit to consider these cases.
While implementing a Lua parser, the following regexes caused a parse error aswell (Lua comment & block comment):
[Regex(@"--([^\r\n\[][^\r\n]*)?")]
[Regex(@"--\[([^\]]|(\][^\-])|(\]-[^\-]))*\]--")]
Describe the bug When using the built-in regex
Regexes.IeeeFloatLiteral
in a lexer like this:the following error is emitted by the source generator:
The regex contained in the aforementioned constant is as follows:
I've tested this regex in this site: http://regexr.com/63qtu, and it looks valid. It also seems to be valid according to minimalist flavor supported by Yoakke and described in the docs.
Which libraries does it affect?
Yoakke.Parser.Generator
2021.8.16-2.23.12-nightlyTo Reproduce Steps to reproduce the behavior:
[Regex(Regexes.IeeeFloatLiteral)]
as shown above.Expected behavior The project should build normally and the regex should match floating point number literals as indicated in the valid regex.
Environment (please complete the following information):