Small fixes in fragment parser

This commit is contained in:
rocky
2020-04-21 19:58:03 -04:00
parent 5bd97aa756
commit ab6b12be56
3 changed files with 20 additions and 8 deletions

View File

@@ -1163,6 +1163,7 @@ class FragmentsWalker(pysource.SourceWalker, object):
# modularity is broken here
p_insts = self.p.insts
self.p.insts = self.scanner.insts
self.p.offset2inst_index = self.scanner.offset2inst_index
ast = python_parser.parse(self.p, tokens, customize)
self.p.insts = p_insts
except (python_parser.ParserError, AssertionError) as e:
@@ -1200,10 +1201,11 @@ class FragmentsWalker(pysource.SourceWalker, object):
# modularity is broken here
p_insts = self.p.insts
self.p.insts = self.scanner.insts
self.p.offset2inst_index = self.scanner.offset2inst_index
ast = parser.parse(self.p, tokens, customize)
self.p.insts = p_insts
except (parser.ParserError, AssertionError) as e:
raise ParserError(e, tokens)
raise ParserError(e, tokens, {})
maybe_show_tree(self, ast)