You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been playing with Participle and I wanted to try to codegen feature, however the generated code seems to not escape some characters, leading to uncompilable source.
While I do agree that I could rename my Rule name to make the whole thing works, I think it might be a good idea to come up with some strategy in order to avoid this when generating code.
I'm fine with writting a PR if you have a idea for this.
Cheers !
The text was updated successfully, but these errors were encountered:
Ah nice catch, though they are not valid rule names as only identifiers can be matched by the parser. This is really a validation error, but a PR would be welcome to apply the validation.
Hi,
I've been playing with Participle and I wanted to try to codegen feature, however the generated code seems to not escape some characters, leading to uncompilable source.
See the following example :
My rules used :
As far as I can tell it comes from https://github.com/alecthomas/participle/blob/master/lexer/codegen.go#L251
While I do agree that I could rename my Rule name to make the whole thing works, I think it might be a good idea to come up with some strategy in order to avoid this when generating code.
I'm fine with writting a PR if you have a idea for this.
Cheers !
The text was updated successfully, but these errors were encountered: