Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Cleans up the native parser follow-up from #381 so the merged code reads as permanent code, not review scaffolding.
It replaces duplicated inline verifier logic with one
tests/tools/verify-native-parser-extension.phpentry point formysql-on-sqlite. The parser-extension workflow and PHPUnit bootstrap both call the same verifier:It also collapses
WP_PDO_MySQL_On_SQLite::create_parser()to one token selection and one parser reset/create return, and rewrites native parser test comments to describe behavior instead of PR review history.Rationale
#381 landed functional native parser support, but a few follow-up surfaces still carried review-era wording and copied verifier blocks. That makes future changes harder to read and easier to drift: native parser routing, Rust AST handle storage, wrapper identity, and materialized child behavior were being checked in multiple places.
The verifier now pins that runtime contract from one script: extension loaded,
WP_MySQL_Lexerresolves native,WP_MySQL_Parserdelegates toWP_MySQL_Native_Parser, the SQLite driver returns a native-backed AST, native wrapper handle properties are absent, child identity is stable, and materialized child mutations survive.Implementation
Added
wp_sqlite_verify_native_parser_extension()with a shared delegate check:WP_SQLITE_REQUIRE_NATIVE_PARSER_EXTENSION=1in the PHPUnit bootstrap now loads that verifier instead of inlining the same checks.create_parser()now selects tokens once:The WordPress PHPUnit extension setup keeps its container-specific verifier, but factors the repeated reflection checks into the same small helper shape.
Testing instructions
CI is passing on
3f4153f, including the PHP 8.0-8.5 Rust-extension matrix andWordPress PHPUnit Tests / Rust extension.