fix(ast): export/extern 变量 AnnAssign 固定 simple=1,Equal 判定显式 != 0

This commit is contained in:
TermiNexus committed 2026-09-27 17:57:15 +08:00
1 parent f854f7e99a
commit 9011878459
1 file changed
+1 -2
+1 -2
View File
@@ -3912,8 +3912,7 @@ def _parse_export_extern_var(ps: rawptr[Parser]) -> rawptr[AST]:
return None
target: rawptr[AST] = Name(ps.pool, name, ASTCtx.Store)
_set_pos(target, lineno, col, 0, 0)
node: rawptr[AST] = AnnAssign(ps.pool, target, annotation, value,
1 if value is not None else 0)
node: rawptr[AST] = AnnAssign(ps.pool, target, annotation, value, 1)
_set_pos(node, lineno, col, 0, 0)
_skip_nl(ps)
if _cur_type(ps) != TokenType.NewLine and _cur_type(ps) != TokenType.EndMarker: