fix(pascal): detect unqualified paren-less calls (DoWork;) - #1641
fix(pascal): detect unqualified paren-less calls (DoWork;)#1641equipados wants to merge 1 commit into
DoWork;)#1641Conversation
A statement that is nothing but an identifier is an unqualified call to a parameterless routine. Pascal allows dropping the parens on a no-arg call and Delphi codebases do so by convention, so `visitPascalBlock` was missing the majority of intra-unit calls: only `DoWork()` was recorded, never `DoWork;`. The qualified form (`Obj.Free;`) is already handled by `extractPascalParenlessCall`; this is the same idea one step less qualified. Gated on the identifier BEING the whole statement (`node.type === 'statement' && node.namedChildCount === 1`). Anywhere else — assignment RHS, condition, any expression — a bare identifier is indistinguishable from a variable read without type information, so those are left alone. Covered by a negative test.
|
Took this into a local integration build (current main + the open fixes I could merge cleanly) and ran the full suite with the native kernel: 245 files, 4323 passed, 0 failed. No regression on the codegraph repo's own index after a forced re-index. Looks good to me. |
|
Thanks for putting it through a full integration build — the forced
re-index on
codegraph's own repo is exactly the check I wanted to see, since the risk
here was
changing edges where the parser already behaved.
If it looks good to you, could you submit it as an approving review? The PR
still
shows REVIEW_REQUIRED, so it can't be merged on the comment alone.
Happy to rebase on current main if that helps.
Guillermo Álvarez Leal
*https://equipados.es* <https://equipados.es>
38611 Granadilla de Abona
Tlf:: 655 778 795
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario. En caso de su divulgación, copia o distribución a terceros
sin la previa autorización escrita de Equipados, usted podría estar
vulnerando la legislación vigente. En el caso de haber recibido este correo
electrónico por error, se ruega que nos notifique inmediatamente esta
circunstancia mediante reenvío a la dirección electrónica del remitente. De
conformidad con lo establecido en la LOPD Equipados garantiza la adopción
de las medidas necesarias para asegurar el tratamiento confidencial de los
datos de carácter personal. Así mismo le informamos de inclusión de
sus datos en un fichero con la finalidad de mantener su
relación contractual con Equipados. y de la posibilidad de ejercer los
derechos de acceso, rectificación, cancelación y oposición en la
siguiente dirección: Apartado de correos, nº 190, C.P 38611 – Granadilla
de Abona - Santa Cruz de Tenerife.
El vie, 4 sept 2026 a las 9:17, Daniil ***@***.***>)
escribió:
… *danusha2345* left a comment (colbymchenry/codegraph#1641)
<#1641 (comment)>
Took this into a local integration build (current main + the open fixes I
could merge cleanly) and ran the full suite with the native kernel: 245
files, 4323 passed, 0 failed. No regression on the codegraph repo's own
index after a forced re-index. Looks good to me.
—
Reply to this email directly, view it on GitHub
<#1641?email_source=notifications&email_token=ALJEAIYRD6GAXF4DYU5BHOD5NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5537712038>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALJEAI4GZHHZHX4APQBQDXL5NJ3ABAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMZXGA3TQMRVGU5US43TOVSTWNJSG43TANBSGA2DLILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ALJEAIYIO6J54GD35GCWRC35NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/ALJEAI5WSJIXZVOQCUWAS3D5NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
[ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage",
"potentialAction": { ***@***.***": "ViewAction", "target": "
#1641?email_source=notifications\u0026email_token=ALJEAI75TPFALJ6SVWUR7VL5NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KWZ3NMFUWYX3DNRUWG2Y#issuecomment-5537712038",
"url": "
#1641?email_source=notifications\u0026email_token=ALJEAI75TPFALJ6SVWUR7VL5NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KWZ3NMFUWYX3DNRUWG2Y#issuecomment-5537712038",
"name": "View Pull Request" }, "description": "View this Pull Request on
GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "
https://github.com" } } ]
|
danusha2345
left a comment
There was a problem hiding this comment.
Approving as a fellow contributor, with one caveat worth stating plainly: my review does not unblock the merge. I have no write access to this repository, so REVIEW_REQUIRED can only be cleared by @colbymchenry — this shows up as an approval in the list, nothing more. Treating it as a validation record rather than a gate.
What it rests on: the branch merged clean into a local integration build of current main plus the other open fixes, full suite with the native kernel 245 files / 4323 passed / 0 failed, and a forced re-index of codegraph's own repo with no edge regressions.
No rebase needed — GitHub still reports the PR MERGEABLE against today's main (unchanged since b9ca4b7, 31 Aug), and the branch is one commit ahead of the merge-base. Rebasing would only change the SHA.
What
A Pascal statement that is nothing but an identifier —
DoWork;— is anunqualified call to a parameterless routine.
visitPascalBlockdidn't treat itas one, so only the parenthesised form
DoWork()produced acallsedge.Pascal lets a no-arg routine drop its parens, and in Delphi that is the
convention rather than the exception, so on a real Delphi codebase most
intra-unit calls were invisible to
callers/callees/impact. Those toolsdidn't return a wrong answer — they returned an empty one, which is harder to
notice.
The qualified form (
Obj.Free;) is already handled byextractPascalParenlessCall(thanks — that landed in 1.5). This is the sameidea one step less qualified.
Measured on a real Delphi codebase
285
.pas/.dprfiles from a production Delphi 10.2 ERP (~1.1M LOC):callsedgesHow it's scoped
Gated on the identifier being the whole statement:
Anywhere else — assignment RHS,
ifcondition, any expression — a bareidentifier is indistinguishable from a variable read without type information,
so those are deliberately left alone. That is what the second test locks in:
isCalled('TFoo::Total')must stayfalse.Tests
Two added next to the existing paren-less test in
__tests__/resolution.test.ts:extracts UNQUALIFIED paren-less calls (Reset;, the dominant Delphi idiom)— fails without the change, passes with it.does not turn a bare identifier that is NOT a whole statement into a call— the negative case above.resolution.test.ts+extraction.test.ts: 788 passed. The 5 failures on mymachine (3× PHP include, 1× C/C++ include, 1× gitlink) are identical before and
after the change — pre-existing and unrelated, likely Windows-specific.
tsc --noEmitclean.Notes
Only
src/extraction/tree-sitter.tschanges; Pascal is not part of the Rustkernel so there is no parity fixture to update.