lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.64k stars 397 forks source link

ContextualLexer now uses self.basic_lexer for easy extensibility (iss… #1342

Closed erezsh closed 9 months ago

erezsh commented 10 months ago

…ue #1329)

codecov-commenter commented 10 months ago

Codecov Report

Patch coverage: 89.47% and project coverage change: -0.02% :warning:

Comparison is base (c2e44ea) 89.23% compared to head (d83ad87) 89.22%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1342 +/- ## ========================================== - Coverage 89.23% 89.22% -0.02% ========================================== Files 51 51 Lines 7591 7600 +9 ========================================== + Hits 6774 6781 +7 - Misses 817 819 +2 ``` | [Flag](https://app.codecov.io/gh/lark-parser/lark/pull/1342/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lark-parser) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/lark-parser/lark/pull/1342/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lark-parser) | `89.22% <89.47%> (-0.02%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lark-parser#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/lark-parser/lark/pull/1342?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lark-parser) | Coverage Δ | | |---|---|---| | [lark/lexer.py](https://app.codecov.io/gh/lark-parser/lark/pull/1342?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lark-parser#diff-bGFyay9sZXhlci5weQ==) | `90.78% <89.47%> (-0.28%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

erezsh commented 10 months ago

@davidmcnabnz Can you confirm this PR solves your issue?

(you can inherit ContextualLexer and override its basic_lexer attribute)

davidmcnabnz commented 10 months ago

Thanks for that @erezsh . Commits look good, and plug up the configurability gap well. I look forward to migrating my lexer/parser over to the new version.