summaryrefslogtreecommitdiff
path: root/scripts/lib/fontbuild/features.py
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-04-15 14:33:16 -0700
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:35 -0700
commit321c3e351c3c1a9e11fb2b9c2d3bf432608d8774 (patch)
tree16e4517b92582aecc6667f1a1a60690519983e74 /scripts/lib/fontbuild/features.py
parent1f220aa82142f35e7a44c67c9359135fe77d58b6 (diff)
Respond to comments on rc2d741006986.
Diffstat (limited to 'scripts/lib/fontbuild/features.py')
-rwxr-xr-xscripts/lib/fontbuild/features.py11
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]