Exemplo n.º 1
0
    def index_attributes(self, aa: CAttributes) -> int:
        args = [self.index_attribute(a) for a in aa.get_attributes()]

        def f(index: int, key: Tuple[str, str]) -> CAttributes:
            return CAttributes(self, index, aa.tags, args)

        return self.attributes_table.add(IT.get_key(aa.tags, aa.args), f)
Exemplo n.º 2
0
 def get_value(node: ET.Element) -> CAttributes:
     rep = IT.get_rep(node)
     args = (self,) + rep
     return CAttributes(*args)
Exemplo n.º 3
0
 def ia(attrs: CAttributes) -> List[int]:
     return [] if len(attrs.get_attributes()) == 0 else [self.index_attributes(attrs)]
Exemplo n.º 4
0
 def f(index: int, key: Tuple[str, str]) -> CAttributes:
     return CAttributes(self, index, aa.tags, args)