diff options
author | James Godfrey-Kittle <jamesgk@google.com> | 2015-04-15 14:33:16 -0700 |
---|---|---|
committer | James Godfrey-Kittle <jamesgk@google.com> | 2015-04-16 12:16:35 -0700 |
commit | 321c3e351c3c1a9e11fb2b9c2d3bf432608d8774 (patch) | |
tree | 16e4517b92582aecc6667f1a1a60690519983e74 /scripts/lib/fontbuild/features.py | |
parent | 1f220aa82142f35e7a44c67c9359135fe77d58b6 (diff) |
Respond to comments on rc2d741006986.
Diffstat (limited to 'scripts/lib/fontbuild/features.py')
-rwxr-xr-x | scripts/lib/fontbuild/features.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/lib/fontbuild/features.py b/scripts/lib/fontbuild/features.py index e89b4f3..a527430 100755 --- a/scripts/lib/fontbuild/features.py +++ b/scripts/lib/fontbuild/features.py @@ -91,20 +91,19 @@ class FilterFeatureWriter(FDKSyntaxFeatureWriter): """Use this class for nested expressions e.g. in feature definitions."""
return FilterFeatureWriter(self.refs, name, isFeature)
- def _flattenRefs(self, refs):
+ def _flattenRefs(self, refs, flatRefs):
"""Flatten a list of references."""
- flatRefs = []
for ref in refs:
if type(ref) == list:
- flatRefs.extend(self._flattenRefs(ref))
+ self._flattenRefs(ref, flatRefs)
elif ref != "'": # ignore contextual class markings
flatRefs.append(ref)
- return flatRefs
def _checkRefs(self, refs, errorMsg):
"""Check a list of references found in a sub or pos rule."""
- refs = self._flattenRefs(refs)
- for ref in refs:
+ flatRefs = []
+ self._flattenRefs(refs, flatRefs)
+ for ref in flatRefs:
# trailing apostrophes should be ignored
if ref[-1] == "'":
ref = ref[:-1]
|