fix(vast): 修复分号分隔语句误将 AST 节点传给 _FixLoc 导致 AttributeError
ParseModule/_ParseSuite 的分号分隔分支曾用 stmt 节点调用 _FixLoc, 应传入 Token。改为不补位置(extra 由内部解析器自设位置), 修复 'Assign' object has no attribute 'Line' 崩溃。
This commit is contained in:
1 parent
6fc9e19e24
commit
920c0ba677
1 file changed
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user