• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / jasengo / 19395323687

15 Nov 2025 08:42PM UTC coverage: 75.448% (-0.004%) from 75.452%
19395323687

push

github

web-flow
refactor: Use pointers for parser state and location (#5)

* refactor: Use pointers for parser state and location

Updated various struct methods, including `State`, `Location`, and
`ParseError`, to use pointer receivers (`*Type`).

This modification:

*   Avoids unnecessary copying of potentially large structs.
*   Makes `State.advanceRune` return `*State` for consistent state
    management.

* refactor: Change Parser input from State to *State

The parser library previously passed the `State` struct by value,
causing significant copying overhead during parsing operations.

This commit changes the fundamental signature of the `Parser` type
and related functions (e.g., `success`, `failT`, `NewState`) to use
`*State` (a pointer).

This effectively changes the input mechanism from pass-by-value
to pass-by-reference, improving parsing performance.

* refactor: Use pointer for State input string

This refactors the `State` structure to hold a pointer to the input
string instead of the string value itself.

This change ensures that the parsing state holds a reference to the
input, which avoids potentially unnecessary string copies when
creating new `State` instances.

33 of 39 new or added lines in 5 files covered. (84.62%)

2 existing lines in 2 files now uncovered.

295 of 391 relevant lines covered (75.45%)

0.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.2
/parser/combinators.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc