diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-21 14:06:54 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-21 14:06:54 +0000 |
| commit | 899c2af576124df2918fd2ae976434df0ebbae5b (patch) | |
| tree | bb67a979eca30a6d447c2819576b81dc84741f17 /doc | |
| parent | b4ffb2d9498560557821714e2d4651279dd6817c (diff) | |
feat(driver): color diagnostics like gcc with -fdiagnostics-color
Add -fdiagnostics-color[=auto|always|never] and -fno-diagnostics-color.
The default auto mode colors only a terminal stderr (TERM set and not
dumb on Unix; a console that accepts VT sequences on Windows), so test
harnesses, the desktop bundle and other pipes stay plain.
Every diagnostic label now comes from cps::diagnosticPrefix, which emits
gcc's default GCC_COLORS bytes: bold locus, bold red error/fatal error,
bold magenta warning, bold cyan note. compilation terminated., runtime
messages of the compiled program and lld output are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/cpsc.1.md | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/cpsc.1.md b/doc/cpsc.1.md index b156d6f..6a81a8a 100644 --- a/doc/cpsc.1.md +++ b/doc/cpsc.1.md @@ -6,7 +6,7 @@ cpsc - compile and run CIE pseudocode # SYNOPSIS -**cpsc** [**-r**] [**-S**] [**-no-std**] [**-o** *output*] *source* [*source* ...] +**cpsc** [**-r**] [**-S**] [**-no-std**] [**-fdiagnostics-color**[=*when*]] [**-o** *output*] *source* [*source* ...] **cpsc** **-h** @@ -39,6 +39,9 @@ The embedded standard library is loaded and linked automatically. Its std.cps im **-no-std** : Disable automatic standard-library loading and linking. Explicit INCLUDE and INCLUDE_OBJ inputs still work. +**-fdiagnostics-color**[=*when*], **-fno-diagnostics-color** +: Color compiler diagnostics like gcc: the `file:line:` or `cpsc:` prefix in bold, `error:` and `fatal error:` in bold red, `warning:` in bold magenta and `note:` in bold cyan. *when* is `auto` (the default), `always` or `never`; **-fdiagnostics-color** alone means `always` and **-fno-diagnostics-color** means `never`. The last such option wins. `auto` colors only when stderr is a terminal: on Unix/macOS `TERM` must also be set and not `dumb`; on Windows the console must accept ANSI escape sequences. Runtime diagnostics of the compiled program are never colored. + # NATIVE COMPILATION Native compilation uses LLVM, the Clang driver and LLD embedded in `cpsc`. Required startup objects, runtime archives and system-library link inputs are embedded too and unpacked temporarily when linking. No external compiler, linker or development SDK is needed. Generate programs for the compiler's own operating system and CPU architecture; cross-compilation is not supported. |
