# A place to store the scriptlets.
self.scriptlets = {}
+ def inherit(self, other):
+ DefaultLexer.inherit(self, other)
+
+ # Inherit all scriptlets.
+ self.scriptlets.update(other.scriptlets)
+
@property
def definitions(self):
definitions = {}
return self.get_deps("conflicts")
def get_scriptlet(self, type):
- return self.lexer.scriptlets.get(type, None)
+ scriptlet = self.lexer.scriptlets.get(type, None)
+
+ if scriptlet is None and self.lexer.template:
+ scriptlet = self.lexer.template.scriptlets.get(type, None)
+
+ return scriptlet
@property
def inst_size(self):