diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 15:33:17 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 15:35:05 +0000 |
| commit | 8745f421b4cf7e1d54c17a360d46fab889ca12cc (patch) | |
| tree | 4c2a3508627db04493af35643580417d41b63f89 /AGENTS/PITFALLS | |
| parent | 5e84edbe1a79c6a7752ee276ea6c1a4daef4fa8e (diff) | |
feat(input)!: validate INPUT and read whole lines into STRING
Scalar INPUT now reads one whitespace-delimited token through module-local
IR helpers instead of scanf, then skips spaces and tabs and consumes one
newline. INTEGER, REAL, BOOLEAN (TRUE or FALSE in any case) and CHAR are
validated, and bad input or end of input is a runtime error. STRING INPUT
reads the rest of the line. The unused scanf and REAL printf format globals
are removed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'AGENTS/PITFALLS')
| -rw-r--r-- | AGENTS/PITFALLS/core-language.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/AGENTS/PITFALLS/core-language.md b/AGENTS/PITFALLS/core-language.md index 0ddba05..dd222c7 100644 --- a/AGENTS/PITFALLS/core-language.md +++ b/AGENTS/PITFALLS/core-language.md @@ -9,7 +9,9 @@ source, most also by compiling and running test programs. mixed output lists; a final array adds no extra newline. INPUT accepts writable scalar locations, including array elements, public record/class fields and pointer dereferences, using the shared lvalue checks. Whole arrays and whole - records/classes remain unsupported INPUT targets. + records/classes remain unsupported INPUT targets. Scalar INPUT reads a validated + whitespace-delimited token (IR helpers in `InputGen.cc`, no scanf); STRING INPUT reads + the rest of the line via READ_INPUT. Bad input and end of input are runtime errors. - **Arrays cross function boundaries only as parameters.** `ArrayTable` is scoped per function, so referencing another function's array fails cleanly as "Undeclared array". Whole arrays pass as `ARRAY OF T` / `ARRAY[l:u,...] OF T` |
