| Age | Commit message (Collapse) | Author |
|
Keep double-quoted literals and text constants as C_STRING values. Use
marked STRING constructors for text and CHAR conversion, preserving
string operations and I/O through the existing class machinery.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
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>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
|
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>
|
|
A variadic EXTERN call is now arranged by clang per call, from the fixed
parameter count and the promoted argument types. C-struct records pass
unchanged in variadic positions, as C11 6.5.2.2p6-7 and 7.16.1.1p2
allow; a record that is not a C struct names the offending field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Move the self-contained FunctionDef, INPUT, OUTPUT and READFILE branches
of emitStmtImpl into private emitFunctionDefStmt, emitInputStmt,
emitOutputStmt and emitReadFileStmt methods. The dispatch order and the
branch bodies are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
emitLValue (variable and designator base) and plain assignment repeated
the same lookup, enum-or-unknown diagnostic and requireWritable check.
Move it into a private lookupWritableSymbol helper. READFILE keeps its
own lookup, which has no enum diagnostic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
copyClassValue, emitConstruct and emitStringFromCString each walked the
record fields and default-constructed those that need it. Move the loop
into a private emitFieldDefaults helper; each caller passes the same line
as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
EOF, OPENFILE, READFILE and CLOSEFILE each rejected a whole-array filename
and then emitted it as a C string. Route them through a private
emitFileNameOperand helper; diagnostics are unchanged. WRITEFILE keeps its
own combined check.
Co-Authored-By: Claude Opus 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>
|
|
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>
|
|
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>
|
|
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>
|
|
Resolve exact operand types and preserve declared operator return types.
Reject implicit STRING to BOOLEAN conversion at typed expression boundaries.
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>
|
|
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>
|
|
Retain parameter source lines for warnings and preserve field access
prefix validation when distinguishing fields from methods.
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>
|
|
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>
|
|
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>
|
|
Add EMBEDDED mode to run generated modules in-process without lli or PATH
lookup. Link LLVM and support archives plus the C++ runtime statically,
while retaining the system C runtime on Linux.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Fable 5.1 <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>
|
|
- New CodeGen::emitLValue resolves any designator โ variable, checked
array element, record field chain (CreateStructGEP via the record
payload), pointer deref (with the null-pointer [Fatal] check) โ to an
address + type name; loadFromLValue centralizes the rvalue read and the
STRING null->"" guard, so zero-initialized STRING fields read as "".
- Designator assignment stores through emitLValue + emitCoercedExpr;
whole-record copies (r2 <- r1, array elements, BYVAL args, RETURN) are
aggregate loads/stores with name-checked admission.
- getExprTypeInfo walks designator chains statically (field types from
the record payload, deref to the pointee), so records/pointers type
correctly in every expression context.
- Address-of ^x admits into a pointer target only when the designator's
type name equals the declared pointee exactly (nominal, strict: the
guide's own ^INTEGER-at-a-Season example is a compile error by design);
^arr[i] and ^rec.field work through the same lvalue path.
- Verified: the guide's ยง4.2 StudentRecord example (minus DATE), nested
records, arrays of records with Form[i].YearGroup writes, record
BYREF/BYVAL params, NodePtr = ^Node forward reference with writes
through n1.Next^.Data, unset-pointer deref dying with [Fatal].
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|