Skip to content

test(conformance): a digit-initial non-number is an error - #26

Merged
lejmr merged 3 commits into
mainfrom
conformance/digit-initial-number-and-plus-equals-list
Oct 22, 2026
Merged

lejmr merged 3 commits into
mainfrom
conformance/digit-initial-number-and-plus-equals-list

Conversation

@lejmr

@lejmr lejmr commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Proofreading the conformance suite against spec/HOCON.md found a rule no case pinned, where zig-hocon and pyhocon part ways.

unquoted-strings/025-digit-initial-invalid-number: a = 1.2.3

  • Spec, unquoted-strings.12/.13: "An unquoted string may not begin with the digits 0-9 or with a hyphen" and "The initial number character, plus any valid-in-JSON number characters that follow it, must be parsed as a number value." 1.2.3 (the shape of 127.0.0.1) isn't a number, so the input is an error (BadNumber).
  • java: lenient, java_expect: {"a": "1.2.3"}. typesafe/config 1.4.9 and pyhocon both read it as a string.
  • python/MIGRATING.md gets what this means for a pyhocon user: an IP address needs quotes (a row in No silent guesses and a Step 3 bullet).

A second case, a += [3, 4] → [1, 2, [3, 4]], was dropped in review: it is 001's desugaring with 008's composite element, and pyhocon already fails the whole += section, so it told no implementation apart. The pyhocon difference stays pinned in python/tests/test_pyhocon_compat.py (#25).

Docs: FINDINGS.md gets a short "Since then" note, and the digit-initial "uncovered" bullet says it's covered. SECTIONS.md: unquoted strings 24→25. README and MIGRATING.md: 445 of the 446.

Checks

  • fill-expected.py --check: 446 cases, 0 sidecars stale.
  • Measured on the 446: zig-hocon (spec 445/446, java 401/446), typesafe/config 1.4.9 (spec 401, java 445) and pyhocon (spec 314, java 298). Against main, each report differs only in the 025 row.
  • Not re-measured: hocon2, pulse-pyhocon, py.hocon and rs.hocon; their tables count 446 with no result for 025.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CbBo1aotFTDLY2gery7qYD

lejmr and others added 3 commits October 22, 2026 06:48
Proofreading the suite against spec/HOCON.md found two rules no case pinned, both places where zig-hocon and pyhocon part ways:

- unquoted-strings/025: a = 1.2.3 must be parsed as a number and is not one, so it is an error (java: lenient, it and pyhocon read the string "1.2.3")
- plus-equals-field-separator/009: a += [3, 4] is a = ${?a} [[3, 4]], so the list is appended as one element (typesafe/config agrees; pyhocon splices it)
a += [3, 4] is 001's desugaring with 008's composite element, and pyhocon
already fails the whole += section, so the case told no implementation
apart. Java, pyhocon and zig-hocon measured on the 446; MIGRATING.md says
an IP address needs quotes, which is what 025 means for a pyhocon user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CbBo1aotFTDLY2gery7qYD
@lejmr lejmr changed the title test(conformance): a digit-initial non-number and a list appended by += test(conformance): a digit-initial non-number is an error Oct 22, 2026
@lejmr
lejmr marked this pull request as ready for review October 22, 2026 19:44
@lejmr
lejmr merged commit ecd556f into main Oct 22, 2026
42 checks passed
@lejmr
lejmr deleted the conformance/digit-initial-number-and-plus-equals-list branch October 22, 2026 19:52
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.

1 participant