diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-13 12:32:03 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-13 12:32:03 +0000 |
| commit | 17cec530b0a4d792bde2d37583b6c26e89f9b1bd (patch) | |
| tree | 6b67f23d68ccf21dd6052f858037be7b49244c4c /doc/cpsc.md | |
| parent | 42acac3dac5b8ff5aec4ff204d2c1da948ea34b0 (diff) | |
fix: distinguish compiler errors and report compilation termination
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'doc/cpsc.md')
| -rw-r--r-- | doc/cpsc.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/cpsc.md b/doc/cpsc.md index bfd54d0..98340aa 100644 --- a/doc/cpsc.md +++ b/doc/cpsc.md @@ -64,13 +64,15 @@ cpsc test.cps -r -o result.ir # EXIT STATUS **0** -: Compilation succeeded. Invoking `cpsc` with no arguments also exits silently with status 0. +: Compilation succeeded. **1** -: An argument, file, compilation or execution-engine error occurred, including when PATH mode cannot find `lli` or NONE mode receives **-r**. +: An argument, file, compilation or execution-engine error occurred, including missing input, when PATH mode cannot find `lli` or NONE mode receives **-r**. With **-r**, return the executed program's exit status. In PATH mode, failure to launch `lli` or a child-process crash returns 1. # NOTES Compiler diagnostics go to stderr. Failed compilation does not write IR. Successful compilation overwrites an existing output file, but an output path that refers to the source file (including a symbolic or hard link) is rejected. + +Missing input, including invoking `cpsc` without arguments, reports `cpsc: fatal error: no input files`. Ordinary lexical, syntax and semantic errors use `error:`; failures that prevent compilation, such as file I/O errors, use `fatal error:`. Compilation and argument failures end with one `compilation terminated.` line. Execution-stage failures do not print that line. |
