Conversation
Similar to ListRef, when MapRef is enabled maps are returned as MapRef instances with Val (map[string]any) and Implicit (bool) fields. Implicit is true when the map was created without braces, false when braces were used explicitly. Deep merge and clone handle MapRef correctly. https://claude.ai/code/session_01D5CGemFCpBTz79UDLSMjVf
Tests cover: explicit/implicit wrapping combinations, empty structures, triple/quad nesting (MapRef>ListRef>MapRef>ListRef), path dive, deep merge preserving both Ref wrappers, mixed content types, pair-in-list, strict JSON compat, all three options combined (MapRef+ListRef+TextInfo), null values in combined structures, and scalar passthrough. https://claude.ai/code/session_01D5CGemFCpBTz79UDLSMjVf
Implements the list.child option from the TypeScript codebase. When List.Child is enabled, bare colon syntax in lists (e.g. `[:1, a, b]`) stores the colon-prefixed value in ListRef.Child instead of as a list element. Multiple child values are deep-merged (or last-wins when Map.Extend is false). Changes: - ListRef struct: add Child field for optional child value - ListOptions: add Child *bool option (default: false) - LexConfig: add ListChild bool - Grammar: add elem Open alt matching bare CL token, elem BC handler to accumulate child values on parent list rule, list BC handler to transfer child$ to ListRef.Child - Utility: deepClone and deepMerge handle ListRef.Child - list.child auto-enables ListRef (required to store Child in Go) - 48 tests covering all TS spec cases: scalars, maps, lists, deep merge, path dive, trailing/leading commas, interleaved children, MapRef+TextInfo interaction, extend disabled https://claude.ai/code/session_01D5CGemFCpBTz79UDLSMjVf
…re files
Implements map.child: bare colon `:value` in maps stores as `child$` key.
Implements list.pair: pairs in lists become `{key:val}` object elements.
Adds TSV-driven tests that validate against all 7 previously uncovered
test spec files, ensuring feature parity with the TypeScript version:
- feature-list-child.tsv (45 cases)
- feature-list-child-deep.tsv (20 cases)
- feature-list-child-pair.tsv (18 cases)
- feature-list-child-pair-deep.tsv (8 cases)
- feature-list-pair.tsv (52 cases)
- feature-map-child.tsv (32 cases)
- feature-map-child-deep.tsv (11 cases)
All 37 TSV spec files are now covered by Go tests.
https://claude.ai/code/session_01D5CGemFCpBTz79UDLSMjVf
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.
No description provided.