Skip to content

Inline parser driver into ast package#13

Merged
kyleconroy merged 1 commit intomainfrom
claude/evaluate-parser-driver-T5vjb
Apr 27, 2026
Merged

Inline parser driver into ast package#13
kyleconroy merged 1 commit intomainfrom
claude/evaluate-parser-driver-T5vjb

Conversation

@kyleconroy
Copy link
Copy Markdown
Contributor

The parser_driver indirection (function-variable injection points and a
side-effect import of test_driver) only made sense when pingcap/parser
supported both TiDB's full types and a lightweight stub. Marino has a
single driver, so the indirection was pure ceremony: a runtime panic in
parser.New, a required blank import for users, and *test_driver.X type
assertions in callers.

Move the driver code into ast/, rename the concrete types that collided
with their interfaces (ValueExpr -> ValueExprBase, ParamMarkerExpr ->
ParamMarkerExprBase, BinaryLiteral []byte -> BinaryLit), turn ast.New*
function-vars into plain functions, and drop the driver-missing panic.

The parser_driver indirection (function-variable injection points and a
side-effect import of test_driver) only made sense when pingcap/parser
supported both TiDB's full types and a lightweight stub. Marino has a
single driver, so the indirection was pure ceremony: a runtime panic in
parser.New, a required blank import for users, and *test_driver.X type
assertions in callers.

Move the driver code into ast/, rename the concrete types that collided
with their interfaces (ValueExpr -> ValueExprBase, ParamMarkerExpr ->
ParamMarkerExprBase, BinaryLiteral []byte -> BinaryLit), turn ast.New*
function-vars into plain functions, and drop the driver-missing panic.
@kyleconroy kyleconroy merged commit 845ca69 into main Apr 27, 2026
1 check 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.

2 participants