Beispiel #1
0
 def _add_annotations(
         self,
         w: FunctionalWriter,
         f: Callable[[], FunctionalWriter] = None) -> FunctionalWriter:
     """
     Emit annotations at the beginnng of a functional declaration.  On entry, we've emitted "Func(" and
     need to emit zero or more "    Annotation( ... )" entries - one for each annotation
     :param w: FunctionalWriter to append output to
     :param f: function to generate everything within "func" after the annotations
     :return: FunctionalWriter instance
     """
     if self.annotations:
         w.br()
         w.iter(self.annotations, indent=False)
         w.br().indent()
     f()
     if self.annotations:
         w.outdent()
     return w
Beispiel #2
0
 def to_functional(self, wr: FunctionalWriter) -> FunctionalWriter:
     return wr.iter(self.v, f=lambda e:  wr.hardbr() + e)
Beispiel #3
0
 def to_functional(self, wr: FunctionalWriter) -> FunctionalWriter:
     return wr.iter(self.v1)
Beispiel #4
0
 def to_functional(self, w: FunctionalWriter) -> FunctionalWriter:
     return w.func(self, lambda: w.iter(self.objectPropertyExpressions))
Beispiel #5
0
 def to_functional(self, w: FunctionalWriter) -> FunctionalWriter:
     self.list_cardinality(self.dataPropertyExpressions, 'exprs', 2)
     return self.annots(w, lambda: w.iter(self.dataPropertyExpressions))
Beispiel #6
0
 def to_functional(self, w: FunctionalWriter) -> FunctionalWriter:
     return w.iter(self.as_prefixes(), indent=False)
Beispiel #7
0
 def to_functional(self, w: FunctionalWriter) -> FunctionalWriter:
     return w.func(self, lambda: w.iter(self.literal))
Beispiel #8
0
 def to_functional(self, w: FunctionalWriter) -> FunctionalWriter:
     self.list_cardinality(self.dataRanges, 'dataRange', 2)
     return w.func(self, lambda: w.iter(self.dataRanges))