CI failing: test_trivial_read[pattern] raises ParseError: bad token: type=4, value='\n', context=('', (4, 39)) #13
Open
Description
All jobs on https://travis-ci.org/pyga/awpa/builds/573454672 are failing.
__________________________ test_trivial_read[pattern] __________________________
grammar_parts = (<module 'awpa.gram_pattern.token' from '/home/travis/build/pyga/awpa/.tox/py37/lib/python3.7/site-packages/awpa/gram_...ern/token.py'>, <awpa.pgen2.pgen.PgenGrammar object at 0x7ff9af5ae1d0>, <awpa.pygram.Symbols object at 0x7ff9af4c5f98>)
driver = <awpa.pgen2.driver.Driver object at 0x7ff9af4d84a8>
def test_trivial_read(grammar_parts, driver):
token, grammar, symbols = grammar_parts
with io.open(token.__file__.rstrip('co'), encoding='utf-8') as infile:
#tokenize.tokenize(token, infile.readline)
s = infile.read()
> t = driver.parse_string(s)
.tox/py37/lib/python3.7/site-packages/awpa/pygram_test.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py37/lib/python3.7/site-packages/awpa/pgen2/driver.py:111: in parse_string
return self.parse_tokens(tokens, debug)
.tox/py37/lib/python3.7/site-packages/awpa/pgen2/driver.py:75: in parse_tokens
if p.addtoken(type, value, (prefix, start)):
.tox/py37/lib/python3.7/site-packages/awpa/pgen2/parse.py:116: in addtoken
ilabel = self.classify(type, value, context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <awpa.pgen2.parse.Parser object at 0x7ff9af4a6438>, type = 4
value = '\n', context = ('', (4, 39))
def classify(self, type, value, context):
"""Turn a token into a label. (Internal)"""
if type == self.grammar.token.NAME:
# Keep a listing of all used names
self.used_names.add(value)
# Check for reserved words
ilabel = self.grammar.keywords.get(value)
if ilabel is not None:
return ilabel
ilabel = self.grammar.tokens.get(type)
if ilabel is None:
> raise ParseError("bad token", type, value, context)
E awpa.pgen2.parse.ParseError: bad token: type=4, value='\n', context=('', (4, 39))
.tox/py37/lib/python3.7/site-packages/awpa/pgen2/parse.py:172: ParseError
Metadata
Assignees
Labels
No labels