Skip to content

Releases

TreeSitter4D 0.2.0

Choose a tag to compare

@pmcgee69 pmcgee69 released this 02 Nov 09:38

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.

TreeSitter4D 0.1.0

Choose a tag to compare

@pmcgee69 pmcgee69 released this 01 Nov 14:33

The first release: tree-sitter's C compiled, so Delphi alone can build with TreeSitter4D, no C++Builder needed. Win64 and Win32.

What's in it

  • TreeSitter4D-0.1.0-objects.zip: the objects TreeSitter.Api.pas links with {$L}. Unzip into the repository's root: Win64 lands in obj\ (COFF, bcc64x 7.80), Win32 in obj\win32\ (OMF, bcc32c 7.80). Then dcc64 or dcc32 builds as the README says. Nothing to ship with your program.
  • TreeSitter4D-0.1.0-dlls.zip: tree-sitter.dll and tree-sitter-delphi13.dll for Win64 and Win32. Put the pair beside your executable and define TS_DLL; other bindings that load tree-sitter.dll and a grammar DLL can use them too. The Win64 DLLs need only the Universal C Runtime (Windows 10 and later), the Win32 ones only KERNEL32 and USER32.
  • SHA256SUMS.txt.

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

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, and each reported the same over the RTL's 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 <

New in the source

  • Win32: build-c.cmd win32 [dll], and TreeSitter.Api.pas links the Win32 objects.
  • The DLL path: TS_DLL in TreeSitter.Api.pas.