| Age | Commit message (Collapse) | Author |
|
Track library mode by original source line, including deferred template bodies
and automatic object cleanup. Update call lines from ordinary code and migrate
the embedded standard library to PP_DEFINE __LIB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Route keyword NEW and DELETE through the same library runtime and retain
allocation tracking, runtime diagnostics and exception behavior.
BREAKING CHANGE: -no-std programs using NEW or DELETE must explicitly import memory.cps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
Verify the module only when no error was reported, and let defineRecord
skip bad fields and still set the record body, marking it Invalid so
later missing-field lookups stay silent.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
|
Pure move of both marshalCallArgs overloads, emitVariadicArgument and
resolveCall out of CodeGen.cc; no behavior change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
|
Drop the never-read StackObject::IsCopy flag and registerStackObject
parameter, the unused NewExprAST forward declaration, the unused Ret
parameter of FunctionGen::emitReturn and CG parameter of
ArrayHandler::loadElement, unused <cstdio> includes, and the
coerceValueToType early returns already covered by the exact LLVM type
check (builtin kinds always map to double/i64/i1/i8).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
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>
|
|
Lexer, parser, driver and codegen diagnostics now read
"<path>:<line>: error: <message>" instead of "error: <message> at line N
in <path>". The path is always printed as given on the command line.
Call sites pass the bare message to cps::sourceError/sourceWarning, which
carry printf format checking; reportError routes through the same helper.
The suite iii harness parses the new layout and matches the reason
against the message only. iii/template-class-pack-field passed only
because its reason regex matched the case path, so it is now
case-insensitive.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Construct literals as STRING values and route string operations through
ordinary library functions and operators. Preserve value ownership in
records, arrays, constants and file I/O.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Select member and global candidates together, enforce private access, and
reuse argument marshalling. Materialize temporary receivers for chaining
and register them for the existing object cleanup mechanism.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Repeated EXTERN declarations with the same signature share one C symbol,
as C declarations do; conflicting signatures are errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Variadic arguments must be C values and receive C default argument
promotions; narrow integer parameters carry sign/zero extension.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
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>
|
|
Invoke the internal entry function through the generated exception handler
and truncate its INTEGER result to the process exit status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Reject builds without an entry program and duplicate cross-file definitions.
Preserve source order for each unit's own constants and import visible exports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
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.
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
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>
|
|
Reject other compiler and LLVM major versions and remove GCC compiler
fallbacks. Adapt string globals, block termination checks and the embedded
target triple to LLVM 23 without changing pseudocode behavior.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Add TRY/CATCH/ENDTRY and anonymous THROW statements. Use LLVM exception
handling and the C++ ABI to propagate exceptions across function calls,
clean up catch state, and handle uncaught exceptions at the program boundary.
Register exception runtime symbols for the statically linked embedded runner.
Verify runtime checks, nested catches, returns, loops, and invalid syntax
with smoke programs; exercise unwinding with MCJIT, lli, and native binaries.
BREAKING CHANGE: Runtime check failures now throw anonymous exceptions and
print only a generic message when uncaught. Native binaries require linking
the C++ runtime.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
- RETURN outside any FUNCTION/PROCEDURE used to emit an i64/void ret
inside i32 main — a verifier dump instead of a diagnostic. It is now a
clean compile error (no signature means top level: pseudocode cannot
name a function 'main', it is a reserved runtime symbol).
- READFILE "f.txt", r.f mis-parsed into an error cascade the same way
INPUT r.f did before its fix; the target now consumes the designator
and reports one clear 'must be a plain STRING variable' error.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
Review findings (all reproduced, then fixed and re-verified):
- '^x' leaked as a raw address into any builtin context (s <- ^x printed
the variable's bytes as a C string; NOT ^x, '&', and ^x = ^x compiled).
Address-of is now rejected everywhere except a pointer-typed target.
- A whole-array variable passed the nominal gate as a value of its
ELEMENT type (s <- arrayOfSeason stored the raw data pointer; = on it
emitted invalid IR). Whole arrays are now rejected as operands and as
coercion sources; array parameters are unaffected.
- Enum values smuggled into INTEGER through array subscripts and DECLARE
bounds (a[Autumn], ARRAY[Spring:Winter]); both now go through
emitCoercedExpr like every other INTEGER context.
- An array DECLAREd inside an IF/WHILE/REPEAT/FOR body and used after the
block was a wild-pointer write (constant bounds) or a verifier dump
(runtime bounds). Arrays are now block-scoped: control-flow bodies
snapshot and restore the ArrayTable, so escape is a clean compile error.
- Duplicate parameter names silently shadowed (BYREF write-back defeated);
now a parse error. Trailing comma in parameter lists accepted; now a
parse error consistent with every other list.
- A variable/array/parameter/function could reuse a TYPE name; reserved.
- RETURN with a value inside a PROCEDURE was silently discarded (control
did not return); now an error, as is a bare RETURN in a FUNCTION.
- INPUT r.f mis-parsed into a three-error cascade; now one clear error.
- Assigning to an enum constant now says so instead of 'Unknown variable'.
Docs: ARCH/CONVENTIONS/EXTENDING/SUBSYSTEMS/PITFALLS rewritten for the
TYPE system (ABI additions, nominal-typing invariants, admission-gate
doors, array-parameter ABI, new recipes, new sharp edges); README
features/TODO updated — random files are unblocked.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
- Parameter syntax lands end-to-end: ARRAY OF T (rank 1, bounds travel
with the argument) and ARRAY[l:u,...] OF T (any rank, literal bounds as
a checked contract). Element type and rank must match exactly.
- Flattened ABI: each rank-R array parameter becomes a data pointer plus
kBoundArgsPerDim i64 bounds per dimension. The callee rebuilds
ArrayMetadata from those bounds (ArrayHandler::bindArrayParameter via a
binder callback injected by CodeGen, so FunctionGen stays ignorant of
the array subsystem); the checked-indexing pipeline is reused unchanged.
- BYVAL (the CIE default) copies the whole buffer at callee entry
(malloc+memcpy, never freed — consistent with the string policy) so
callee writes stay invisible; BYREF binds the caller's buffer.
- Bounded-parameter contract: compile-time comparison when the caller's
bounds are constants, else a runtime [Fatal] check
(RuntimeCheck::emitArrayArgBoundsCheck).
- marshalCallArgs gains the array branch and a call-site line number
(CallStmtAST now carries one); whole-array-to-scalar keeps a clear
error, FUNCTION RETURNS ARRAY is a dedicated parse error.
- Verified: BYREF fill/sort-style mutation, BYVAL copy invisibility,
2-D bounded params, ARRAY OF <record> with field writes through the
parameter, bounds-contract mismatches at compile time and run time.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|