Skip to content

yaml: tolerate unquoted comma-separated number pairs#11

Merged
rjrodger merged 1 commit into
mainfrom
claude/harden-jsonic-yaml-plugin-fmuAk
May 17, 2026
Merged

yaml: tolerate unquoted comma-separated number pairs#11
rjrodger merged 1 commit into
mainfrom
claude/harden-jsonic-yaml-plugin-fmuAk

Conversation

@rjrodger
Copy link
Copy Markdown
Contributor

The digit-prefix branch of the YAML matcher only handled trailing
commas (e.g. "12,"). Inputs like "key: 1, 2" or "- 1.5, 2.5" reached
jsonic's number matcher, which grabbed the leading digits and left
the rest of the line to error out as "unexpected character(s): 2".

In block context, commas are valid plain-scalar characters (the
text-prefix path already handled "key: foo, bar"). Embedded commas
now route through text.check (via skipNumberMatch), so the whole
plain scalar — including spaces and multi-line continuation — is
captured. Flow-context comma semantics are unchanged.

Mirrored in go/yaml.go for parity.

The digit-prefix branch of the YAML matcher only handled trailing
commas (e.g. "12,"). Inputs like "key: 1, 2" or "- 1.5, 2.5" reached
jsonic's number matcher, which grabbed the leading digits and left
the rest of the line to error out as "unexpected character(s): 2".

In block context, commas are valid plain-scalar characters (the
text-prefix path already handled "key: foo, bar"). Embedded commas
now route through text.check (via skipNumberMatch), so the whole
plain scalar — including spaces and multi-line continuation — is
captured. Flow-context comma semantics are unchanged.

Mirrored in go/yaml.go for parity.
@rjrodger rjrodger merged commit bb64f8e into main May 17, 2026
6 checks passed
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.

2 participants