From 4a25b279d8f6c662fa8152cfe42e038d1ea06901 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sun, 26 Jul 2026 12:07:51 +0000 Subject: refactor: keep pseudocode signatures, single call-marshalling path emitPrototype now records each FUNCTION/PROCEDURE's pseudocode signature (FuncSig: return type + per-param type/BYREF flag). CodeGen:: marshalCallArgs replaces the two verbatim-duplicated marshalling blocks and dispatches on the declared signature instead of inferring BYREF from pointer-typed LLVM params: BYVAL STRING params now receive the string data pointer (no more runtime garbage), and BYVAL args are coerced to the declared type (INTEGER->REAL args no longer emit invalid IR). Top-level prototypes are pre-registered in compile(), so calls may precede definitions; GenerateCall no longer fabricates i64 externs for unknown names - an unregistered callee is a compile error. OUTPUT reports an error when it cannot infer the expression type instead of printing with the INTEGER format. Co-Authored-By: Claude Fable 5 --- AGENTS/PITFALLS.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'AGENTS/PITFALLS.md') diff --git a/AGENTS/PITFALLS.md b/AGENTS/PITFALLS.md index b068dee..393f507 100644 --- a/AGENTS/PITFALLS.md +++ b/AGENTS/PITFALLS.md @@ -20,8 +20,7 @@ test programs. bits. - **`getExprTypeInfo` returns nullptr** for expressions it can't classify (null-check it at any new call site) and internally defaults to INTEGER for arithmetic binaries and - unknown-function calls; OUTPUT substitutes INTEGER for a nullptr result — so wrong - inference prints garbage instead of erroring. + unknown-function calls; OUTPUT reports an error for a nullptr result. - The lexer emits no newline tokens; the grammar is purely keyword-delimited. Bare `RETURN` is only recognized right before ENDIF/ELSE/ENDFUNCTION/ENDPROCEDURE. - Invalid modules still print their IR, but `verifyModule` runs at the end of -- cgit v1.3.1-4-g156e