You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pascal/Delphi: two tree-sitter-pascal parse failures silently drop most of a real Delphi corpus (32% of bytes in ERROR nodes) — maskable like C# #3376 #5264
On a real Delphi codebase, extract_pascal's AST path silently loses most of the corpus — not to a graphify bug, but to two parse failures in tree-sitter-pascal 0.11.0 that have no error recovery: everything from the offending construct to EOF lands in one ERROR node, so every later declaration is dropped.
Both are maskable with the approach already established for the C# verbatim-interpolated-string failure (#3376): mask only the offending bytes at identical byte length, and discard the rewrite unless it parses better.
S := 'abc'''; // ok
S := 'a''b'; // ok
S := '''abc'; // ERROR
This is the Delphi idiom for building SQL by concatenation — Q.SQL.Add('select db_id('''+Name+''') as id') — so data-access units are typically lost from their first query onward.
An ordinary { comment } in the same position parses fine; an empty {$IFDEF X}{$ENDIF} pair still fails.
Measured impact
Delphi corpus, 336 .pas units / 58 MB:
units parsing clean
bytes inside ERROR nodes
0.9.111 as-is
222 (66%)
32%
with both masks
270 (80%)
2%
Graph built over the same scan (533 code files, extract --code-only):
as-is
with both masks
nodes
46 658
53 528
edges
66 487
81 875
calls edges
3 697
8 121
One 14 000-line data-module unit went from 9 routine nodes to 521.
Secondary: the failure is invisible
These units are currently reported as
warning: N code file(s) yielded no symbols — a data file, or source this extractor models no symbols for: ...
which reads as "nothing to see here". A unit that parsed into one big ERROR node is a different situation from a data file, and worth saying so — otherwise the only signal that two thirds of a corpus is missing is noticing that a known method has no node.
Patch
I have both masks working as _normalize_pascal_escaped_string_literals / _normalize_pascal_compiler_directives in graphify/extractors/pascal.py, applied only on the retry path after an unmasked parse has already failed, with node text still read from the untouched original source so labels and locations are byte-for-byte what the user wrote. Acceptance compares bytes-inside-ERROR rather than error count — a single ERROR wrapping the whole unit otherwise outranks a parse that recovered all but a few statements.
Activity
github-actions commentedon Nov 16, 2026
Thanks for opening this issue, @patrykseksymfonia. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.