From 36f8e8937afff68afad046b39901acdbdea4b226 Mon Sep 17 00:00:00 2001 From: youknowdot Date: Thu, 22 Oct 2026 07:23:49 -0700 Subject: [PATCH] Recover numeric warning errors in AST single mode (#9303) Match ordinary single compilation by allowing later numeric warnings raised as errors to take precedence after a parser-origin escape warning. Preserve tokenizer-origin guards and the separate prompt path. Assisted-by: Codex:unknown --- crates/vm/src/vm/compile.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/vm/src/vm/compile.rs b/crates/vm/src/vm/compile.rs index bfe68e578..f4f0da46b 100644 --- a/crates/vm/src/vm/compile.rs +++ b/crates/vm/src/vm/compile.rs @@ -1983,8 +1983,15 @@ mod escape_warnings { module.map(AsObject::as_object), collected.warnings, WarningEmission::Ast { + // Unlike an interactive prompt, Single compile input recovers + // after a parser warning becomes an error. Later numeric + // tokenizer warnings raised as errors still take precedence, + // including on a following logical line. tokenizer_recovery: collected.tokenizer_recovery - && matches!(start, CompileStart::File | CompileStart::Eval), + && matches!( + start, + CompileStart::File | CompileStart::Eval | CompileStart::Single + ), }, ) }