Update jsonic dependency to >=2.20.1 and modernize CI workflow#1
Merged
Update jsonic dependency to >=2.20.1 and modernize CI workflow#1
Conversation
Update jsonic peer dependency to require >=2.20.1 (latest). Update GitHub Actions to current versions (checkout@v4, setup-node@v4, coveralls@v2) and Node.js matrix to 20.x, 22.x, 24.x. https://claude.ai/code/session_01GsBzDgTWG9EY3fu5bhbiXQ
- Create Go version of the expr plugin in go/ folder using jsonicjs/jsonic Go as dependency - Implement Pratt parser with infix, prefix, suffix, ternary, and paren operators - Add separate 'paren' rule to avoid val↔expr infinite backtrack loop - Add test/spec/ folder with 14 TSV spec files covering all operator types - Create shared spec test infrastructure for both TS and Go - All 18 Go tests and 50 TS tests pass https://claude.ai/code/session_01GsBzDgTWG9EY3fu5bhbiXQ
Convert 14 TS unit tests into shared TSV spec files for cross-language testing. Add TS and Go spec test runners for the new specs. Port evaluate-math (extended), evaluate-sets, and example-dotpath tests to Go. TS: 64 tests pass (50 original + 14 new spec runners) Go: 23 tests pass (17 original + 3 new spec + 3 evaluation tests) https://claude.ai/code/session_01GsBzDgTWG9EY3fu5bhbiXQ
Add support for implicit list and map structures inside parentheses,
matching the TS behavior. For example, (1,2,3) now produces
["(",[1,2,3]] and (a:1,b:2) produces ["(",{"a":1,"b":2}].
Key changes:
- Add elem rule close alts for ')' when inside paren (expr_paren > 0)
- Add expr.Close alts for comma/space inside parens that create implicit
lists via the implicitList action (walks rule stack to find paren)
- Add list/elem AC callbacks to propagate nodes to enclosing paren
(Go slice append may reallocate, making parent references stale)
- Add expr AC to propagate result to replaced val (r.Prev.Node)
- Walk parent chain in isFirstImplicitInParen to check for existing
list/elem between expr and paren
Go: 29 tests pass (7 new implicit list/map spec tests enabled)
TS: 64 tests pass (no changes)
https://claude.ai/code/session_01GsBzDgTWG9EY3fu5bhbiXQ
- Preval (pre-evaluation): value preceding paren becomes function name
e.g., foo(1,2) → ["(", "foo", [1,2]]
- Supports preval.active, preval.required, and preval.allow config
- Custom paren ops (add-paren): angle brackets <> as parens
- Multiple ternary ops (ternary-many): QQ/CC, %%/@@ alongside ?/:
- Fix FixedTokens reuse: operators sharing syntax with built-in tokens
(e.g., : as ternary close) no longer override jsonic's token types
- Block pair detection inside ternary when colon is ternary close
- Add val.Close ternary close alt for proper token propagation
New tests: TestSpecPrevalBasic, TestSpecPrevalOverload,
TestSpecPrevalImplicit, TestSpecAddParen, TestTernaryMany,
TestTernaryParenPreval (35 total, up from 29)
https://claude.ai/code/session_01GsBzDgTWG9EY3fu5bhbiXQ
- Add ternary implicit list close alts (comma/space/paren) so ternary-first expressions like 1?2:3 b produce implicit lists - Walk parent chain in implicitTernaryCond to avoid creating a new list when ternary is already inside an existing elem/list - Add BC step 2 handling to fill ternary's last slot on normal close - Guard paren.BC against overwriting implicit list nodes - Add val.Close ternary close alt and val.Open pair blocker for ternary operators that reuse FixedTokens (e.g. : as TinCL) - Comprehensive test coverage for all ternary+paren+preval combos https://claude.ai/code/session_01GsBzDgTWG9EY3fu5bhbiXQ
- TestTernaryBasicImplicitList: ternary-basic config (no preval) with all structural context cases from TS ternary.test.ts - Add ternary-first preval paren cases: foo(1?2:3 b), foo(1?2:3,b) - Add top-level ternary-first cases: 1?2:3 b, 1?2:3,b - Add paren ternary-first cases: (1?2:3), (1?2:3 b), (1?2:3,b) https://claude.ai/code/session_01GsBzDgTWG9EY3fu5bhbiXQ
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.
Update jsonic peer dependency to require >=2.20.1 (latest). Update GitHub
Actions to current versions (checkout@v4, setup-node@v4, coveralls@v2)
and Node.js matrix to 20.x, 22.x, 24.x.
https://claude.ai/code/session_01GsBzDgTWG9EY3fu5bhbiXQ