aboutsummaryrefslogtreecommitdiff
path: root/doc/language
AgeCommit message (Collapse)Author
2026-10-30docs(types): explain implicit constructors and raw text literalsHEADmain_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28docs(overload): document default return selection_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27docs(preprocessor): document switches and library regions_ov4
Add manuals and aliases for all five PP directives, replace the retired #LIB page, and update compiler and shared-editor architecture notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27docs(memory): describe standard-library allocation and explicit imports_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24docs(overload): document return-type selection across keyword pages_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24feat(operator): select operator overloads by the expected result type_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24feat(overload): select overloads by return type as well as parameters_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23fix(stdlib): reject NaN, infinity and hexadecimal text in IS_NUM, STR_TO_NUM ↵_ov4
and INPUT Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23feat(stdlib): add a CHAR overload of STR_TO_NUM_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23fix(stdlib)!: return CHAR from CHR_ov4
BREAKING CHANGE: CHR now returns CHAR instead of STRING, so user overloads and templates select or deduce CHAR for CHR(...). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22feat(input)!: validate INPUT and read whole lines into STRING_ov4
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>
2026-10-22fix(parser): accept bare NEXT and read its identifier only from the same line_ov4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22feat(codegen): convert implicitly between CHAR and STRING_ov4
A CHAR becomes a one-character STRING in &, comparisons, assignment, parameter passing and RETURN. A STRING becomes a CHAR in assignment, parameter passing and RETURN, with a runtime error when its length is not 1. CHAR with INTEGER or BOOLEAN still does not convert. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22feat(codegen): short-circuit AND and OR_ov4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22feat(codegen)!: require explicit REAL to INTEGER conversion and add INT_ov4
Implicit REAL to INTEGER is now a compile error with an INT(...) hint. INT is a compiler builtin that truncates toward zero and raises a runtime error for NaN or values outside the INTEGER range. No existing test program relied on the implicit conversion. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22feat(codegen)!: reject implicit BOOLEAN, CHAR and INTEGER mixing_ov4
Arithmetic and unary minus accept only INTEGER and REAL, AND/OR/NOT need BOOLEAN, comparisons need equal types (or INTEGER with REAL), and only INTEGER converts implicitly to REAL. Use ASC and CHR for characters. No existing test program relied on the now-illegal mixing, so none changed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22fix(classes): defer NEW for DECLARE without a parameterless constructor_ov4
A plain DECLARE, field or array element now calls NEW only when the class has a parameterless one; otherwise the zeroed object waits for x <- NEW C(...), as in guide section 10.2. DECLARE with parentheses still requires a matching constructor. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22fix(codegen): raise a runtime error when a FUNCTION ends without RETURN_ov4
Report the function and its header line, then throw, instead of silently returning zero. FUNCTION MAIN keeps its implicit result. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22fix(arrays): reject inverted bounds and check array allocation_ov4
Constant inverted bounds are a compile error and other bounds are checked at run time. Allocation sizes use overflow-checked arithmetic, and a NULL malloc (including the BYVAL copy) reports that the array is too large. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22feat(output)!: print REAL values in shortest round-trip form_ov4
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>
2026-10-22fix(stdlib): make IS_NUM agree with STR_TO_NUM and explain conversion errors_ov4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22docs: document C-struct records for EXTERN_ov4
Describe which TYPE records count as C structs, passing them by value and by pointer as parameters, RETURNS and variadic arguments, and the recursive pointer types EXTERN accepts. Note the clangCodeGen dependency and the CABI sources in the architecture notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21docs: document TEMPLATE_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20docs(strings): document the embedded standard library and STRING values_ov4
Describe -no-std, C_STRING literals, library function semantics and owning string lifetimes in the manuals and contributor guidance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20docs(man): correct class lifetime and allocation support_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(lib): add experimental _EXP_STRING backed by std::string_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(operators): allow member assignment operator overloads_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(classes): add copy constructors and statement-scoped temporaries_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(driver): add #LIB directive hiding library lines in runtime errors_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(lexer): accept identifiers starting with an underscore_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(lexer): support C++ escape sequences in literals_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(operators): document overloads and cover remaining operator forms_ov4
Add fixed cases for every supported operator, imported global and member operators, CASE comparisons, and declared result type errors. Document syntax, exact matching, access rules and temporary receiver lifetimes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17docs: describe EXTERN redeclaration and verified lli runs_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17docs: document EXTERN and INCLUDE_OBJ_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17docs: document OVERLOAD_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17docs: runtime diagnostics go to standard error_ov4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17feat(runtime): write runtime diagnostics to stderr_ov4
Runtime check messages and the unhandled-exception message were printed to stdout by the generated program, so `cpsc x.cps -r >out.txt` captured them. They are now formatted with snprintf and written with write(2). Test expectations and docs are updated accordingly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17docs: multi-file builds_ov4
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>
2026-10-17docs(classes): document destructors, DELETE and RAII_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17fix(classes): preserve method-only heap objects and document NEW_ov4
Allocate at least one byte for method-only classes so their heap addresses remain usable through pointers. Complete constructor diagnostics, field-order and exception coverage, document construction and rebinding, and highlight NEW. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17docs(classes): describe member methods and this semantics_ov4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-17feat(memory): add checked REALLOC with failure preservation_ov4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-17feat(memory): add tracked MALLOC and FREE builtins_ov4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-17feat(calls): support standalone calls and void pointer casts_ov4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-17docs(input): document array and member targets_ov4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16docs(man): list alias keywords in NAME sections_ov4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16fix(compiler): correct CIE semantics and diagnostic locations_ov4
Use standard WHILE headers and default-public class fields, resolve pseudocode identifiers without case sensitivity, and check signed i64 literal boundaries before conversion. Preserve source locations across recursive emission and function diagnostics. Add 22 regression cases and update compiler examples and documentation. Validated all 69 CTest entries with the original Linux Actions seed and verified the release package's embedded, native and IR output paths.
2026-10-16feat(constants): implement literal constants with lexical scope_ov4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16feat(control-flow): implement ordered CASE OF matching_ov4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15fix(codegen): restore runtime diagnostics before throwing_ov4
Reuse historical runtime messages and source-line reporting for arithmetic, array, enum, pointer and file checks while preserving anonymous exceptions. Update the manuals and subsystem guidance to describe diagnostic output. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>