Skip to content

Update jsonic dependency to >=2.20.1 and modernize CI workflow#1

Merged
rjrodger merged 10 commits intomainfrom
claude/update-jsonic-dependency-ulWdj
Apr 5, 2026
Merged

Update jsonic dependency to >=2.20.1 and modernize CI workflow#1
rjrodger merged 10 commits intomainfrom
claude/update-jsonic-dependency-ulWdj

Conversation

@rjrodger
Copy link
Copy Markdown
Contributor

@rjrodger rjrodger commented Apr 4, 2026

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

claude added 10 commits April 4, 2026 20:07
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
@rjrodger rjrodger merged commit eea01a5 into main Apr 5, 2026
7 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