[feaLib] Clarify error message for malformed glyph class references
The new message makes clearer what exactly the parser was looking for when processing a glyph class reference.
This commit is contained in:
parent
bb5a7e7caf
commit
4169e584cc
@ -92,8 +92,10 @@ class Parser(object):
|
||||
self.cur_token_location_)
|
||||
result.update(gc.glyphs)
|
||||
else:
|
||||
raise ParserError("Expected glyph name, range, or reference",
|
||||
self.cur_token_location_)
|
||||
raise ParserError(
|
||||
"Expected glyph name, glyph range, "
|
||||
"or glyph class reference",
|
||||
self.cur_token_location_)
|
||||
self.expect_symbol_("]")
|
||||
return result
|
||||
|
||||
|
@ -26,7 +26,8 @@ class ParserTest(unittest.TestCase):
|
||||
|
||||
def test_glyphclass_bad(self):
|
||||
self.assertRaisesRegex(
|
||||
ParserError, "Expected glyph name, range, or reference",
|
||||
ParserError,
|
||||
"Expected glyph name, glyph range, or glyph class reference",
|
||||
self.parse, "@bad = [a 123];")
|
||||
|
||||
def test_glyphclass_duplicate(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user