From 9ef1cc2424e5afa21d3980b56046f5fb71bff89f Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 15:20:26 +0000 Subject: feat(output)!: print REAL values in shortest round-trip form OUTPUT and NUM_TO_STR now share Python repr formatting instead of %f. BREAKING CHANGE: REAL output changes from six fixed decimals (2.500000) to the shortest round-trip text (2.5). Co-Authored-By: Claude Sonnet 5.5 --- AGENTS/PITFALLS/core-language.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'AGENTS/PITFALLS') diff --git a/AGENTS/PITFALLS/core-language.md b/AGENTS/PITFALLS/core-language.md index 219c0d8..60fbd11 100644 --- a/AGENTS/PITFALLS/core-language.md +++ b/AGENTS/PITFALLS/core-language.md @@ -31,8 +31,9 @@ source, most also by compiling and running test programs. DIV/MOD only. - CHR returns an owning one-byte STRING, not CHAR; CHR(0) retains one NUL byte. - STR_TO_NUM always returns REAL and shares parseNumber (strtod, full consumption, overflow rejected) with IS_NUM. - - NUM_TO_STR uses std::to_string, preserving the full signed i64 range and six - fractional digits for REAL. + - NUM_TO_STR keeps the full signed i64 range for INTEGER; REAL uses the shortest + round-trip text (realText in string.cc), byte-identical to OUTPUT's IR helper in + OutputGen.cc (`__cps_output_real`); change both together. C_DOUBLE output keeps `%f`. - **`getExprTypeInfo` returns nullptr** for expressions it can't classify (null-check it at any new call site) and internally defaults to INTEGER for unclassified arithmetic expressions; unknown or unmatched calls diagnose and return nullptr. -- cgit v1.3.1-4-g156e