blaise/docs
Graeme Geldenhuys faee6e6bef feat(lang): type aliases, floats, Abs, ClassName + global record fix
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.
2026-05-04 02:02:06 +01:00
..
design.adoc feat: multi-file compilation (v0.2.0) 2026-04-27 11:35:26 +01:00
future-improvements.adoc feat(lang): type aliases, floats, Abs, ClassName + global record fix 2026-05-04 02:02:06 +01:00
grammar.ebnf feat(types): bare procedural types (function/procedure pointers) 2026-05-03 23:15:42 +01:00
language-rationale.adoc feat(types): bare procedural types (function/procedure pointers) 2026-05-03 23:15:42 +01:00