Closed kalapi closed 1 year ago
I think I have a patch for this.
I'm kind of surprised it doesn't work already. It should.
it's because of how inlineclass is defined
Sorry for commenting on this issues but i'm getting the following tracebacks for simple Unicode range glyph selector:
Traceback (most recent call last):
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 414, 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 433, in expand_statements
returned = callback()
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 496, 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 156, in _transform_tree
children = list(self._transform_children(tree.children))
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 146, in _transform_children
res = self._transform_tree(c)
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 156, in _transform_tree
children = list(self._transform_children(tree.children))
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 146, in _transform_children
res = self._transform_tree(c)
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 156, in _transform_tree
children = list(self._transform_children(tree.children))
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 146, in _transform_children
res = self._transform_tree(c)
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 156, in _transform_tree
children = list(self._transform_children(tree.children))
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/lark/visitors.py", line 146, in _transform_children
res = self._transform_tree(c)
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 "unicoderange":
'Token' object has no attribute 'pos_in_stream'
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 403, in parseFile
return self.parseString(data)
File "/Users/UT-development/Documents/_Programming/testing_environments/FEZzing/lib/python3.8/site-packages/fez/__init__.py", line 416, 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/__init__.py", line 571, in unicoderange
return lark.Token("UNICODERANGE", range(_UNICODEGLYPH(args[0].value), _UNICODEGLYPH(args[1].value)+1), args[0].pos_in_stream)
AttributeError: 'Token' object has no attribute 'pos_in_stream'
My input is almost the same as your example in the docs:
DefineClass @defaultNumbers = U+0030=>U+0039;
Looks like you have an old fez; update from this repo? Try pip3 install -U git+https://github.com/googlefonts/fez.git
Hello!
In several Indic (and probably other scripts) the Unicode ranges for a group such as 'all consonants' may not be contiguous.
Would it be possible to introduce multiple Unicode ranges as a single class definition?
Example:
Or is there another way to do this?