diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 15:20:26 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 15:20:26 +0000 |
| commit | 9ef1cc2424e5afa21d3980b56046f5fb71bff89f (patch) | |
| tree | 7b1fff9f3114601e3fa7a29ecc9e31481a4bccf6 /AGENTS | |
| parent | 5c491c54a22044ef1570c3fb709e14264e367fb1 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'AGENTS')
| -rw-r--r-- | AGENTS/PITFALLS/core-language.md | 5 |
1 files changed, 3 insertions, 2 deletions
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. |
