Skip to content

TreeSitter4D 0.2.0

Choose a tag to compare

@pmcgee69 pmcgee69 released this 02 Nov 09:38
· 4 commits to main since this release

tree-sitter-delphi13 goes from v1.3.0 to v1.4.0. tree-sitter stays at v0.25.10, and the API and the Delphi units are unchanged.

What the grammar brings

  • Directive words as names: record Platform, Config: string; end;, var Static: Integer;, const Virtual = 2;, P(Out: Integer), type Platform = Integer;. They show in the tree as plain identifiers.
  • Delphi 12's multi-line strings by dcc's rule. Two in a row are now two strings.
  • An ordinary string no longer spans lines, so an unterminated string is a local error.

One thing that gets worse

System.SysUtils.pas had parse errors before and still has. Read raw, it now has 10 more (502 to 512), because error recovery around SwitchChars, a constant split across {$IFDEF}s, also takes FindCmdLineSwitch and TCmdLineSwitchTypes with it.

Checked

From a folder holding only the repository's delphi\ sources and these zips' contents, dcc64 and dcc32 (Delphi 13) built the walker four ways, over source\rtl\common:

win64 objects   99 files, 1537727 nodes, 37 misgrouped <
win64 dlls      99 files, 1537727 nodes, 37 misgrouped <
win32 objects   99 files, 1537727 nodes, 37 misgrouped <
win32 dlls      99 files, 1537727 nodes, 37 misgrouped <

The same as 0.1.0: no file in that folder uses the new syntax in a way that changes the count.

Each zip carries the licences: tree-sitter v0.25.10 and tree-sitter-delphi13 v1.4.0, both MIT.