From e2c65706e61be09ddb7eeb28cd1957acd4317bcf Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 10:09:47 +0000 Subject: feat(constants): implement literal constants with lexical scope Co-Authored-By: Claude Fable 5.1 --- AGENTS/EXTENDING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'AGENTS/EXTENDING.md') diff --git a/AGENTS/EXTENDING.md b/AGENTS/EXTENDING.md index d03c088..5e104c8 100644 --- a/AGENTS/EXTENDING.md +++ b/AGENTS/EXTENDING.md @@ -9,7 +9,8 @@ unique_ptr children, move ctor, raw-ptr getters) → `ParseXxx` in the matching `Parser*.cc` file + branch in `ParseStatementImpl` (block statements parse their body with `ParseBlock({terminator tokens})`; control-flow parsers live in `ParserControlFlow.cc`; comma-separated expression lists use `ParseExprList(close, allowEmpty)`; add the new statement's leading keyword to -`syncToStatementStart`) → `dynamic_cast` branch in `CodeGen::emitStmt`. Guard every +`syncToStatementStart`) → `dynamic_cast` branch in `CodeGen::emitStmt`. Emit statement bodies through `emitScopedBlock` +so constants cannot escape their lexical block. Guard every fall-through branch in control-flow codegen with `if (!Builder->GetInsertBlock()->hasTerminator())` — a RETURN in the body may have already terminated the block. -- cgit v1.3.1-4-g156e