rust-bakery / nom

Rust parser combinator framework
MIT License
9.38k stars 804 forks source link

Change context to pass output mode information to the child parser. #1743

Closed kstrohbeck closed 4 months ago

kstrohbeck commented 5 months ago

Currently, the nom::error::context combinator calls parse on its argument, which forces it to run in streaming mode (as well as making it emit output and errors.) By directly implementing Parser, we can pass the OutputMode information down to the underlying parser.

codspeed-hq[bot] commented 4 months ago

CodSpeed Performance Report

Merging #1743 will not alter performance

Comparing kstrohbeck:context-output-mode (b4285d5) with main (1f74da5)

Summary

✅ 24 untouched benchmarks

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 8819785900

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/error.rs 9 10 90.0%
<!-- Total: 9 10 90.0% -->
Files with Coverage Reduction New Missed Lines %
src/character/streaming.rs 1 81.56%
src/error.rs 1 17.69%
<!-- Total: 2 -->
Totals Coverage Status
Change from base Build 8774369354: 0.03%
Covered Lines: 1829
Relevant Lines: 2933

💛 - Coveralls
codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 90.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 62.11%. Comparing base (1f74da5) to head (b4285d5).

Files Patch % Lines
src/error.rs 90.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1743 +/- ## ========================================== + Coverage 62.05% 62.11% +0.06% ========================================== Files 24 24 Lines 2917 2922 +5 ========================================== + Hits 1810 1815 +5 Misses 1107 1107 ```

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