googlefonts / fez

Font Engineering made eaZy
BSD 3-Clause "New" or "Revised" License
17 stars 2 forks source link

Traceback when trying to parse `Position` verb #17

Open kalapi opened 1 year ago

kalapi commented 1 year ago

Fez code is as follows:

Feature cpsp {
    Position @cpspContext <2 0 4 0> <<latn/dflt>>;
};

or

Feature cpsp {
    Position @cpspContext <xPlacement=2  xAdvance=4> <<latn/dflt>>;
};

Traceback is:

Traceback (most recent call last):
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 417, in parseString
    rv = self.expand_statements(rv)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 436, in expand_statements
    returned = callback()
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 490, in <lambda>
    verb_ret = (verb, [transformer._THUNK, lambda: transformer.action(ret)])
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/Feature.py", line 65, in action
    statements = self.parser.expand_statements(statements)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 436, in expand_statements
    returned = callback()
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 499, in <lambda>
    verb_ret = (verb, [transformer._THUNK, lambda : transformer.transform(tree) ])
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 161, in transform
    return self._transform_tree(tree)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 157, in _transform_tree
    return self._call_userfunc(tree, children)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 128, in _call_userfunc
    raise VisitError(tree.data, tree, e)
lark.exceptions.VisitError: Error trying to process rule "action":

cannot unpack non-iterable GlyphSelector object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/bin/fez2fea", line 42, in <module>
    p.parseFile(args.fee)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 406, in parseFile
    return self.parseString(data)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 419, in parseString
    raise e.orig_exc
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 124, in _call_userfunc
    return f(children)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/Position.py", line 110, in action
    glyphselector, valuerecord = pair
TypeError: cannot unpack non-iterable GlyphSelector object
kalapi commented 1 year ago

I also tried the following just to test the syntax:

Feature kern {
    Position (A -60) V;
};

And i'm getting the following traceback:

Traceback (most recent call last):
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 417, in parseString
    rv = self.expand_statements(rv)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 436, in expand_statements
    returned = callback()
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 490, in <lambda>
    verb_ret = (verb, [transformer._THUNK, lambda: transformer.action(ret)])
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/Feature.py", line 65, in action
    statements = self.parser.expand_statements(statements)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 436, in expand_statements
    returned = callback()
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 499, in <lambda>
    verb_ret = (verb, [transformer._THUNK, lambda : transformer.transform(tree) ])
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 161, in transform
    return self._transform_tree(tree)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 157, in _transform_tree
    return self._call_userfunc(tree, children)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 128, in _call_userfunc
    raise VisitError(tree.data, tree, e)
lark.exceptions.VisitError: Error trying to process rule "action":

'ScalarOrVariable' object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/bin/fez2fea", line 42, in <module>
    p.parseFile(args.fee)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 406, in parseFile
    return self.parseString(data)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 419, in parseString
    raise e.orig_exc
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 124, in _call_userfunc
    return f(children)
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/Position.py", line 113, in action
    valuerecords.append(makeValueRecord(valuerecord))
  File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/Position.py", line 62, in makeValueRecord
    valuerecord = [v.resolve_as_integer() for v in valuerecord]
TypeError: 'ScalarOrVariable' object is not iterable