Skip to content

ResumableParser: Don't compute lines and columns on parse error#1030

Merged
byroot merged 1 commit into
ruby:masterfrom
byroot:resumable-no-lines-and-columns
Jun 19, 2026
Merged

ResumableParser: Don't compute lines and columns on parse error#1030
byroot merged 1 commit into
ruby:masterfrom
byroot:resumable-no-lines-and-columns

Conversation

@byroot

@byroot byroot commented Jun 19, 2026

Copy link
Copy Markdown
Member

Fix: #1022

They can't always be accurate because we don't always keep the full document in the buffer. As such it's better never to compute them than to sometimes provide wrong coordinates.

In theory we could keep the number of lines since the start of the parse, but that's more book keeping for little utility.

Anyway, these are useful to find a syntax error in a file, not so much in a stream of documents.

Fix: ruby#1022

They can't always be accurate because we don't always keep the
full document in the buffer. As such it's better never to compute
them than to sometimes provide wrong coordinates.

In theory we could keep the number of lines since the start
of the parse, but that's more book keeping for little utility.

Anyway, these are useful to find a syntax error in a file,
not so much in a stream of documents.
@byroot byroot force-pushed the resumable-no-lines-and-columns branch from c6ff0e2 to 1af17f0 Compare June 19, 2026 08:41
@byroot byroot merged commit b237211 into ruby:master Jun 19, 2026
41 of 42 checks passed
@byroot byroot deleted the resumable-no-lines-and-columns branch June 19, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON::ResumableParser: error column does not match the input position

1 participant