-
Notifications
You must be signed in to change notification settings - Fork 107
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
regex match group index problem #79
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry new issue again, this is about sly re match group
First I use a regex to match LITERAL string like this
and after search I choose to use this regex expression
https://stackoverflow.com/questions/14366401/correctly-parsing-string-literals-with-pythons-re-module
but when used in sly lexer, it raise error
error: cannot refer to an open group at position 29
after debug this file https://github.com/dabeaz/sly/blob/master/sly/lex.py#L307
I found that the
\1
should be replaced with\2
finally, I found that it is also related with the TOKEN define order (see https://github.com/alingse/thrift-parser/blob/master/simple.py#L25 )
😂
In these case, Is this a correct way ? I mean count the expression define order to set the match group index.
btw, forgive my offense, can we mention this in some document?
The text was updated successfully, but these errors were encountered: