aboutsummaryrefslogtreecommitdiff
path: root/AGENTS/SUBSYSTEMS.md
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-18 06:11:42 +0000
committer_ov4 <ov4@ov4.org>2026-10-18 06:11:42 +0000
commit5a67f4e3833c2acca4a351f5dd613bc08f04bfc0 (patch)
tree6d75f5d13931ba0f7c15d286028049a421a6e974 /AGENTS/SUBSYSTEMS.md
parentb17f101cfc75565f9991c856ec62f1e17b0ab104 (diff)
feat(operators): document overloads and cover remaining operator forms
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>
Diffstat (limited to 'AGENTS/SUBSYSTEMS.md')
-rw-r--r--AGENTS/SUBSYSTEMS.md12
1 files changed, 11 insertions, 1 deletions
diff --git a/AGENTS/SUBSYSTEMS.md b/AGENTS/SUBSYSTEMS.md
index ac31cde..be20bc3 100644
--- a/AGENTS/SUBSYSTEMS.md
+++ b/AGENTS/SUBSYSTEMS.md
@@ -43,6 +43,16 @@ compile error (no extern is fabricated). Functions inherit visible GLOBAL storag
`StmtEmitter` callback, and must restore its own insert point (and the exchanged
ArrayTable) afterwards.
+**Operator overloads** (`OperatorGen.cc`): PrototypeAST retains the operator token;
+FunctionGen validates operand count and requires a record/class/enum operand.
+Global signatures and left-class methods share exact-type selection, used by
+ValueTypeGen and ExpressionGen before builtin operations. Missing candidates leave
+builtin rules intact; ties are errors. Member access is checked after selection.
+The raw-expression argument-marshalling overload borrows AST pointers for operator
+calls; ordinary calls adapt their unique_ptr lists into it. Member receivers use
+lvalue storage or a materialized, Alive-tracked temporary. CASE calls the value
+entry point with its already captured selector and requires BOOLEAN results.
+
**EXTERN "C"** (`ExternDeclAST`, `IncludeObjStmtAST`): the parser builds a body-less
`PrototypeAST` (IsExternal, IsVariadic, unnamed `argN` params). `FunctionGen::emitExternPrototype`
validates C types, records a `FuncSig` with `IsExternal`, the declared `FunctionType` and
@@ -71,7 +81,7 @@ constants live in a TypeSystem-owned table, resolved in `emitExpr`'s
`VariableExprAST` branch after `Symbols` misses. The lvalue layer
(`emitLValue`/`loadFromLValue`) resolves designator chains to `{address, type name}`;
`emitCoercedExpr` is the single name-level admission gate; `emitUserKindBinaryOp`
-intercepts binary operators ahead of ArithmeticHandler (which, like StringHandler and
+intercepts built-in binary operators ahead of ArithmeticHandler (which, like StringHandler and
FileHandler, is deliberately ignorant of user kinds). The enum range check after
`E ± INTEGER` is the only site that can produce an invalid ordinal — every other
producer (constants, same-name copies, zero-init, memset-0 arrays) is valid by