1.1 --- a/pyparser/test/test_parser.py Sun Jan 08 21:15:30 2017 +0100
1.2 +++ b/pyparser/test/test_parser.py Sun Jan 08 23:28:19 2017 +0100
1.3 @@ -1,10 +1,10 @@
1.4 # New parser tests.
1.5 import py
1.6 import tokenize
1.7 -import token
1.8 import StringIO
1.9 from pyparser import parser, metaparser, pygram
1.10 from pyparser.test.test_metaparser import MyGrammar
1.11 +from pyparser.pygram import tokens as token
1.12
1.13
1.14 class SimpleParser(parser.Parser):
1.15 @@ -45,10 +45,10 @@
1.16 continue
1.17 data = line.split()
1.18 if data[0].isupper():
1.19 - tp = getattr(token, data[0])
1.20 + tp = token.get(data[0])
1.21 if len(data) == 2:
1.22 value = data[1].strip("\"")
1.23 - elif tp == token.NEWLINE:
1.24 + elif tp == token["NEWLINE"]:
1.25 value = "\n"
1.26 else:
1.27 value = ""