diff --git a/tools/push3-transpiler/src/transpiler.ts b/tools/push3-transpiler/src/transpiler.ts index 5aae3a3..d6da0de 100644 --- a/tools/push3-transpiler/src/transpiler.ts +++ b/tools/push3-transpiler/src/transpiler.ts @@ -31,15 +31,13 @@ function emit(state: TranspilerState, line: string): void { function dpop(state: TranspilerState, ctx: string): string { const v = state.dStack.pop(); - // Stack underflow → Push3 no-op semantics: treat missing value as 0 - if (v === undefined) return '0'; + if (v === undefined) throw new Error(`DYADIC stack underflow at ${ctx}`); return v; } function bpop(state: TranspilerState, ctx: string): string { const v = state.bStack.pop(); - // Stack underflow → Push3 no-op semantics: treat missing bool as false - if (v === undefined) return 'false'; + if (v === undefined) throw new Error(`BOOLEAN stack underflow at ${ctx}`); return v; }