diff --git a/ast.py b/ast.py index fee6bdf6ed8391b38d16aef4a991bf13156db13d..49f712a572301ed16d04355c3609a14dc4214271 100644 --- a/ast.py +++ b/ast.py @@ -291,7 +291,7 @@ class LoopOverCoordinate(Node): textwrap.indent(str(self.body), '\t')) def __repr__(self): - return 'loop {!s} from {!s} to {!s} step{!s}'.format(self.loopCounterName, self.start, self.stop, self.step) + return 'loop:{!s} in {!s}:{!s}:{!s}'.format(self.loopCounterName, self.start, self.stop, self.step) class SympyAssignment(Node): diff --git a/backends/dot.py b/backends/dot.py index f9b8e373dc6aa509e4635bcb12c9a343f462fffb..fa0f16ec8e7f182c9bf246286377b36ba6ead5c1 100644 --- a/backends/dot.py +++ b/backends/dot.py @@ -1,5 +1,5 @@ from sympy.printing.printer import Printer -from graphviz import Digraph +from graphviz import Digraph, lang class DotPrinter(Printer): @@ -9,6 +9,7 @@ class DotPrinter(Printer): def __init__(self, **kwargs): super().__init__() self.dot = Digraph(**kwargs) + self.dot.quote_edge = lang.quote def _print_KernelFunction(self, function): self.dot.node(repr(function)) @@ -39,7 +40,7 @@ def dotprint(ast, view=False, **kwargs): Returns a string which can be used to generate a DOT-graph :param ast: The ast which should be generated :param view: Boolen, if rendering of the image directly should occur. - :param kwargs: is directly passed to the DotPrinter class + :param kwargs: is directly passed to the DotPrinter class: http://graphviz.readthedocs.io/en/latest/api.html#digraph :return: string in DOT format """ printer = DotPrinter(**kwargs) diff --git a/backends/llvmbackend.py b/backends/llvm.py similarity index 100% rename from backends/llvmbackend.py rename to backends/llvm.py