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
This commit is contained in:
youknowdot authored and GitHub committed 2026-10-22 23:23:49 +09:00
1 parent 6c171fffe1
commit 36f8e8937a
1 file changed
+8 -1
+8 -1
View File
@@ -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
),
},
)
}