textX / Arpeggio

Parser interpreter based on PEG grammars written in Python http://textx.github.io/Arpeggio/
Other
270 stars 55 forks source link

Error reporting: print newline characters escaped #99

Closed stanislaw closed 1 year ago

stanislaw commented 1 year ago

Hello,

This is a contribution from @mettta and @stanislaw that addresses the issue https://github.com/textX/textX/issues/397.

We are not sure if patching StrMatch's _exp_str method is the right way to do it, so using this patch to open a discussion.

When the implementation path is confirmed, we are happy to address the remaining contributor checklist's action points.


Code review checklist

igordejanovic commented 1 year ago

Thanks @mettta and @stanislaw for the contribution.

The fix using _exp_str didn't handle two cases: a case with regexes, and a case when the match is the root rule. I added two additional test cases and changed the fix to use eval_attrs in NoMatch.

See this branch. I will merge this to master shortly.

igordejanovic commented 1 year ago

Resolved conflicts and merged to master.

stanislaw commented 1 year ago

Hi @igordejanovic, is there a chance for this small but very useful change to be released already? Thanks.

igordejanovic commented 1 year ago

Hi @stanislaw . Sure. I'll do the release in the following days.

igordejanovic commented 1 year ago

@stanislaw I've just released 2.0.1 with this fix only.

stanislaw commented 1 year ago

Thank you. I will check how it works with my project.