Three compiler additions, exercised end-to-end by testpunit2.pas:
* Default parameter values — single-name, non-var, non-open-array params
may carry '= literal-or-named-constant'. Overload resolution accepts
any arity in [MinArity, ParamCount]; the resolver tie-breaks toward
the candidate that needs fewer defaulted slots. AnalyseProcCall and
AnalyseFuncCallExpr clone the default expression into the call's Args
list. Defaults declared on a unit-interface forward decl are
ownership-transferred to the matching impl param at reconciliation.
* Metaclass references — a bare class type identifier in a value
position (e.g. 'EError' as an argument or in 'Pointer(EError)') is
now retyped to Pointer with codegen emitting '$typeinfo_<Name>' as
an immediate. Matches the value held by vtable[0], so 'A.ClassType =
EError' is true exactly when A is an instance of that exact class.
* Numeric widening at call sites — the existing CoerceArg helper now
covers Integer→Double (swtof/sltof), Single→Double (exts) and
Integer→Single, in addition to the pre-existing w→l. Inherited-,
constructor-, method-, and function-call sites all route through it.
punit.pas gains DefaultDoubleDelta, two Double AssertEquals overloads,
and '= ''' defaults on the four-arity AddTest declarations.
Docs: grammar.ebnf extends ParamGroup with the optional default; a new
DefaultValue rule lists the permitted forms. language-rationale.adoc
adds 'Default Parameter Values' and 'Metaclass References' sections
recording the decision, alternatives rejected, and the overload
tie-break formula.
All 1194 existing compiler tests pass; testpunit2 compiles, assembles,
links and runs (31 tests; the expected pass/fail/inactive pattern).
Indirect calls through a procedural-typed variable (the 'IsIndirectCall'
path added when 'RunTest(@DoTest)' first compiled) only validated arg
count. The argument types were never checked against the procedural
signature, so e.g. 'H("oops")' against 'procedure(N: Integer)' compiled
silently and miscompiled at the QBE level.
Both call sites — TProcCall (statement form) and TFuncCallExpr
(expression form) — now run each actual through CheckTypesMatch against
the corresponding TProcParamInfo, and reject non-L-value actuals for
var-typed parameters with the same diagnostic as the regular-call path.
Two semantic tests in cp.test.proctypes.pas pin the behaviour: one for
the statement form, one for the expression form.
Docs
- language-rationale.adoc: update the overload-mangling example so the
emitted symbol matches what codegen actually produces ($Log_D_Si, not
$Log$Si), and document the QBEMangle escape table for the three
sigil characters that the QBE symbol grammar disallows mid-identifier.
- design.adoc: clarify the var-parameter ABI entry — record and static
array value parameters share the by-pointer convention with var-params,
which is what makes IsVarParam the right flag for codegen to key off.
Three classes of bugs surfaced while getting punit's testpunit1 to run.
Record params passed by reference (ABI fix)
The QBE ABI passes record/static-array parameters as pointers regardless
of var/const/value semantics, so the local _var_X slot holds a pointer,
not the aggregate bytes. Codegen was only dereferencing for var-params,
producing silently-wrong code for value-record params: F.A := 42 wrote
into the local 8-byte slot, ZeroMem(@ARun, SizeOf(...)) corrupted the
stack via 100+-byte memset, and indirect calls passed &slot rather than
*slot.
Semantic now sets IsVarParam on TIdentExpr, TFieldAccessExpr, and
TFieldAssignment for both skVarParameter and skParameter-of-aggregate.
Codegen dereferences the slot in EmitFieldAssignment, EmitInstancePtr,
EmitLValueAddr, EmitAddrOfExpr, and the TIdentExpr aggregate path.
Virtual dispatch on Obj.Method (no parens)
The TFieldAccessExpr IsMethodCall path emitted a static call ignoring
MDecl.VTableSlot. With user-overridden ToString and static type TFoo /
runtime type TBar, B.ToString resolved statically to TFoo's body. Now
checks VTableSlot >= 0 and emits vtable[(slot+1)*8] dispatch. Affects
every zero-arg virtual method called via Obj.Method, not just ToString.
Mangling consistency
EmitMethodDef and the two vtable emission sites bypassed QBEMangle, so
method definitions wrote \$TFoo_Show\$i while call sites wrote
\$TFoo_Show_D_i — a latent link error. All three sites now route through
QBEMangle (preserving the leading \$ sigil); cp.test.overload.pas
expectations updated to the consistent _D_ separator.
Three e2e tests in cp.test.e2e.pas pin the ToString behaviour: default
returns class name, override is reached through static base type,
inherited override still resolves at runtime. 1192 tests pass.
Other items folded in (prior WIP, surfaced together):
- Parser propagates Line/Col onto TBinaryExpr for diagnostics
- Pass 3 forward pointer alias resolution (PFoo = ^TFoo before TFoo)
- TProceduralTypeDesc structural pointer equivalence
- Indirect call statements through procedural variables
- Init/finalization stmt analysis
- Int64 boAnd/boOr operand extension
- TObject vtable slot 1 = ToString; RTL TObject_ToString helper
- EmitGlobalVarData for unit interface block
- punit workarounds (Copy for indexed string, lifted nested proc)
Adds three builtins requested by punit's port and the language-feature
gaps surfaced while wiring them through:
Delete(var S: string; Idx, Count: Integer)
RTL helper _StringDelete returns a new string with the slice removed
(1-based Idx; out-of-range / non-positive Count yields a copy).
Codegen emits the standard string-mutator ARC sequence: load old →
call helper → addref new → release old → store new through the var
slot. Factored out as TCodeGenQBE.EmitStringMutator for reuse.
SetLength(var S: string; N: Integer)
RTL helper _StringSetLength returns a new string of length N (truncate
or NUL-pad). Same codegen path as Delete via EmitStringMutator.
obj.ClassType : Pointer
TClass registered as a built-in alias of Pointer (placeholder until
a real tyMetaClass arrives). AnalyseFieldAccess detects ClassType
on tyClass receivers and sets TFieldAccessExpr.IsClassTypeAccess.
Codegen emits two indirections — instance → vtable → typeinfo —
yielding the typeinfo data pointer. Equality comparison of two
ClassType results correctly distinguishes dynamic types.
Assigned(P) : Boolean
Added as a sibling of the above because it's the natural companion
for the metaclass / pointer code in punit (and otherwise a missing
standard Pascal builtin). Emits a 'cnel %ptr, 0' comparison.
Incidentals (bug fixes uncovered while testing):
- AnalyseFieldAssignment now routes set-literal RHS into a tySet
field through AnalyseSetLiteralExpr, so 'R.Options := []' and
'P^.Options := []' are accepted. Previously the empty literal
was rejected as an array literal with zero elements.
- Var-argument validation: adds TDerefExpr to the accepted L-value
forms (P^ as a var argument) alongside TIdentExpr and
TFieldAccessExpr. TCodeGenQBE.EmitLValueAddr generalises
EmitVarArgAddr to cover all three forms; var-arg call sites in
EmitProcCall, EmitFuncCall paths, and EmitInheritedCall now go
through it.
- CheckTypesMatch: nil literal now compatible with tyProcedural
parameter slots (already done in Phase D for procedural-handler
nil-clear idioms; unchanged here, included for completeness in
the var-arg/builtin context).
Tests: 1189 → 1192 pass, 0 errors, 0 failures.
- cp.test.stringops: Delete/SetLength semantic OK + non-string
rejection + codegen calls _StringDelete / _StringSetLength.
- cp.test.typetests: ClassType semantic OK, resolves to tyPointer,
TClass alias usable, codegen emits loadl chain.
Re-restoring 'overload' directives across punit.pas (the Phase A
blocker called out by the handover) surfaced a series of unit-section
gaps that were silently broken because no test exercised them. Each
fix is small and bounded; together they let punit progress past the
overload duplicate-identifier wall and ten subsequent declarations,
into the next genuine missing-feature blocker (Delete-as-builtin).
Compiler changes:
- ParseForwardDecl (uParser.pas): now accepts the same directive set
as ParseMethodDecl — overload, external, inline, stdcall, cdecl,
register, pascal, safecall, forward, deprecated, platform,
experimental. Previously only 'external' was recognised, so any
unit interface forward decl carrying 'overload' raised
"Expected token tkImplementation".
- AnalyseUnit / AnalyseUnitForExport (uSemantic.pas): symbol
registration for both forward and impl-only standalone proc/func
decls now propagates IsOverload, sets ResolvedQbeName, and uses
signature-aware matching to pair an impl with its forward decl
when both are overloaded.
- AnalyseUnit: now also processes interface-section variable decls
(registering them as IsGlobal symbols visible to impl bodies),
interface-section const decls, impl-section const + type decls,
and impl-section global var decls. AnalyseUnitForExport got the
matching impl-section type-decl + interface-section var-decl
passes. Without these, any unit whose impl bodies referenced an
impl-section enum or an interface-section global silently raised
"Unknown type" / "Undeclared variable".
- AnalyseStandaloneDecl: skip body analysis when ADecl.Body = nil.
Prevents an AV when a forward-only decl reaches the body pass
(e.g. a forward overload whose impl lives in another section).
- TFieldAssignment: accept skVarParameter (in addition to skVariable
and skParameter) as a valid receiver kind so 'Suites.Count := 0'
is permitted inside 'procedure InitSuiteList(var Suites: TSuiteList)'.
- Var-argument check: an L-value var argument may now be a
TFieldAccessExpr (R.F or P^.F) in addition to a plain TIdentExpr.
The existing field-access typing already produces ResolvedType so
the subsequent CheckTypesMatch handles it correctly.
- CheckTypesMatch: nil literal now compatible with tyProcedural
parameter slots (procedural-type fields are routinely nil-cleared
via SetXxxHandler(nil) idioms).
punit changes:
- Re-applied 'overload;' to every interface and implementation
declaration of the 17 names that participate in overload sets
(AddSuite, AddTest, AssertEquals, AssertPassed, DoRunSysTests,
ExpectMessage, FreeSuiteList, GetSuite, GetSuiteCount,
GetSuiteIndex, GetTest, GetTestCount, GetTestIndex, RunSuite,
RunTest, SetTestResult, SetTestResultRec).
Tests: 1179 pass, 0 errors, 0 failures. New regression coverage:
- cp.test.varparams: var-arg accepts R.F and P^.F field accesses.
- cp.test.units: interface var visible in impl, impl-section type
decl in scope, forward decl with 'overload' parses + analyses.
Punit still does not compile end-to-end: the next blocker is the
Delete(S, Idx, Count) string built-in (line 844), unrelated to
overloading. That is a separate language-feature task.
Class method overloading and overloaded virtual/override dispatch.
Forward / impl matching now keys on (TypeName, Name, ParamSig) instead
of just (TypeName, Name): LinkClassMethodImpls walks all FMethodIndex
entries with the matching key and pairs each impl with the forward
decl whose signature equals the impl's. Method registration enforces
the 'overload' directive — same-class same-name pairs without it now
produce a clean "Duplicate method" error rather than the misleading
"already has an inline body".
Each (Name, ParamSig) pair becomes its own vtable slot, so two virtual
overloads dispatch independently and overrides target the slot whose
mangled signature matches. Required moving parameter-type resolution
ahead of the vtable pre-pass — Pass 1 of AnalyseTypeDecls already
registers every type name, so referencing other types in method
parameters before the host class's own fields are resolved is safe.
ResolveMethodOverload mirrors ResolveStandaloneOverload: walks the
inheritance chain, filters by arity, scores by argument type using
the existing ArgMatchScore, picks the best match, raises on ambiguity.
Three call sites in AnalyseMethodCall (receiver-expression,
implicit-self, variable receiver) and AnalyseMethodCallExpr now go
through it; the redundant CheckTypesMatch loops afterwards are gone
since the resolver already enforced compatibility.
Codegen: a small MethodEmitName helper centralises 'use ResolvedQbeName
when set, otherwise <Owner>_<Name>'. Eight method-call emit sites
(static dispatch, virtual dispatch, sret returns, field-method calls,
inherited calls) now go through it.
Tests: 5 new cases in cp.test.overload.pas — class overload registration,
distinct mangled QBE names, mangled call sites, dup-without-overload
rejection, and (virtual + overload + override) producing distinct
vtable slots. All 1174 tests pass.
End-to-end verified: 'B := TChild.Create; B.Greet(99); B.Greet(''hi'')'
where B's static type is TBase dispatches both overloads through the
overloaded vtable to TChild's overrides.
AnalyseUnit (the test-only entry point that analyses a unit in
isolation, distinct from the production AnalyseUnitForExport +
Analyse(Prog) two-phase pipeline) used to leave the symbol table
behind on the analyser. When the caller freed the analyser, the
TTypeDesc instances pointed at by Par.ResolvedType /
ResolvedReturnType went with it — leaving every AST node holding a
dangling pointer. A subsequent QbeTypeOf(AType) inside GenerateUnit
then dereferenced that garbage and segfaulted.
Five TUnitTests (TestCodegen_Unit_NoMainFunction,
TestCodegen_Unit_IntfFunctionsExported,
TestCodegen_Unit_FunctionBodyInIR,
TestCodegen_Unit_ImplOnlyFuncNotExported,
TestCodegen_Unit_CorrectArithmetic) all crashed at this point.
Fix: add TUnit.SymbolTable, transfer ownership at the end of
AnalyseUnit (mirroring TProgram), and free it in TUnit.Destroy. The
production multi-file pipeline never touches AnalyseUnit and is
unaffected (the program owns the shared table).
All 1169 tests now pass — zero errors, zero failures.
EmitFuncDef and EmitMethodDef both fell through to a 'storel' catch-all
when spilling parameters into local slots, so QBE rejected any function
with a Double or Single parameter ('invalid type for first operand
%_par_X in storel'). Each float kind needs its own QBE store width:
'd' parameters use 'stored' over an alloc8, 's' parameters use 'stores'
over an alloc4.
This was masked previously because no test exercised a float parameter
in a callable position end-to-end — the bug surfaced when wiring up an
overload demo with three F(...) variants over Integer/Double/string.
Adds two regression tests in cp.test.procs.pas asserting that the spill
emits the type-correct store opcode.
Replaces Phase A's arity-only resolution with full Delphi-style
overload resolution: exact-type match (score 2) is preferred over
widening (score 1); ambiguous ties at the top score raise a compile-
time error. QBE mangling switches from the temporary '$N<arity>'
suffix to a type-code suffix:
i Integer l Int64 u UInt32 y Byte
b Boolean d Double s Single S string
C PChar p untyped Pointer E<Name> enum
R<Name> record K<Name> class I<Name> interface
^X pointer-to-X A<X> open-array of X
T<Name> set F<Name> procedural type @X var/out X
So 'procedure F(N: Integer)' emits as $F$i and 'procedure F(D: Double)'
as $F$d. The fall-through branch in ArgMatchScore probes the existing
CheckTypesMatch, picking up nil-literal compatibility, class-subtype
widening, untyped-Pointer interop, enum/integer crossover, procedural
signature compat, and open-array forwarding without duplicating that
logic.
- AnalyseProcCall and AnalyseFuncCallExpr now analyse all arguments
before resolving, so the resolver has Arg.ResolvedType available
for scoring.
- Non-var argument compatibility is now established by the resolver;
the redundant CheckTypesMatch loop afterwards is removed.
- Tests: 5 new cases — type-distinct registration, distinct mangled
QBE names, exact-beats-widening, widening fallback, ambiguous error.
- Phase A tests updated for the new mangling ('$' for zero-arg, '$i'
for Integer).
Adds the 'overload' directive and Delphi-style overload semantics for
standalone procedures and functions. Phase A resolves overload sets by
parameter arity only; the QBE mangling uses a temporary '$N<arity>'
suffix that will be replaced by full type-code mangling in Phase B.
- TMethodDecl gains IsOverload and ResolvedQbeName.
- TSymbol gains IsOverload, NextOverload (chain), and Decl back-pointer.
- TScope.Define appends to the overload chain when both old and new
symbols carry IsOverload; mixing overload + plain duplicates is a
duplicate-identifier error.
- ResolveStandaloneOverload picks the matching arity from FProcIndex
and is wired into AnalyseProcCall and AnalyseFuncCallExpr.
- Codegen emits via TMethodDecl.ResolvedQbeName at all four standalone-
call sites and at EmitFuncDef.
- Grammar: 'overload' added to MethodDirective.
- Rationale: documents Delphi semantics, type-code mangling, alternatives
rejected.
- Tests: cp.test.overload.pas, 7 cases covering parser flag, chain
acceptance, mixing rejection, no-matching-arity error, and codegen.
Additional language features and fixes built on the previous commit:
P^.Field — pointer dereference followed by field access in both
expression and assignment positions. Parser builds TDerefExpr as the
Base of TFieldAccessExpr; codegen returns the record address directly
(no double-load for tyRecord base types).
initialization / finalization sections in units — lexer adds
tkInitialization / tkFinalization tokens; unit parser collects
statements into TUnit.InitStmts / FinalStmts; codegen emits
export functions $<Unit>_init() / $<Unit>_fini(); EmitMainHeader
calls each $<Unit>_init() in import order.
TClass as Pointer alias — punit and testpunit adapted; TClass replaced
with Pointer where RTTI is not yet available.
punit.pas adapted further:
* PTest / PSuite / PResultRecord etc. restored as type aliases
* BlockGet/BlockSet use PPointer typed local variables
* ^TFoo(expr) casts replaced with PFoo(expr) using new type aliases
* local type/const sections with typed array constants replaced with
plain integer stage constants + case functions
* Exit(expr) replaced with Result := expr; Exit
* local typed const array (BStrs) replaced with if/else
* RunSuiteSetup/TearDown/RunTestHandler extract function pointers
to local vars before calling (workaround for ^.FnField() calls)
* EFail.ToString changed from override to virtual
Tests: 1155 pass, 5 pre-existing errors, 0 new failures.
Six missing language features added:
1. type PFoo = ^TFoo — pointer and simple type aliases in type sections.
Parser dispatches tkCaret/tkIdent to new TTypeAliasDef AST node;
semantic pass resolves to TPointerTypeDesc or the aliased type.
2. Double / Single float types — lexer emits tkFloatLit; TFloatLiteral
AST node; tyDouble/tySingle in the type system; QBE 'd'/'s' emit;
arithmetic, comparison, and integer promotion in codegen;
DoubleToStr, SingleToStr, StrToDouble, Abs(Double) built-ins;
_DoubleToStr/_SingleToStr/_StrToDouble/_AbsInt/_AbsInt64 in RTL
(new blaise_float.c). QBE generates SSE2 instructions automatically.
Float const declarations supported.
3. Abs() — built-in for Integer, Int64, Double, Single.
4. TObject.ClassName — typeinfo gains a third slot (offset 16) holding
a pointer to an immortal class-name string ($__cn_TFoo + 12).
obj.ClassName loads vtable[0] (typeinfo), then typeinfo[16] (nameptr).
EmitClassNameRef() emits the data-section label+offset relocation.
5. Global record field bug fix — FieldPtr() now accepts AIsGlobal and
uses VarRef() so $RecordVar is used for global records instead of
%_var_RecordVar. Both assignment and read paths fixed.
6. future-improvements.adoc — implemented items marked; Currency and
BigDecimal deferred to BCL packages section added.
Tests: 1155 pass, 5 pre-existing errors (TUnitTests AV), 0 new failures.
Adds support for declaring named procedural types that hold pointers to
standalone functions and procedures:
type
TIntFn = function: Integer;
TStrFn = function(const S: string): Integer;
TLogProc = procedure(Level: Integer; const Msg: string);
var F: TIntFn;
begin F := @MyFn; X := F(); end;
A procedural variable is stored as a single QBE 'l' (8-byte code
pointer). @FuncName produces a value of the matching procedural type.
Indirect calls F(args) load the pointer and emit a QBE indirect call.
Compatibility requires return types to match (both nil or both same
TTypeDesc) and parameter lists to match pairwise on type and parameter
mode (var/const/value); names do not participate.
Compiler additions:
* tyProcedural TTypeKind + TProcParamInfo + TProceduralTypeDesc
(with IsCompatibleWith)
* TProceduralTypeDef AST node
* Parser: type T = function/procedure ... ; reuses ParseParamList
* Semantic: ResolveProceduralTypeDef in pass 2; AnalyseAddrOfExpr
short-circuits @FuncName to a procedural-typed value;
AnalyseFuncCallExpr accepts procedural-typed variables as
indirect-call targets; CheckTypesMatch allows compatible
procedural assignment
* Codegen: QbeTypeOf(tyProcedural) -> 'l'; EmitVarAllocs emits an
8-byte slot; EmitAddrOfExpr emits $FuncName for @FuncName;
EmitFuncCallExpr emits 'call %tmp(...)' for indirect calls,
placed before the ResolvedDecl=nil type-cast branch
Out of scope (deferred until a use case requires them):
* function ... of object (method pointers — fat pointer ABI)
* reference to function/procedure (anonymous methods / closures)
* cdecl/stdcall calling-convention markers on procedural types
Tests: cp.test.proctypes.pas — 14 tests covering parser (kinds,
return types, params, var/const flags), semantic (compat accept/
reject on return type and arg count), and codegen (var allocation,
@FuncName emission, indirect-call emission).
Grammar and rationale: docs/grammar.ebnf adds the ProceduralType
production; docs/language-rationale.adoc captures the decision and
deferred items.
Motivation: prerequisite for porting Michael Van Canneyt's punit test
framework into rtl/src/test/pascal/, where every test, every
Setup/TearDown, and every hook handler is stored as a function
pointer.
1155 tests pass (1141 pre-existing + 14 new), no regressions.
Adopts the Swift/LLVM model: Apache License 2.0 with the Runtime Library
Exception text used verbatim by the Swift project. SPDX identifier:
Apache-2.0 WITH Swift-exception.
Apache 2.0 brings an explicit patent grant and patent-retaliation clause
that BSD-3 lacks. The Runtime Library Exception ensures binaries
produced by the Blaise compiler do not inherit attribution obligations
from the linked-in RTL.
* LICENSE — full Apache 2.0 + RLE text (replaces the deleted LICENCE).
* NOTICE — project header plus QBE attribution (MIT, vendored).
* docs/language-rationale.adoc — new Project Governance section
capturing the decision, alternatives considered, and rationale.
* SPDX headers updated across all .pas, .pp, .inc, .c source files,
build scripts, PasBuild plugins, and the Makefile.
* project.xml license field updated.
* tools/migrate_full.py HEADER template updated so generated
self-hosting source carries the new licence.
Three fixes to unblock for..in over generic collection types:
1. SubstTypeParam: extend to substitute type params inside generic
instantiation names. Previously only bare 'T' and '^T' were
handled; 'SomeName<T>' was left unsubstituted, so a method
returning 'TListEnumerator<T>' kept the raw param name after
cloning.
2. InstantiateGeneric: clone TClassTypeDef.Properties with type-param
substitution (same pattern as fields and methods). Without this
the 'Current: T' property was invisible on instantiated enumerator
types and FindProperty returned nil during for..in semantic checks.
3. AnalyseFieldAccess + ResolveScopeBoundTypeParams: when a generic
RecordName such as 'TGenEnum<T>' isn't found in the symbol table,
resolve each type argument against the current scope (where
T=Integer is pushed during method body analysis) and retry the
lookup with the concrete name 'TGenEnum<Integer>'.
New: cp.test.genericforin.pas — 10 tests covering property visibility,
property type after instantiation, and end-to-end for..in IR emission.
1141 tests total, all passing.
Implements `on E: TClass do` dispatch inside except blocks and correct
bare `raise` propagation inside typed handlers.
New AST node TExceptHandlerClause carries VarName, TypeName, and Body.
TTryExceptStmt gains a Handlers list and ElseBody for the typed case;
ExceptBody remains for the legacy catch-all form.
Parser detects the 'on' identifier after 'except' to switch between the
typed-handler path and the plain catch-all path. The no-binding form
`on TFoo do` is also supported.
Semantic pass validates that handler types resolve to classes, injects
a synthetic TVarDecl into the enclosing block for each bound variable
(so EmitVarAllocs allocates a stack slot at function entry), and opens a
local scope so the variable is accessible inside the handler body.
Codegen emits a _CurrentException call (before _PopExcFrame) followed by
an _IsInstance check per handler. The first matching handler stores the
exception pointer into the variable slot and runs the body. If no handler
matches and there is no else clause, _Reraise propagates to the enclosing
handler.
RTL: _CurrentException now reads g_current_exception (set by _Raise at
raise time) rather than g_exc_top->exception. This is correct because
_PopExcFrame has already unwound the handler's own frame by the time a
bare raise is executed inside the handler body.
EmitRaiseStmt bare-raise path now calls _CurrentException then _Reraise
instead of _Raise(0), which previously cleared g_current_exception.
22 new tests (17 unit + 5 E2E): parser, semantic, codegen, and runtime
dispatch (correct handler selection, subclass matching, unmatched reraise,
bare raise propagation, else clause execution). Total: 1131 tests, 0 failures.
Self-hosting fixpoint achieved on the multi-file source after the
Int64-correctness and implicit-Self chained-access bugs were fixed.
releases/v0.4.0/blaise (Blaise-compiled) recompiles Blaise.pas and
produces byte-identical IR (88,883 lines) to the FPC-built stage-1.
The self-built compiler segfaulted in MemCopy/_StringCopy when given any
multi-unit input, and even when it ran it produced IR that diverged from
the FPC-built compiler's output. Three independent bugs all rooted in
Int32-vs-Int64 confusion:
1. _StringCopy(S, From, MaxInt) — the Copy(S, N, MaxInt) "rest of string"
idiom — performed `(Start + Count) > SLen` to clamp Count, which
silently overflowed for Count = MaxInt. The check now compares
`Count > SLen - Start` instead, which is overflow-safe.
2. _StrToInt / _StrToInt64 only accepted decimal digits, silently
returning 0 for the FPC-compatible '$xx' hex form. The compiler uses
hex for FNV constants ($811C9DC5 etc.), so the self-built binary
produced 0 where it should produce a real FNV offset. Both routines
now accept '$' followed by [0-9A-Fa-f]+.
3. Comparing an Int64 against any non-Int64 operand (notably the literal
0 in `if N < 0`) emitted `csltw` — a 32-bit comparison — even when one
side was 64-bit. _Int64ToStr's negative-sign check therefore decided
sign by inspecting the low 32 bits of N, so any Int64 whose low 32
bits had the sign bit set printed as a wrapped negative. The codegen
now picks `csltl/csgtl/cslel/csgel/ceql/cnel` and sign-extends the
non-Int64 side when either operand is Int64.
Two ConstValue emit sites also switched from `%d` (truncated to int32 by
the C `_StringFormat` runtime) to `IntToStr(...)` + `%s`, so Int64
constants survive the trip through Format.
Result: stage-2 (FPC-built) and stage-3 (self-built) IR are now
byte-identical at 88,883 lines — fixpoint achieved.
Three new e2e regression tests cover the StrToInt hex form, the
Copy MaxInt idiom, and the Int64 sign-handling case.
EmitInstancePtr handled the IsImplicitSelf flag on TIdentExpr but not on
TFieldAccessExpr leaves (Base=nil, RecordName a field of Self). For a
chain such as FInner.Leaf.Value inside a method, the inner FInner.Leaf
node was emitted as `loadl %_var_FInner` — a phantom local — causing
QBE to reject the IR with `invalid type for first operand`.
This blocked self-hosting: TOPDFEmitter accesses FProgram.Block.* and
FProgram.SymbolTable.* in several methods, all of which produced
%_var_FProgram references that QBE refused, silently dropping every
function defined after the first error and breaking the link step.
Add the equivalent IsImplicitSelf branch in the TFieldAccessExpr leaf
path, mirroring the TIdentExpr handling. Add a regression test using a
3-level chain (the minimum that exercises the buggy path).
Seven source-compatibility fixes required to get the Blaise compiler to
parse and analyse its own source during the self-hosting fixpoint attempt.
None of these affect compiled output for existing programs; all 1105 tests
still pass.
Cardinal alias (uSymbolTable): maps to UInt32; used in uDebugOPDF.pas
PtrUInt alias (uSymbolTable): maps to Int64; used in uDebugOPDF.pas
xor operator (uLexer/uAST/uParser/uSemantic/uCodeGenQBE): tkXor/boXor
emit QBE 'xor'; used in uDebugOPDF.pas FNV hash
_ClassRelease external (blaise_arc.pas interface): C function declared
callable from Pascal; contnrs.pas calls it directly
contnrs.pas uses blaise_arc: makes _ClassRelease visible
not 7 → -8 (uDebugOPDF.pas): Blaise 'not' is Boolean-only; -8 = not 7
TProcess.Options removed (Blaise.pas): Blaise RTL TProcess has no
Options property; pipes are always active
FOutput.Strings[] (uDebugOPDF.pas): Blaise TStringList has no default
[] property; must use explicit .Strings[I] form
Stage-2 IR now generates: 88,526 lines, exit 0.
Remaining blocker: %_var_FProgram QBE error (see handover.txt).
Adds a detailed implementation note under the String Subscript section
explaining the data-pointer memory layout, why Blaise chose this over
header-pointer, the relationship to FPC's convention, and the implication
for the Phase 8 Migration Analyser when porting FPC code.
Blaise's single string type is UTF-8 with no code-page or element-size
fields — recAnsiStr is the wrong record type for it. Emit recUtf8Str
(type 23) instead, with three signed offsets (RefCountOffset=-12,
LengthOffset=-8, CapacityOffset=-4) relative to the data pointer.
Changes in Blaise compiler:
- uDebugOPDF: EmitAnsiStr → EmitUtf8Str; REC_UTF8STR=23; canonical
name 'Utf8String'; record size 12 bytes (no CodePage/ElementSize)
- CanonicalName: tyString now maps to 'Utf8String'
Test: TestOPDF_AnsiStr_Record updated to check '# recUtf8Str' and
'.ascii "Utf8String"'.
Changes Blaise's string variable convention from header-pointer to
data-pointer, matching how class objects work: the pointer stored in a
variable slot points to the first useful byte, with the ARC bookkeeping
header immediately before it at negative offsets.
New layout (data-pointer convention):
data_ptr - 12 RefCount (4 bytes, Integer)
data_ptr - 8 Length (4 bytes, Integer)
data_ptr - 4 Capacity (4 bytes, Integer)
data_ptr + 0 char data (UTF-8 bytes + NUL terminator)
Old layout (header-pointer convention):
header_ptr + 0 RefCount
header_ptr + 4 Length
header_ptr + 8 Capacity
header_ptr + 12 char data
Benefits:
- Consistency: both strings and class objects use "pointer to content"
convention; ARC header hidden at negative offsets for both
- S[N] subscript: simplifies from (ptr + N + 11) to (ptr + N - 1)
- PChar(str) cast: becomes an identity — str IS already the data pointer
- C interop: zero-cost on non-Win32 targets (Linux, macOS POSIX)
- OPDF: recAnsiStr now emits correct negative LengthOffset/RefCountOffset
RTL changes (all six string-layer files):
blaise_str.pas StrAlloc returns base+12; StrLen reads ptr-8;
StrData is identity; all callers updated
blaise_arc.pas _StringAddRef/Release access ptr-HDR_SIZE;
_StringEquals/_StringConcat updated
blaise_sys.pas _SysWriteStr/Int/Int64 read len at ptr-8
blaise_str_fmt.c str_alloc returns base+HDR_SIZE; str_data identity;
str_len reads ptr-8
blaise_io.c io_str_alloc/data/len updated; all callers fixed
blaise_process.c proc_str_alloc/data/from_cstr updated
Compiler codegen:
EmitStrLit adds 'add $__sN, 12' to convert header label to data ptr
S[N] 'add idx, 11' → 'sub idx, 1'
PChar(str) '+12 add' removed — identity pass-through
for B in S length from ptr-8; data from ptr+0 (no skip offset)
OPDF emitter: LengthOffset=-8, RefCountOffset=-12 (was +4, +0)
Tests: 2 test assertions updated to match new ABI semantics;
1105 total, all passing.
Adds 'for B in S do' iteration over the raw UTF-8 bytes of a string,
consistent with S[N] returning Byte. Loop variable may be any ordinal
type (Byte, Integer, etc.).
- uAST: TForInStmt gains IsStringIter field
- uSemantic: tyString branch in for-in dispatch — requires ordinal loop
variable; injects synthetic __idx_N (Integer) slot into block Decls
- uCodeGenQBE: IsStringIter path — 0-based index, condition reads
length from header at ptr+4 (csltw), element loaded via
loadub(ptr+12+idx); loop variable assigned with storew
Language layout reminder: string header is [refcount(4)][length(4)]
[capacity(4)][data...] so length is at offset +4 and char data at +12.
Docs: language-rationale.adoc updated — string byte iteration now listed
as supported under 'for..in'; set iteration and generic collection
iteration noted as deferred.
Tests: 8 new tests (3 semantic + 5 codegen); 1105 total, all passing.
Extends TForInStmt with an IsArrayIter path for 'for X in Arr do'
where Arr is a static array[L..H] of T.
- uAST: TForInStmt gains IsArrayIter, IdxVarName, ArrayLow, ArrayHigh
- uSemantic: collection-kind dispatch — tyStaticArray goes to the
index-based path; tyClass goes to the enumerator protocol path;
anything else is an error. The static-array path injects a synthetic
__idx_N (Integer) slot into the enclosing block for EmitVarAllocs.
- uCodeGenQBE: EmitForInStmt opens with an IsArrayIter branch that
emits an index-counter loop: init to ArrayLow, cslew to ArrayHigh,
element load via (base + (idx-low)*elemSize), assign to loop var
with ARC handling for string/class elements, increment + jmp back.
Non-zero-based ranges subtract LowBound before the multiply.
Tests: 8 new tests (5 semantic, 3 codegen for arrays); 1097 total,
all passing.
Implements `for X in Collection do` iteration using the GetEnumerator
protocol, matching FPC/Delphi semantics. This first commit covers
class-based enumerators; static array and byte-string iteration are
deferred to follow-on commits.
Compiler changes:
- uAST: new TForInStmt node (VarName, CollExpr, Body; semantic
annotations: EnumVarName, ResolvedVarType, GetEnumDecl, MoveNextDecl,
CurrentDecl)
- uParser: ParseForStmt returns TASTStmt; detects 'for X in' vs
'for X :=' and produces TForInStmt or TForStmt respectively
- uSemantic: AnalyseStmt handles TForInStmt — verifies GetEnumerator/
MoveNext/Current protocol, checks type compatibility, injects a
synthetic TVarDecl (__forin_N) into the enclosing block so
EmitVarAllocs allocates the slot and EmitArcCleanup releases it
- uCodeGenQBE: EmitForInStmt — calls GetEnumerator, ARC-stores result
in synthetic slot, loops via MoveNext, reads Current, assigns to
loop variable; handles both static and virtual dispatch
- uDebugOPDF: CollectStmtLines extended with TForInStmt case
RTL additions:
- classes.pas: TStringListEnumerator + TStringList.GetEnumerator
- contnrs.pas: TObjectListEnumerator + TObjectList.GetEnumerator
Docs:
- grammar.ebnf: ForStmt gains the 'FOR IDENT IN Expr DO Stmt' alternative
- language-rationale.adoc: new Iteration section documenting the protocol
choice and what is deferred
Tests: 17 new tests in cp.test.forin (parser, semantic, codegen);
1089 total, all passing.
Adds compiler/src/it/ (Maven-convention integration test directory) with
a Blaise-specific PDR driver. Four initial tests ported from the OPDF
integration suite: breakpoint+next, local variables, locals command,
and step-over. Test programs are adapted for Blaise (no FPC directives),
line numbers preserved to match the original commands files.
The pasbuild-integration-test plugin (phase: none) can be invoked as
'pasbuild integration-test'; it verifies pdr and the Blaise binary are
present, then delegates to compiler/src/it/run_tests.sh.
All four tests currently fail — line info in the OPDF section maps every
statement to the function-start address (per-stmt addresses require QBE
changes, tracked in future-improvements.adoc). The aspirational expected
files show exactly what each test should produce once OPDF is complete,
making failures a clear roadmap rather than noise.
Also adds PIE/ASLR support entry to future-improvements.adoc (Linux,
FreeBSD, macOS load-base strategies for the PDR debugger).
- uDebugOPDF: add EmitFunctionScope_Main to emit recFunctionScope keyed on
label 'main' for the program body, including per-line recLineInfo records
- uDebugOPDF: refactor EmitLineInfoForScope into EmitLineInfoForBlock so
both procedure scopes and the main body share one implementation
- Blaise: pass -no-pie to gcc when linking a debug-opdf build so OPDF
.quad addresses are absolute runtime addresses; PIE relocation produces
relative offsets that the debugger cannot use without the load base
- Tests: three new assertions covering recFunctionScope, LowPC, and line
info for the main program body (28 OPDF tests total, all passing)
Standalone procedures/functions now emit 'export function' in QBE IR
instead of bare 'function'. Global data items now emit 'export data'.
This makes these symbols globally visible (.globl in assembly output),
which is required for the OPDF companion file to reference them via
.quad directives at link time.
Without export, QBE emits local-only labels that the linker cannot
resolve from a separate object file (.opdf.s).
New unit uDebugOPDF.pas with TOPDFEmitter:
- EmitHeader, EmitSection: writes .opdf ELF section with OPDF magic header
- EmitPrimitive, EmitEnum, EmitRecord, EmitClass, EmitAnsiStr: type records
- EmitGlobalVar: recGlobalVar with linker-resolved .quad address
- EmitFunctionScope: recFunctionScope with LowPC/HighPC labels
- EmitParameters: recParameter for each proc/func parameter
- EmitLocalVars: recLocalVar with RBP-relative stack offsets
- EmitLineInfoForScope: recLineInfo records from AST line numbers
(uses function-start label as address; per-stmt addr needs QBE changes)
- CollectStmtLines: recursive AST walker for unique (line, col) pairs
- FNV-1a 32-bit TypeID allocation; ScopeID counter for scope linking
- DoEmit/PatchTotalRecords: idempotent emission with TotalRecords patching
Blaise.pas pipeline:
- --debug-opdf / -g flag: creates companion .opdf.s alongside output binary
- CompileToNative passes companion file to linker
- RunProcess: add poUsePipes so TProcess.Output is valid (pre-existing crash)
Tests: cp.test.opdf.pas with 22 tests covering all record types, fields,
addresses, and line info. Validated end-to-end with opdf_dump.
{$H+} is required for FPC compilation (string = AnsiString); not needed
when compiled by Blaise itself (Blaise defaults to AnsiString).
TDuplicates = (dupAccept, dupIgnore, dupError) replaces the integer
constant workaround that was needed before enum type support existed.
FDuplicates field and Duplicates property are now typed TDuplicates;
the constructor initialises with dupAccept and Add() compares against
dupIgnore by name rather than the magic literal 1.
All 1035 compiler tests pass.
Write/WriteLn now call _SysWriteStr/_SysWriteInt/_SysWriteInt64/
_SysWriteNewline (blaise_sys.pas + blaise_sys_posix.c) instead of
printf/fprintf. _SysWriteNewline uses POSIX write(2) directly;
no format strings, no libc I/O buffering.
Pure Pascal implementations replace these libc calls in the RTL:
- toupper / tolower (inline ASCII arithmetic in blaise_str.pas)
- strlen (NUL-scan loop in blaise_str.pas)
- memcpy (byte-copy loop in both blaise_str.pas and blaise_arc.pas)
- memcmp (byte-compare loop in blaise_arc.pas)
Remaining libc dependency: malloc/free (needs Pascal allocator — Step 9d).
All 1035 compiler tests pass.
Port all non-function-pointer ARC functions from C to Pascal:
_StringAddRef, _StringRelease, _StringEquals, _StringConcat,
TObject_Destroy, _ClassAddRef, _ClassFree
Remaining in C (blaise_arc_class.c — renamed from blaise_arc.c):
_ClassAlloc and _ClassRelease — store and call a function pointer
(the $_FieldCleanup_TypeName hook), which Blaise cannot express yet.
Compiler fixes required to support this port:
- uCodeGenQBE: EmitFuncDef now exits early for IsExternal declarations;
previously it crashed (access violation) when iterating a nil body
- uSymbolTable: remove _ClassAddRef and _ClassRelease from RegisterBuiltins;
they are internal RTL symbols emitted directly by the codegen, not
user-callable builtins, and pre-registering them caused "Duplicate
identifier" errors when the unit interface re-declared them
RTL Makefile: blaise_arc_class.c replaces blaise_arc.c in C_SRCS;
blaise_arc.pas added to PAS_OBJS with its own build driver.
All 1035 compiler tests pass.
Remove blaise_str.c from the RTL archive and replace it with object code
compiled from blaise_str.pas via the Blaise compiler itself. The variadic
_StringFormat cannot be expressed in Pascal so it moves to blaise_str_fmt.c.
Makefile changes:
- blaise_str.c removed from C_SRCS; blaise_str_fmt.c added in its place
- New Pascal build rules: .pas → .ssa (unit IR via build driver + sed strip)
→ .s (QBE) → .o (gcc -c) → included in blaise_rtl.a
- blaise_str_build_driver.pas: minimal program driver used by the Makefile
to compile the unit; the program section is stripped before assembly
All 1035 compiler tests pass with the new RTL.
- Add `mod` operator: tkMod/boMod in lexer+AST+parser, QBE `rem` in codegen
- Allow assignment to value parameters (skParameter) in semantic checker
- PChar + Integer arithmetic: semantic and codegen now accept PChar on pointer-arithmetic LHS
- PChar nil comparison: nil is now compatible with PChar in all comparison/assignment contexts
- Untyped Pointer ↔ PChar: CheckTypesMatch accepts PChar where Pointer expected and vice-versa
- Type cast widening fix: Int64(IntExpr) emits `extsw` instead of invalid `l copy w`
- CoerceArg helper: sign-extends w arguments to l at all call sites (proc/func/method)
- blaise_str.pas: Pascal port of blaise_str.c — compiles cleanly and passes runtime test
All 1035 tests pass. blaise_str driver produces correct output for IntToStr, StrToInt,
StringLength, StringUpperCase, StringLowerCase, StringTrim, StringPos, StringCopy, Chr.
Add the 'external' directive to proc/function/method declarations,
enabling Pascal code to bind to C symbols without a body:
procedure Foo; external;
function Bar: Integer; external name 'c_bar';
- uLexer: tkExternal token; mapped in the identifier fast-path
- uParser: ParseMethodDecl and ParseForwardDecl consume 'external'
and optional 'name <string>'; body-trigger check is suppressed for
external declarations so the following 'begin' is not consumed as a
method body
- uAST: TMethodDecl.IsExternal, TMethodDecl.ExternalName
- uSemantic: external interface decls are exempt from the
"no implementation" check; AnalyseStandaloneDecl skips AnalyseBlock
when IsExternal is set
- uCodeGenQBE: EmitProcCall and TFuncCallExpr codegen use ExternalName
as the QBE symbol when set; no function body emitted for external decls
- grammar.ebnf: MethodDirective / ExternalDirective rules; MethodDecl
and StandaloneDecl updated to use { MethodDirective SEMICOLON }
11 new tests in cp.test.external — all 1035 tests pass.
- Fix ParseMethodDecl: add tkConst to body-trigger condition so const
blocks are parsed inside method, procedure, and function bodies
- ParseConstBlock now accepts TObjectList directly (was TBlock) so it
can be called uniformly from all scope positions
- Class body loop: handle CONST sections (→ TClassTypeDef.ConstDecls)
and VAR keyword before field declarations
- TClassTypeDef.ConstDecls: new owned TObjectList of TConstDecl
- TFieldAccessExpr: new IsConstant/ConstValue/ConstString fields set by
uSemantic when TypeName.ConstName resolves to a class-level constant
- uSemantic: register class constants as both unqualified and qualified
(TFoo.MaxItems) symbols; resolve TypeName.ConstName in field-access
analysis before raising "Unknown class method" error
- uCodeGenQBE: emit integer copy or _StringRetain for IsConstant paths
- docs/grammar.ebnf: add ConstSection/ConstDecl/ConstExpr rules;
update Block, InterfaceSection, ImplementationSection, ClassDef, and
GenericClassDef to allow ConstSection
All 1024 tests pass including 15 new const-scope regression tests.
10 tests covering integer consts, negative consts, string consts,
multi-const blocks, two const blocks in one scope, unit interface
const block parsing, unit implementation const block parsing, and
cross-unit export visibility (interface const visible in importing
program via AnalyseUnitForExport).
All pre-existing 1009 tests continue to pass (1019 total).
Updates future-improvements.adoc: const support is complete.
Standalone pasbuild plugin (phase: none) that builds the Blaise compiler
using the Blaise bootstrap binary rather than FPC:
pasbuild blaise-compile
Steps: RTL make+install → emit IR via bootstrap binary → qbe assemble
→ gcc link → compiler/target/blaise
Bootstrap binary resolved from BLAISE_BOOTSTRAP env var or the newest
releases/vX.Y.Z/blaise binary found in the project tree.
Blaise is now fully self-hosting on the true multi-file source.
Fixpoint confirmed: releases/v0.3.0/blaise (Blaise-compiled) recompiles
Blaise.pas and produces byte-identical IR to the FPC-built stage-1.
Blaise already handles FPC-style invocations (IsFPCStyleInvocation,
HandleFPCInfoQuery, ParseFPCArgs), so pasbuild --fpc releases/v0.3.0/blaise
works today. The only remaining improvement is renaming --fpc to --compiler
in PasBuild's CLI for clarity.
Two new future-improvement entries covering the remaining FPC dependencies
in the development cycle:
- Native Blaise test framework: port fptest (DUnit2-based) to pure Blaise
so that cp.test.*.pas units compile and run without FPC; eliminates the
last FPC dependency from pasbuild test
- PasBuild Blaise compiler backend: rename --fpc to --compiler, add backend
detection and Blaise-style command-line construction so that
pasbuild compile --compiler releases/v0.3.0/blaise works correctly
- language-rationale.adoc: update MaxInt entry — now Integer = 2147483647
(32-bit) with full rationale explaining the Int64 truncation chain;
update IntToStr table to note auto-routing to _Int64ToStr for Int64 args
- future-improvements.adoc: add two new entries
* "Int64 literal range detection in self-hosted binary" — root cause of
MaxInt workaround; ConstValueInt64 path to restore full Int64 support
* "const sections in unit interface and implementation blocks" — deferred
feature blocking dupAccept/dupIgnore/dupError in classes.pas public API
Fixes required to reach byte-identical IR between stage-1 and stage-2
when compiling the multi-file Blaise.pas source.
Compiler fixes:
- uCodeGenQBE.pas: QbeEscapeString — replace Format('%02x',[C]) with
manual hex encoding (Hi := C shr 4; Lo := C and 15; Chr(...));
Blaise's _StringFormat does not support %x, causing non-ASCII bytes
(e.g. UTF-8 em-dash U+2014) to be emitted as \%02x instead of \E2\80\94
- uCodeGenQBE.pas: EmitFuncCallExpr — route IntToStr to _Int64ToStr when
the argument resolves to Int64 (QBE type 'l'), matching FPC's overloaded
IntToStr resolution; prevents 64-bit values being truncated to Int32
before string conversion
- uSymbolTable.pas: MaxInt changed from Int64 (9223372036854775807) to
Integer (2147483647); all uses are Copy(S,N,MaxInt) meaning "rest of
string", and 2147483647 is handled correctly by _StringCopy; avoids
Int64 literal truncation/extsw issues in the self-hosted binary
RTL fixes:
- blaise_str.c: _StringCopy — negative count (64-bit MaxInt truncated to
int32 = -1) now treated as "rest of string" rather than 0
- blaise_str.c: add _UpCase helper
- classes.pas: TStringList.GetText — add trailing #10 to match Delphi/FPC
TStringList.Text semantics (each line including the last ends with LF);
SaveToFile updated to not double-add the trailing newline
Tests: 1009 pass
Fixpoint: diff /tmp/multifile.ssa /tmp/multifile2.ssa → empty
Fixes required to get the multi-file compiler binary (blaise-multi)
to compile Blaise.pas without crashing.
RTL fixes:
- contnrs.pas: TObjectList ARC — Add/Put/Delete/Clear/Destroy now call
_ClassAddRef/_ClassRelease so stored objects survive beyond their
creating scope; fixes premature-free of TTypeDecl nodes during
AnalyseUnitForExport
- blaise_str.c: _StringCopy — treat negative count as "rest of string"
instead of 0; 64-bit MaxInt (0x7fffffffffffffff) is truncated to -1
when passed as a 32-bit w argument to _StringCopy, which was causing
Copy(S, 2, MaxInt) to return empty string in FindTypeOrInstantiate
- blaise_str.c: add _UpCase C helper
- blaise_arc.c: minor ARC fixes
Compiler fixes:
- uAST.pas: add IsVarParam flag to TMethodCallStmt and TMethodCallExpr
- uSemantic.pas: set IsVarParam when object symbol is skVarParameter
- uCodeGenQBE.pas: emit double-dereference for method calls on var/out
parameters — the local slot holds the caller's address, not the
object pointer, so one extra loadl is needed to reach the receiver
- uSymbolTable.pas, uUnitLoader.pas, uParser.pas, uLexer.pas: various
fixes discovered during multi-file pipeline testing
- Blaise.pas: improved error reporting
Tests: 1009 pass
Parser, lexer, tokeniser, semantic analyser and symbol table extended
to compile the multi-file Blaise source with the Blaise compiler itself.
Stage-2 and stage-3 IR are byte-identical; fixpoint confirmed.
Changes to reach fixpoint:
- uLexer: source filename parameter for actionable parse error messages
- uParser: method directive loop (inline/stdcall/abstract/…), unit
interface/implementation loops for var/const/type blocks, chained
field-assignment (A.B.C := v), filename in all EParseError messages
- uPasTokeniser: full rewrite to remove FPC-only features (char sets,
shr, Exit(value), private/public visibility) so Blaise can compile it
- uSymbolTable: remove unsupported default parameter values
- uSemantic: replace Exit(value) with Result+Exit; expand five `with`
statement blocks to explicit typed local variables
- uAST, uCodeGenQBE: minor additions supporting the above
- uUnitLoader: pass filename to TLexer.Create
- classes.pas: inline dupIgnore literal (const section deferred)
These units are now provided by the Blaise RTL, so the unit loader
should resolve and compile them rather than silently treating them
as built-in FPC units.