Skip to content

feat: add query compilation to bytecode#192

Merged
zharinov merged 1 commit intomasterfrom
feat/query-compile
Dec 31, 2025
Merged

feat: add query compilation to bytecode#192
zharinov merged 1 commit intomasterfrom
feat/query-compile

Conversation

@zharinov
Copy link
Copy Markdown
Member

Summary

  • Add Thompson NFA-style query compilation (compile.rs)
  • Rename emit.rscodegen.rs and enhance with linked/unlinked paths
  • Add StringTableBuilder for bytecode string interning
  • Add dump tests for bytecode output verification
  • Update Query API with emit() returning bytecode

Key components:

  • Compiler - Thompson construction from query AST to IR
  • codegen::emit() - Unlinked bytecode (StringId references)
  • codegen::emit_linked() - Linked bytecode (NodeTypeId/NodeFieldId)
  • Query::emit() / LinkedQuery::emit() - Public API

Depends on: #186-#191 (all previous extraction PRs)

Test plan

  • cargo test -p plotnik-lib compile passes (6 tests)
  • cargo test -p plotnik-lib codegen passes (15 tests)
  • cargo test -p plotnik-lib dump passes (6 tests)

@zharinov zharinov enabled auto-merge (squash) December 31, 2025 12:25
@zharinov zharinov merged commit 8182ae2 into master Dec 31, 2025
4 checks passed
@zharinov zharinov deleted the feat/query-compile branch December 31, 2025 12:29
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