Repository navigation
Conversation
👷 Deploy request for thriving-cassata-78ae72 pending review.Visit the deploys page to approve it
|
shangyian
force-pushed
the
native-antlr-parser-prototype
branch
from
October 21, 2026 05:23
453d242 to
9ab2d8e
Compare
shangyian
force-pushed
the
native-antlr-parser-prototype
branch
from
November 14, 2026 08:36
9ab2d8e to
87fc087
Compare
shangyian
marked this pull request as ready for review
November 15, 2026 04:43
Contributor
[Medium impact] The latest change appears safe to merge and fixes the previous test finding. SummaryAdds an opt-in ANTLR C++ parser and rebuilds Python parse trees for the existing visitor.
Reviews (2) · Last reviewed commit: "Compare the native parser against the Py..." · Reviewed by Greptile |
shangyian
force-pushed
the
native-antlr-parser-prototype
branch
2 times, most recently
from
November 15, 2026 23:44
858051c to
6c14f39
Compare
Builds the C++ lexer and parser from the grammar, returns the parse tree as flat arrays, and rebuilds the Python context objects so the existing visitor runs unchanged. The DJ AST matches the Python parser's on every query in the test suite that parses, and parse plus visit is about 1.8x faster. Not wired into DJ; build and test instructions are in native_parser/README.md.
parse_sql_with_sll_fallback tries the C++ parser first and falls back to the Python parser if anything goes wrong, so errors stay the Python ones. Off by default. Adds a workflow that builds the extension and runs the server suite with it switched on.
The Python target appends an underscore to labels that are Python keywords. The bridge set `from`, so the visitor saw no `ctx.from_` for INTERVAL ... TO ... and the one server test that casts to an interval failed.
Annotate the token cache for mypy and apply the trailing-comma formatting.
So the two server runs can be compared on the same runners.
Tests inject a fake dj_native_parse that returns flat arrays built from a Python parse, so native.py and the antlr4.py hook run in the normal test shards.
python_ast now turns the native parser off, so the enabled CI job compares native output with Python output instead of with itself.
shangyian
force-pushed
the
native-antlr-parser-prototype
branch
from
November 16, 2026 01:48
6c14f39 to
863c946
Compare
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.
Summary
Builds the C++ lexer and parser from the grammar, returns the parse tree as flat arrays, and rebuilds the Python context objects so the existing visitor runs unchanged.
The parse plus visit is about 1.8x faster with this change.
Test Plan
make checkpassesmake testshows 100% unit test coverageDeployment Plan