Repository navigation
fix(scanner): report block scalar starting lines - #973
Draft
owenshen0907 wants to merge 1 commit into
Draft
owenshen0907 wants to merge 1 commit into
owenshen0907 wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #973 +/- ##
==========================================
+ Coverage 80.65% 80.73% +0.07%
==========================================
Files 22 22
Lines 6845 6851 +6
==========================================
+ Hits 5521 5531 +10
+ Misses 905 901 -4
Partials 419 419 🚀 New features to boost your workflow:
|
This was referenced Oct 30, 2026
This branch has not been deployed
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.
Fixes #813.
When a literal or folded block scalar ends at EOF or a document marker, its content token reports the scanner's ending line instead of the block's starting line. Count line breaks in the original source buffer before emitting the token, accounting for the unconsumed final line break at EOF. Use the source buffer for the ordinary multiline path too, since folding replaces some line breaks with spaces.
The regression matrix checks the starting line, scalar value, original text, and parsing with comments for 126 combinations: literal/folded styles, clip/strip/keep chomping, LF/CRLF/CR, three EOF endings, following comments/mappings, and
---/...markers. 108 cases fail against the unchanged scanner; all 126 pass after this change. Other position fields retain their existing calculations.Validation on macOS arm64:
go test -race ./...andgo test -race ./testdata -modfile=testdata/go_test.modpass on Go 1.24.13 and Go 1.26.3.go vet ./...,go build ./..., gofmt andgit diff --checkpass.go test -run=^$ -fuzz=FuzzUnmarshalToMap -fuzztime=10s -parallel=2passes (270,649 executions).Base:
masteratedee2f91616c6d73112a13e7c0dbde72ce938877.AI assistance was used; reproduction, source changes, and validation results were reviewed locally.
Upstream CI for
cb52db6: run 40473291015 finished with 13 successful jobs, one failed macOS/Go 1.22 race job, and 11 jobs cancelled by fail-fast. The failed job aborts the root test binary before tests start withdyld: missing LC_UUID load command; all 126 new lexer subtests pass in that job. Locally, Go 1.22.12go test -race -run=^$ .reproduces the same loader abort on both the unchanged base and this branch. CI is therefore not green; no workflow change or rerun was made.