[feaLib] Make include()
work like makeotf
This commit is contained in:
parent
78d11e3a0f
commit
75133fc4d1
@ -188,6 +188,7 @@ class Lexer(object):
|
|||||||
class IncludingLexer(object):
|
class IncludingLexer(object):
|
||||||
def __init__(self, featurefile):
|
def __init__(self, featurefile):
|
||||||
self.lexers_ = [self.make_lexer_(featurefile)]
|
self.lexers_ = [self.make_lexer_(featurefile)]
|
||||||
|
self.featurefilepath = self.lexers_[0].filename_
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return self
|
return self
|
||||||
@ -210,7 +211,7 @@ class IncludingLexer(object):
|
|||||||
#semi_type, semi_token, semi_location = lexer.next()
|
#semi_type, semi_token, semi_location = lexer.next()
|
||||||
#if semi_type is not Lexer.SYMBOL or semi_token != ";":
|
#if semi_type is not Lexer.SYMBOL or semi_token != ";":
|
||||||
# raise FeatureLibError("Expected ';'", semi_location)
|
# raise FeatureLibError("Expected ';'", semi_location)
|
||||||
curpath = os.path.dirname(lexer.filename_)
|
curpath = os.path.dirname(self.featurefilepath)
|
||||||
path = os.path.join(curpath, fname_token)
|
path = os.path.join(curpath, fname_token)
|
||||||
if len(self.lexers_) >= 5:
|
if len(self.lexers_) >= 5:
|
||||||
raise FeatureLibError("Too many recursive includes",
|
raise FeatureLibError("Too many recursive includes",
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
I1a
|
I1a
|
||||||
include(include0.fea)
|
include(../include0.fea)
|
||||||
I1b
|
I1b
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
I3a
|
I3a
|
||||||
include(include2.fea);
|
include(inc/include2.fea);
|
||||||
I3b
|
I3b
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user