Float Str / Val
- Type: feature
- Status: done
- Owner: —
- Opened: 2026-06-06 (from todo.md §4)
- Resolved: 2026-06-18 (commit b744ab6) — float Str/Val, byte-identical to FPC, cross-bootstrap clean. Found+filed a pre-existing int→float assignment bug (feature-int-to-float-assign); ValFloat works around it with float literals.
Motivation
Str/Val are implemented for integers only (compiler/builtin/builtin.pas). Float
conversion is the remaining gap. (Float intrinsics Trunc/Round/Int are
already done — test/test_float_intrinsics.pas.)
Scope
- Float
Val: reuse the native float parserStrToDoubleBits(lexer.inc). - Float
Str: reuse thewritelnfloat formatter. - Wiring is nearly free per todo.md:
Valis a plain proc → add aDoubleoverload, resolver picks by destination type.Stris parser-intercepted → desugar dispatches on the value'sASTTk(float →StrFloat, elseStrInt). :w:dwidths stay literals (matcheswrite); expression widths out of scope (seefeature-flexcolumn-directive).
If importing instead of rolling: strtod (stdlib.h, clean) — not math.h.
Don't block on the C-header arc.
Acceptance
Str/Val round-trip Double values in a regression test; integer behavior
unchanged.
Log
- 2026-06-06 — ticket opened from todo.md §4.
- 2026-06-18 — implemented per spec; resolved. See header.