Conversation
- package.json: peerDep jsonic -> github:jsonicjs/jsonic#main - go/go.mod: jsonic/go -> v0.1.19-0.20260418194431-54100be22847 (main) TS 64/64 and Go 727/727 subtests pass. https://claude.ai/code/session_017W6amvYxE2ZmaTp3obEVS2
Jsonic appends this tag to every alt registered through jsonic.rule() during plugin setup, giving callers a single group to filter or exclude expr alts by. https://claude.ai/code/session_017W6amvYxE2ZmaTp3obEVS2
Replace the earlier no-op TS options.rule.alt.g with an actual tagging pass. jsonic only applies rule.alt.g when it comes from the setting arg to jsonic.grammar(); jsonic.options() stores the value but nothing reads it. Since the plugin uses jsonic.rule() (not grammar()), tag the alts manually: - TS: wrap jsonic.rule() in a local rule() helper that overrides rs.open/rs.close to append "expr" to each passed alt's g. - Go: wrap j.Rule() in modifyRule() that snapshots pre-existing alt pointers on rs.Open/rs.Close and tags only the newly-added ones. For plugin-created rules (expr, paren, ternary) assigned via RSM(), tagAllAlts tags every alt in the spec before install. Pre-existing alts on val/list/map/pair/elem are untouched. Verification (Go): expr Open 3/3 Close 11/11 paren Open 2/2 Close 1/1 val Open 2/11 Close 4/10 list Open 0/5 Close 1/3 map Open 0/4 Close 1/5 pair Open 0/2 Close 1/11 elem Open 0/4 Close 2/8 TS 64/64 and Go 727/727 tests pass. https://claude.ai/code/session_017W6amvYxE2ZmaTp3obEVS2
Versions: - TS peerDep jsonic: github main -> ^2.25.1 (npm latest) - Go jsonic/go: v0.1.19 (released, no longer a pseudo-version) Go port: jsonic/go v0.1.19 changed two signatures. - RuleDefiner now takes (rs *RuleSpec, p *Parser); update the modifyRule wrapper to match. - Token.ResolveVal now takes (rule, ctx); pass them through. Makefile modeled on jsonicjs/ini: build/test/clean targets split by language, plus tidy-go, tags-go, publish-go, and a full reset. Added a Version const to go/expr.go so the publish-go sed target mirrors ini's. Docs restructured per diataxis.fr: - README.md is now a landing page with install + pointers. - docs/tutorial.md: first-expression walkthrough (TS and Go). - docs/how-to.md: seven task-oriented recipes (custom ops, preval, ternary, disable-default, group filter). - docs/reference.md: exports table per language, OpDef/ExprOptions/ Evaluate types, default op table, AST shape, group tags. - docs/explanation.md: Pratt parsing overview, why S-expressions, paren/preval semantics, ternary as two-token op, how the plugin plugs into Jsonic, the g=expr tagging convention. TS 64/64 and Go 727/727 tests pass via `make test`. https://claude.ai/code/session_017W6amvYxE2ZmaTp3obEVS2
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba3b86880c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Publish Go module: make publish-go V=0.1.7 | ||
| publish-go: test-go | ||
| @test -n "$(V)" || (echo "Usage: make publish-go V=x.y.z" && exit 1) | ||
| sed -i '' 's/^const Version = ".*"/const Version = "$(V)"/' go/expr.go |
There was a problem hiding this comment.
Use GNU-compatible in-place sed syntax
The publish-go target currently uses sed -i '' ..., which is BSD/macOS syntax and fails on GNU sed (common in Linux CI and many developer environments), so make publish-go V=... aborts before the commit/tag steps run. GNU sed documents in-place editing as -i[SUFFIX] (sed --help), and running this exact command on GNU sed treats the replacement expression as a filename and exits with code 2.
Useful? React with 👍 / 👎.
No description provided.