| 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>
|
|
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>
|
|
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>
|
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
A pseudocode pointer type now counts as a C type, in EXTERN signatures
and as a C-struct field, when it finally points to a non-void C type or a
C struct, as in TYPE PInt = ^C_INT. A pointer cycle such as TYPE P = ^P
and a pointer to a pseudocode type stay rejected.
Co-Authored-By: Claude Opus 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>
|
|
Every EXTERN "C" signature is now arranged by clang's CodeGen
(arrangeFreeFunctionCall) for the host triple and applied by one generic
lowering routine, replacing the hand-written signext/zeroext rule.
clangCodeGen is linked statically into CPSCodeGen. Records still cross
only through pointer types, so generated code is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
A TYPE record whose fields are all C types, C structs or pointer types to
C structs now crosses the EXTERN "C" boundary through a pointer type.
Records by value are rejected for now, and a pointer to a record with a
non-C field names that field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
ParseFunctionBody() scopes the prototype's pack parameters, parses the
body up to ENDFUNCTION/ENDPROCEDURE, reports the same "expected ..."
diagnostic and builds the FunctionDefAST for both declaration forms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Add ParseOptionalCallArgs() for member calls and NEW, diagnoseResultAccess()
for the duplicated "access on a function result" diagnostic, and
isBuiltinTypeToken() for the builtin type keyword list used by template-call
lookahead, cast detection and CASE label scanning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
INPUT targets and identifier expressions now build their legacy
VariableExprAST/ArrayAccessExprAST/DesignatorExprAST node through
makeDesignator(). INPUT still sets the target line explicitly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Move the self-contained arms of ParseStatementImpl into
ParseIncludeOrGlobal, ParseDeleteStmt, ParseInputStmt and
ParseOutputStmt without changing their bodies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
ParseOperatorName() takes an optional int * so callers that ignore the
operator token no longer declare a dummy. The identical identifier-or-
OPERATOR prologues of assignment, identifier-expression and CALL parsing
move into ParseCalleeName().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
getNextToken() now returns void since no caller reads its result, and
GetTokPrecedence() does a single map lookup without the unreachable
non-positive precedence check. Unused <cstdio>, <set> and FunctionAST.h
includes are dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
__cps_file_read and __cps_file_eof both emitted the same mode load,
comparison and ErrNotRead check after the slot lookup; emit it through
FileHandler::emitRequireReadMode instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
importCType is only called from TypeSystem's own methods. declareUserType
now sets IsClass through the entry registerType returns instead of looking
the name up again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Drop the unused TypeInfo::isNumeric, pass emitCheck's format arguments
straight to emitStderr, remove unused <cctype>/<cstdio> includes and
turn always-true trailing operator tests in ArithmeticHandler into plain
returns.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
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>
|
|
DECLARE and array-parameter binding both computed the dimension
multipliers, filled the same ArrayMetadata and stored it in ArrayTable.
Move that into a private ArrayHandler::defineMetadata helper that also
yields the total element count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Move the copy-constructor, operator, MAIN OVERLOAD and reserved, builtin,
enum and type name checks at the start of emitPrototype into a private
validatePrototype helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Make getLLVMType and the link-name emitCall overload private, inline the
single-use GenerateCall helper into that overload, and drop the argument
setName calls in createArgumentAllocas that repeat the names emitPrototype
already assigned. The undefined-function diagnostic stays: a link name can
be shadowed by another module global (e.g. FUNCTION stderr).
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>
|
|
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>
|
|
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>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|