Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
re2c option -F (flex syntax) broken #229
re2x -F (Flex syntax) version 1.1.1 throws a syntax error for the regex
I can work around this issue for now by using regex
This does look like an error to me. But this behaviour goes back as far as re2c-0.13.6 (and supposedly before that), and Flex syntax has always been only vaguely defined in re2c. I first need to understand what re2c already supports (otherwise the fix may break someone else's code), and then see how we can fix that without introducing ambiguity in grammar.
There is another workaround. This causes syntax error:
But this doesn't (indentation doesn't matter as long as the code in braces is on a new line):
@genivia-inc It's not the special characters
The reason why it fails is partly historical: partial support for flex syntax was added on top of already existing re2c-specific syntax, which caused parsing conflicts (some due to limitations in the implementation, some due to genuine ambiguity in grammar).
I have a fix for the original example, but I want to make sure that it doesn't break existing code and check similar cases.