Beispiel #1
0
 def configure(ctx: PrintContext):
     ctx.state().set_indent_size(1)
Beispiel #2
0
 def do_print(self, context: PrintContext) -> str:
     return "{0} {1}: {2};".format(*[
         printer.print(context.create_child())
         for printer in self.children()
     ])
Beispiel #3
0
 def print_fn(printer: Printer, context: PrintContext) -> str:
     components = [
         child.print(context.create_child())
         for child in printer.children()
     ]
     return "\n".join(components)
Beispiel #4
0
 def do_print(self, context: PrintContext) -> str:
     return "\n".join(
         printer.print(context.create_child())
         for printer in self.children())
Beispiel #5
0
    def do_print(self, context: PrintContext) -> str:
        fn_printer, parameter_list_printer = self.children()

        return "{0}({1})".format(
            fn_printer.print(context.create_child()),
            parameter_list_printer.print(context.create_child()))
Beispiel #6
0
    def do_print(self, context: PrintContext) -> str:
        block_printer = self.children()[0]

        return block_printer.print(context.create_child())
Beispiel #7
0
 def do_print(self, context: PrintContext) -> str:
     parameter_printers = self.children()
     return ", ".join([
         printer.print(context.create_child())
         for printer in parameter_printers
     ])
Beispiel #8
0
    def do_print(self, context: PrintContext) -> str:
        evaluation_printer = self.children()[0]

        return evaluation_printer.print(context.create_child())
Beispiel #9
0
    def do_print(self, context: PrintContext) -> str:
        eval_printer = self.children()[0]

        return "return {0};".format(eval_printer.print(context.create_child()))
Beispiel #10
0
 def do_print(self, context: PrintContext) -> str:
     components = [
         printer.print(context.create_child())
         for printer in self.children()
     ]
     return ", ".join(components)
Beispiel #11
0
 def do_print(self, context: PrintContext) -> str:
     components = [
         printer.print(context.create_child())
         for printer in self.children()
     ]
     return "{0}: {1}".format(*components)