Final changes to follow vagueries

This commit is contained in:
Martin Hosken 2017-03-08 16:54:11 +00:00
parent 2972d81d82
commit 5906b5358a
3 changed files with 19 additions and 17 deletions

View File

@ -200,7 +200,7 @@ class IncludingLexer(object):
while self.lexers_:
lexer = self.lexers_[-1]
try:
token_type, token, location = lexer.next()
token_type, token, location = next(lexer)
except StopIteration:
self.lexers_.pop()
continue

View File

@ -1375,7 +1375,7 @@ class Parser(object):
while True:
try:
(self.next_token_type_, self.next_token_,
self.next_token_location_) = self.lexer_.next()
self.next_token_location_) = next(self.lexer_)
except StopIteration:
self.next_token_type_, self.next_token_ = (None, None)
if self.next_token_type_ != Lexer.COMMENT:

View File

@ -140,6 +140,7 @@ class BuilderTest(unittest.TestCase):
fname = (name + ".fea") if '.' not in name else name
temp = parser.ignore_comments
parser.ignore_comments = False
try:
p = parser(self.getpath(fname), glyphMap=font.getReverseGlyphMap())
doc = p.parse()
actual = self.normal_fea(doc.asFea().split("\n"))
@ -156,6 +157,7 @@ class BuilderTest(unittest.TestCase):
sys.stderr.write(line+"\n")
self.fail("Fea2Fea output is different from expected. "
"Generated:\n{}\n".format("\n".join(actual)))
finally:
parser.ignore_comments = temp
def normal_fea(self, lines):