From bdca25c99ee71807d4c7d8c9544732122a9a0085 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 25 Jun 2026 16:05:44 +0100 Subject: [PATCH] feat(semantic): IsUnmangledUnit recognises the runtime. prefix --- compiler/src/main/pascal/uSymbolTable.pas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/src/main/pascal/uSymbolTable.pas b/compiler/src/main/pascal/uSymbolTable.pas index e70caa5..f335d8c 100644 --- a/compiler/src/main/pascal/uSymbolTable.pas +++ b/compiler/src/main/pascal/uSymbolTable.pas @@ -2012,11 +2012,18 @@ end; function IsUnmangledUnit(const AUnitName: string): Boolean; begin + { RTL units export their runtime symbols (_SetArgs, _BlaiseGetMem, _start, …) + UNMANGLED — the compiler emits bare calls to them — so their unit prefix is + empty. The RTL units are: System, the rtl.* platform units, and the + runtime.* units (dotted-flat names after the RTL-unification move; the + legacy blaise_* names are still accepted for any not-yet-renamed source). } Result := True; if AUnitName = '' then Exit; if SameText(AUnitName, 'System') then Exit; if (Length(AUnitName) >= 4) and SameText(Copy(AUnitName, 0, 4), 'rtl.') then Exit; + if (Length(AUnitName) >= 8) + and SameText(Copy(AUnitName, 0, 8), 'runtime.') then Exit; if (Length(AUnitName) >= 7) and SameText(Copy(AUnitName, 0, 7), 'blaise_') then Exit; Result := False;