petitparser / dart-petitparser

Dynamic parser combinators in Dart.
https://pub.dartlang.org/packages/petitparser
MIT License
457 stars 48 forks source link

Make the loopback variable public in expression builder #168

Closed joranmulderij closed 8 months ago

joranmulderij commented 8 months ago

This is useful for complex parsers where you want the nice stuff from expression builder but don't want to loose the ability to loop back from you expression builder. For example, in my parser I have something like this:

  final builder = ExpressionBuilder<Token<Expr>>();

  final expr = builder.loopback;

expr gets used in the lines parser, which gets used in the block parser. The block parser is a primitive for the expression builder again.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.97%. Comparing base (5cd0bde) to head (3b7b764). Report is 9 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #168 +/- ## ======================================= Coverage 98.97% 98.97% ======================================= Files 105 105 Lines 2153 2153 ======================================= Hits 2131 2131 Misses 22 22 ```

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

renggli commented 8 months ago

Thank you for the contribution!