neogeny / TatSu

竜 TatSu generates Python parsers from grammars in a variation of EBNF
https://tatsu.readthedocs.io/
Other
408 stars 48 forks source link

Breaking changes in 5.7 #249

Closed djmattyg007 closed 2 years ago

djmattyg007 commented 2 years ago

It looks like there were some breaking changes in 5.7 that means code generated with 5.6 simply doesn't work with 5.7. I tested with the latest commits on master in this repo, and I'm still seeing issues.

Is this expected, or is it a mistake? If it is expected, would you be able to provide details of what those expected breakages are?

djmattyg007 commented 2 years ago

Even regenerating the code doesn't with 5.7 doesn't fix the problems I'm seeing :(

djmattyg007 commented 2 years ago

Okay, the issue appears to be that the default values for comments_re and eol_comments_re changed, and I can't work out how to override the settings. Passing comments_re=None, eol_comments_re=None to the parser constructor does nothing.

djmattyg007 commented 2 years ago

This is how I fixed the issue for my codebase while maintaining compatibility with Tatsu 5.6:

https://github.com/djmattyg007/python-cuddle/commit/a8d8316cc44bb706f474b920f09a5a8d7eb3a73a

To sum up, there's two issues:

apalala commented 2 years ago

There are fixes for this use case in the upcoming v5.8.0. Could you check against the master branch?

apalala commented 2 years ago

Could yo revisit this against the latest Tatsu, @djmattyg007 ?