Skip to content

Add Rust parser bridge helpers#389

Merged
adamziel merged 1 commit intotrunkfrom
codex/native-parser-class-routing
Apr 30, 2026
Merged

Add Rust parser bridge helpers#389
adamziel merged 1 commit intotrunkfrom
codex/native-parser-class-routing

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

Summary

When a native MySQL parser extension declares WP_MySQL_Native_Parser, load a small bridge file that exposes WP_Parser_Grammar internals to the extension. The native parser needs the grammar's terminal table, rules, and lookahead map, but those live on a PHP object — the bridge function hands them out as a plain array the extension can consume.

The bridge file lives under mysql/native/ since it's only required when a native parser is in use.

Testing

  • php -l on changed files
  • phpcs clean

When a native MySQL parser extension declares WP_MySQL_Native_Parser,
load a small bridge file that exposes WP_Parser_Grammar internals to the
extension. The native parser needs the grammar's terminal table, rules,
and lookahead map, but those live on a PHP object — the bridge function
hands them out as a plain array the extension can consume.
@adamziel adamziel merged commit 857fbec into trunk Apr 30, 2026
2 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.

1 participant