diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 09:18:23 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 09:18:23 +0000 |
| commit | 9467ae311ddc0ce8b4c329f3dbcec88fb279719d (patch) | |
| tree | 6102b28ca01d88c96bab5d13a4f0dcb547649d2f /doc/language/keyword/cpsc-keyword-function.7.md | |
| parent | 64aa538142148faf06b9a3c71907eacee04cd49d (diff) | |
docs: multi-file builds
Document INCLUDE visibility, primitive GLOBAL variables and MAIN entry rules,
and highlight the new keywords in the editor grammar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/language/keyword/cpsc-keyword-function.7.md')
| -rw-r--r-- | doc/language/keyword/cpsc-keyword-function.7.md | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/language/keyword/cpsc-keyword-function.7.md b/doc/language/keyword/cpsc-keyword-function.7.md index c20bb50..d734da3 100644 --- a/doc/language/keyword/cpsc-keyword-function.7.md +++ b/doc/language/keyword/cpsc-keyword-function.7.md @@ -23,6 +23,8 @@ Parameters use `name : type`, optionally prefixed by BYVAL. BYVAL is the default A FUNCTION inside CLASS defines a member function, called as `Object.Method(arguments)`. It follows the same parameter and return rules. Within a method, use `this.Method(arguments)` to call another method on the current object; see [cpsc-keyword-class(7)](cpsc-keyword-class.7.md). +As a compiler extension, a top-level `FUNCTION MAIN RETURNS INTEGER` with no parameters supplies the program entry point. MAIN is case insensitive and cannot coexist with top-level executable statements in any input file. Its INTEGER result, truncated to 32 bits, is returned as the process exit status. An uncaught exception prints the generic termination message and returns 1. A PROCEDURE MAIN or a MAIN with parameters or a non-INTEGER result is an error. The usual default INTEGER result type also applies when RETURNS is omitted. + # EXAMPLE ```text |
