diff --git a/App/lib/core/Gen/Call/CallGenDispatch.vp b/App/lib/core/Gen/Call/CallGenDispatch.vp index 8374e61..6217f5e 100644 --- a/App/lib/core/Gen/Call/CallGenDispatch.vp +++ b/App/lib/core/Gen/Call/CallGenDispatch.vp @@ -232,9 +232,9 @@ novirtual class CallGenDispatch(CallGenBase.CallGenBase): # it is evaluated there and never lowered as a runtime call. self.Gen.TypeGenErr.fatal_error(cl, "defined(NAME) is only valid inside a cif/celif condition; it cannot be used in a normal expression", "NameError") return None - if bare_nm.id is not None and (string.strcmp(bare_nm.id, "CIf") == 0 or string.strcmp(bare_nm.id, "CIfdef") == 0 or string.strcmp(bare_nm.id, "CIfndef") == 0): - # removed spellings (also covered for the bare-name form of c.CIf/c.CIfdef/c.CIfndef) - self.Gen.TypeGenErr.fatal_error(cl, "c.CIf/c.CIfdef/c.CIfndef were removed; use the cif/celif/celse statements and the defined(NAME) predicate instead (e.g. `cif defined(NAME):` ... `celse:` ...)", "NameError") + if bare_nm.id is not None and (string.strcmp(bare_nm.id, "CIf") == 0 or string.strcmp(bare_nm.id, "CIfdef") == 0 or string.strcmp(bare_nm.id, "CIfndef") == 0 or string.strcmp(bare_nm.id, "CElif") == 0 or string.strcmp(bare_nm.id, "CElse") == 0 or string.strcmp(bare_nm.id, "CEndif") == 0): + # removed spellings (also covered for the bare-name form of the c.CIf family) + self.Gen.TypeGenErr.fatal_error(cl, "c.CIf/c.CIfdef/c.CIfndef/c.CElif/c.CElse/c.CEndif were removed; use the cif/celif/celse statements and the defined(NAME) predicate instead (e.g. `cif defined(NAME):` ... `celse:` ...)", "NameError") return None if bare_nm.id is not None and string.strcmp(bare_nm.id, "__asm__") == 0: # translate_c_asm returns None for void output: set the hit flag so translate_call @@ -278,10 +278,10 @@ novirtual class CallGenDispatch(CallGenBase.CallGenBase): elif string.strcmp(func_name, "LInp") == 0 or string.strcmp(func_name, "LOut") == 0: # c.LInp/c.LOut standalone calls return 0 (only meaningful in c.LLVMIR f-strings) return mlirlite.ConstInt(pool, mlirlite.Int32(pool), 0, "0") - elif string.strcmp(func_name, "CIf") == 0 or string.strcmp(func_name, "CIfdef") == 0 or string.strcmp(func_name, "CIfndef") == 0: - # c.CIf/c.CIfdef/c.CIfndef were removed: report the replacement spelling. + elif string.strcmp(func_name, "CIf") == 0 or string.strcmp(func_name, "CIfdef") == 0 or string.strcmp(func_name, "CIfndef") == 0 or string.strcmp(func_name, "CElif") == 0 or string.strcmp(func_name, "CElse") == 0 or string.strcmp(func_name, "CEndif") == 0: + # The c.CIf-family spellings were removed: report the replacement. # (There is no runtime fallback: compile-time conditions use cif/celif/celse.) - self.Gen.TypeGenErr.fatal_error(cl, "c.CIf/c.CIfdef/c.CIfndef were removed; use the cif/celif/celse statements and the defined(NAME) predicate instead (e.g. `cif defined(NAME):` ... `celse:` ...)", "NameError") + self.Gen.TypeGenErr.fatal_error(cl, "c.CIf/c.CIfdef/c.CIfndef/c.CElif/c.CElse/c.CEndif were removed; use the cif/celif/celse statements and the defined(NAME) predicate instead (e.g. `cif defined(NAME):` ... `celse:` ...)", "NameError") return None elif is_coro_mod != 0 and string.strcmp(func_name, "coro_run") == 0: # coro.coro_run(frame): inline translation (resume loop until done, returns the ret slot). diff --git a/App/lib/core/Gen/Expr/ExprGenName.vp b/App/lib/core/Gen/Expr/ExprGenName.vp index 6dfb4ff..c74e3b7 100644 --- a/App/lib/core/Gen/Expr/ExprGenName.vp +++ b/App/lib/core/Gen/Expr/ExprGenName.vp @@ -269,9 +269,9 @@ novirtual class ExprGenName(ExprGenBase.ExprGenBase): # All lookup paths failed: fail-fast (NameError) instead of returning None and crashing # downstream. Exempt keywords/builtins (self/pool/None/_) whose absence is normal. if nm_id is None: return None - if string.strcmp(nm_id, "CIf") == 0 or string.strcmp(nm_id, "CIfdef") == 0 or string.strcmp(nm_id, "CIfndef") == 0: - # The c.CIf/c.CIfdef/c.CIfndef spellings were removed; report the replacement. - self.Gen.TypeGenErr.fatal_error(node, "c.CIf/c.CIfdef/c.CIfndef were removed; use the cif/celif/celse statements and the defined(NAME) predicate instead (e.g. `cif defined(NAME):` ... `celse:` ...)", "NameError") + if string.strcmp(nm_id, "CIf") == 0 or string.strcmp(nm_id, "CIfdef") == 0 or string.strcmp(nm_id, "CIfndef") == 0 or string.strcmp(nm_id, "CElif") == 0 or string.strcmp(nm_id, "CElse") == 0 or string.strcmp(nm_id, "CEndif") == 0: + # The c.CIf-family spellings were removed; report the replacement. + self.Gen.TypeGenErr.fatal_error(node, "c.CIf/c.CIfdef/c.CIfndef/c.CElif/c.CElse/c.CEndif were removed; use the cif/celif/celse statements and the defined(NAME) predicate instead (e.g. `cif defined(NAME):` ... `celse:` ...)", "NameError") return None if string.strcmp(nm_id, "self") == 0 or string.strcmp(nm_id, "pool") == 0 or string.strcmp(nm_id, "true") == 0 or string.strcmp(nm_id, "false") == 0 or string.strcmp(nm_id, "None") == 0 or string.strcmp(nm_id, "match") == 0 or string.strcmp(nm_id, "_") == 0: return None diff --git a/App/lib/core/Gen/Stmt/StmtGenCifMixin.vp b/App/lib/core/Gen/Stmt/StmtGenCifMixin.vp index cb49156..d415dc8 100644 --- a/App/lib/core/Gen/Stmt/StmtGenCifMixin.vp +++ b/App/lib/core/Gen/Stmt/StmtGenCifMixin.vp @@ -18,15 +18,15 @@ import lib.core.Gen.GenApi as GenApi # ============================================================ -# StmtGenCifMixin - compile-time CIf eval + NewXxxHandle factory +# StmtGenCifMixin - compile-time cif eval + NewXxxHandle factory # ============================================================ -# StmtGenCifMixin - CIf eval + factory (lowest base class) +# StmtGenCifMixin - cif eval + factory (lowest base class) novirtual class StmtGenCifMixin: - """Compile-time CIf evaluation and NewXxxHandle factory (lowest base class).""" + """Compile-time cif evaluation and NewXxxHandle factory (lowest base class).""" - # --- compile-time CIf eval state (was HandlesIf._g_cif_eval_ok) --- + # --- compile-time cif eval state (was HandlesIf._g_cif_eval_ok) --- # use 8-byte type: Mixin standalone and Generator composite layouts must align Gen: Generator.Generator* CifEvalOk: sizet @@ -39,7 +39,7 @@ novirtual class StmtGenCifMixin: DiagStmtCount: int # ============================================================ - # Cluster B: compile-time CIf macro eval (migrated from HandlesIf.vp) + # Cluster B: compile-time cif macro eval (migrated from HandlesIf.vp) def _is_cif_attr(self, attr: str) -> int: """Check the internal cif marker attribute name produced by the parser (c.@CIf family). @@ -54,7 +54,7 @@ novirtual class StmtGenCifMixin: return 0 def _is_cif_call(self, node: ast.AST*) -> int: - """Check whether test is a c.CIf-family call (or a bare CIf-family call).""" + """Check whether test is a cif marker call (c.@CIf family, or a bare @CIf-family name).""" if node is None or node.kind() != ast.ASTKind.Call: return 0 cl: ast.Call* = ast.Call*(node) if cl.func is None: return 0