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

rm-hull / jasengo / 19394572407
81%

Build:
DEFAULT BRANCH: main
Ran 15 Nov 2025 07:33PM UTC
Jobs 1
Files 7
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Nov 2025 07:33PM UTC coverage: 84.956% (-3.5%) from 88.475%
19394572407

push

github

web-flow
feat: Add ChainL and ChainR combinators (#4)

* feat: Add ChainL and ChainR combinators

Introduce `ChainL` and `ChainR` generic parser combinators.

These functions are essential tools for parsing expressions
involving binary operators and defining associativity:

* `ChainL`: Implements left associativity (e.g., `a op b op c` -> `((a
op b) op c)`).
* `ChainR`: Implements right associativity (e.g., `a op b op c` -> `(a
op (b op c))`).

An arithmetic expression parser example is included in
`parser_test/example2_test.go` demonstrating their usage.

* Update parser_test/example2_test.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Refactor: Rewrite ChainL using explicit loop

The `ChainL` parser combinator is rewritten to use a manual loop
implementation instead of relying on high-level combinators
like `Many` and `Bind`.

This approach provides finer control over state management,
consumed input tracking, and ensures correct handling of
syntax errors when the operator succeeds but the subsequent
operand fails. Specifically, if the operator succeeds, the
failure of the following value parser is treated as fatal.

* refactor: Simplify ChainR implementation using recursion

The previous implementation of `ChainR` was overly complex, relying on
`Many` and reverse iteration to handle right association.

This refactoring utilizes right recursion (`Rec`) and `Choice` to
implement the combinator more concisely and idiomatically for recursive
descent parsing, significantly improving readability.

* feat: Update example 2 to parse full integers

The grammar definition in `example2_test.go` was previously
limited to parsing single digits.

This commit updates the definition (renamed from `digit` to
`integer`) to correctly handle multi-digit numbers using
`parser.Many1`.

* docs: Document complex chain-right parser behavior

Adds documentation explaining the expected behavior of nested
`chain-right` parse... (continued)

27 of 44 new or added lines in 1 file covered. (61.36%)

288 of 339 relevant lines covered (84.96%)

1.01 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
17
80.53
-5.78% parser/combinators.go
Jobs
ID Job ID Ran Files Coverage
1 19394572407.1 15 Nov 2025 07:33PM UTC 7
84.96
GitHub Action Run
Source Files on build 19394572407
  • Tree
  • List 7
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8f057d2a on github
  • Prev Build on main (#19393388616)
  • Next Build on main (#19394653919)
  • Delete
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