Commit ad7a24c0 authored by Jan Hoenig's avatar Jan Hoenig
Browse files

Fixed pointer str

parent aacddd83
......@@ -14,6 +14,7 @@ class DotPrinter(Printer):
self.dot.quote_edge = lang.quote
def _print_KernelFunction(self, function):
print(self._nodeToStrFunction(function))
self.dot.node(self._nodeToStrFunction(function), style='filled', fillcolor='#E69F00')
self._print(function.body)
......@@ -74,8 +75,7 @@ def dotprint(node, view=False, short=False, full=False, **kwargs):
:param kwargs: is directly passed to the DotPrinter class: http://graphviz.readthedocs.io/en/latest/api.html#digraph
:return: string in DOT format
"""
nodeToStrFunction = __shortened if short else repr
nodeToStrFunction = lambda expr: repr(type(expr)) + repr(expr) if full else nodeToStrFunction
nodeToStrFunction = __shortened if short else lambda expr: repr(type(expr)) + repr(expr) if full else repr
printer = DotPrinter(nodeToStrFunction, full, **kwargs)
dot = printer.doprint(node)
if view:
......
......@@ -303,7 +303,7 @@ class PointerType(Type):
return (self.baseType, self.const, self.restrict) == (other.baseType, other.const, other.restrict)
def __str__(self):
return "%s * %s%s" % (self.baseType, "RESTRICT " if self.restrict else "", "const " if self.const else "")
return "%s *%s%s" % (self.baseType, " RESTRICT " if self.restrict else "", " const " if self.const else "")
def __hash__(self):
return hash(str(self))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment