From 920c0ba677871c19e85fd2ce8228c2c96593fc52 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Mon, 17 Aug 2026 09:38:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(vast):=20=E4=BF=AE=E5=A4=8D=E5=88=86?= =?UTF-8?q?=E5=8F=B7=E5=88=86=E9=9A=94=E8=AF=AD=E5=8F=A5=E8=AF=AF=E5=B0=86?= =?UTF-8?q?=20AST=20=E8=8A=82=E7=82=B9=E4=BC=A0=E7=BB=99=20=5FFixLoc=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=20AttributeError?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ParseModule/_ParseSuite 的分号分隔分支曾用 stmt 节点调用 _FixLoc, 应传入 Token。改为不补位置(extra 由内部解析器自设位置), 修复 'Assign' object has no attribute 'Line' 崩溃。 --- lib/vast/Parser.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/vast/Parser.py b/lib/vast/Parser.py index 4cd149c..d58bc0c 100644 --- a/lib/vast/Parser.py +++ b/lib/vast/Parser.py @@ -41,7 +41,6 @@ class Parser(ExprParserMixin): if self._At(NEWLINE): break extra: N.stmt = self.ParseStatement() - self._FixLoc(extra, stmt) body.append(extra) self._SkipNEWLINE() module: N.Module = N.Module(body=body, type_ignores=[]) @@ -639,7 +638,6 @@ class Parser(ExprParserMixin): if self._At(NEWLINE): break extra: N.stmt = self.ParseStatement() - self._FixLoc(extra, stmt) body.append(extra) self._SkipNEWLINE() self._Expect(DEDENT)