feat(engine): add parse error limit flag and tree-sitter error unwrapping - #76
Merged
Merged
Conversation
HarshK97
marked this pull request as ready for review
August 10, 2026 08:12
HarshK97
force-pushed
the
fix/parse-error-fallback
branch
from
August 10, 2026 10:32
f5bdeba to
bae55dc
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.
Problem
ERRORandMISSINGnodes to mess up structural AST matching.What Changed
-e, --parse-error-limit(defaulting to 0) todiffm diff, matching how Difftastic caps parse errors before falling back to line diffing.ParseErrorCounttoASTNodeand a recursivecountErrorNodeshelper to trackERRORandMISSINGnodes across the AST.cmd/pipeline.goso line diff fallback only triggers whenParseErrorCountgoes over the limit.unwrapErrorNodeininternal/treesitter/ast.goto pull valid syntax nodes out ofERRORwrappers, so structural AST matching keeps running on valid parts of the file when under the limit.internal/treesitter/ast.goto simplify node aliasing, byte offset bounds clamping, and error node unwrapping loops.cmd/diff_test.goand updated golden diff baselines for test fixtures with syntax errors.