Skip to content

refactor: Embed grammar.json#318

Merged
zharinov merged 1 commit intomasterfrom
refactor/grammar-loading
Jan 9, 2026
Merged

refactor: Embed grammar.json#318
zharinov merged 1 commit intomasterfrom
refactor/grammar-loading

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 9, 2026

Summary

  • Replace proc-macro (plotnik-macros) with build.rs-based binary embedding
  • Add Grammar struct (plotnik-core/src/grammar/) for grammar.json parsing
  • Use IndexMap to preserve rule definition order (entry rule stays first)

Why

node-types.json is a lossy summary — it tells you what children are possible but loses sequence order. Loading grammar.json enables future grammar-based validation to detect impossible patterns like (function_declaration . (identifier)) (identifier can't be first child because "function" keyword comes before it).

@zharinov zharinov changed the title refactor: Replace proc-macro with build.rs-based grammar/node-types embedding refactor: Embed grammar.json Jan 9, 2026
@zharinov zharinov merged commit 760d491 into master Jan 9, 2026
3 checks passed
@zharinov zharinov deleted the refactor/grammar-loading branch January 9, 2026 14:06
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