1.1 --- a/pyparser/pyparse.py Sun Jan 08 21:15:30 2017 +0100
1.2 +++ b/pyparser/pyparse.py Sun Jan 08 23:28:19 2017 +0100
1.3 @@ -70,9 +70,9 @@
1.4
1.5
1.6 _targets = {
1.7 -'eval' : pygram.syms.eval_input,
1.8 -'single' : pygram.syms.single_input,
1.9 -'exec' : pygram.syms.file_input,
1.10 +'eval' : pygram.syms["eval_input"],
1.11 +'single' : pygram.syms["single_input"],
1.12 +'exec' : pygram.syms["file_input"],
1.13 }
1.14
1.15 class PythonParser(parser.Parser):
1.16 @@ -145,9 +145,9 @@
1.17 # Catch parse errors, pretty them up and reraise them as a
1.18 # SyntaxError.
1.19 new_err = error.IndentationError
1.20 - if tp == pygram.tokens.INDENT:
1.21 + if tp == pygram.tokens["INDENT"]:
1.22 msg = "unexpected indent"
1.23 - elif e.expected == pygram.tokens.INDENT:
1.24 + elif e.expected == pygram.tokens["INDENT"]:
1.25 msg = "expected an indented block"
1.26 else:
1.27 new_err = error.SyntaxError
1.28 @@ -163,7 +163,7 @@
1.29 compile_info.encoding = enc
1.30 # Wrap the tree in a special encoding declaration for parser module
1.31 # compatibility.
1.32 - tree = parser.NonterminalEnc(pygram.syms.encoding_decl, tree, enc)
1.33 + tree = parser.NonterminalEnc(pygram.syms["encoding_decl"], tree, enc)
1.34 return tree
1.35
1.36 def parse(filename):