Exemple #1
0
 def configure(ctx: PrintContext):
     ctx.state().set_indent_size(1)
Exemple #2
0
 def do_print(self, context: PrintContext) -> str:
     return "{0} {1}: {2};".format(*[
         printer.print(context.create_child())
         for printer in self.children()
     ])
Exemple #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)
Exemple #4
0
 def do_print(self, context: PrintContext) -> str:
     return "\n".join(
         printer.print(context.create_child())
         for printer in self.children())
Exemple #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()))
Exemple #6
0
    def do_print(self, context: PrintContext) -> str:
        block_printer = self.children()[0]

        return block_printer.print(context.create_child())
Exemple #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
     ])
Exemple #8
0
    def do_print(self, context: PrintContext) -> str:
        evaluation_printer = self.children()[0]

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

        return "return {0};".format(eval_printer.print(context.create_child()))
Exemple #10
0
 def do_print(self, context: PrintContext) -> str:
     components = [
         printer.print(context.create_child())
         for printer in self.children()
     ]
     return ", ".join(components)
Exemple #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)