Repository navigation
feat(parser): keep one BOM diagnostic per line where beancount reads a BOM into an account - #3065
Merged
Merged
Conversation
Contributor
📊 Benchmark Results
vs base, measured in this run
A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: What do these numbers mean?
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
…a BOM into an account beancount's lexer reads a word holding a BOM, with a `:` in it, as an account, so its parser reports nothing there (its `Invalid account name` is a load-time error in rledger's terms). rledger reports the mid-file BOM once per such line. That rule lived in convert.rs's quiet_after_invalid_tokens; it is now a named deviation overlay, `bom-in-account` (compatibility.md P11), so the pass can go. The overlay keeps a stand-in slot (new SlotKind::StandIn) on the first account the reference's parser reads holding a BOM, on a line it reports nothing on and does not recover over. The reconciler fills a stand-in only with rledger's own diagnostic on its token, never a synthesized one, and the line's other syntax diagnostics go. Stand-ins are no beancount errors, so the drift check's overlaid slots leave them out. Parity: 122,378 of 123,394 inputs match, unchanged; one mismatching input loses an extra error (a category key re-pinned). BOM matrix and corpus baselines unchanged. WASM cache v151. Co-Authored-By: Claude Opus 5.5 <[email protected]>
robcohen
force-pushed
the
fix/bom-quiet-overlay
branch
from
November 27, 2026 17:05
02c26cd to
ab75364
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
beancount's lexer reads a word holding a BOM, with a
:in it, as an account. Its parser reports nothing on such a line. (Its builder'sInvalid account nameis a load-time error in rledger's terms, so the parity harness filters it out.) rledger reports the mid-file BOM (P0026) once per line, however many BOMs or accounts the line holds.Until now that rule lived in convert.rs's hand-modeled
quiet_after_invalid_tokens. This PR makes it a named deviation overlay,bom-in-account, documented indocs/reference/compatibility.mdas P11. With the overlay in place, the pass can be deleted (a later PR in this stack).SlotKind::StandIn. The overlay puts one on the first account the reference's parser reads (shifts, not discards) that holds a BOM, on a line the reference reports nothing on and does not recover over.overlaid_slots, which the drift check reads, leaves them out.Measurements (beancount 3.2.3)
impl:P0006+P0012becomesimpl:P0006, so that one category key is re-pinned.STRICT_BASELINEand the parser suite all pass with no changes.-D warningsis clean; the validate, loader, lsp, wasm and rustledger tests pass.Caches
WASM cache v151. The loader cache is unchanged, since it is never saved for a source with a parse error.
Merge order
This is the first of five follow-up PRs, plus a perf fix. Merge order and cache numbers:
drop_errors_inside_a_line_error(v152), stacked on this PRreport_at_multi_line_string_endsin the reconciler (v153)quiet_after_invalid_tokens(v155), stacked on refactor(parser): delete drop_errors_inside_a_line_error; the oracle names the invalid token #3067🤖 Generated with Claude Code