semantic: display Types in context pretty-printing
This commit is contained in:
parent
20731d969e
commit
5252f772ed
1 changed files with 5 additions and 1 deletions
|
|
@ -28,7 +28,7 @@ class SymbolABC(abc.ABC):
|
||||||
if self._repr_guard:
|
if self._repr_guard:
|
||||||
return str(self)
|
return str(self)
|
||||||
self._repr_guard = True
|
self._repr_guard = True
|
||||||
definitions = [str(d.location().begin) for d in self.definitions if d is not None]
|
definitions = [str(d.location().begin) for d in self.writes if isinstance(d, nodes.Node)]
|
||||||
self._repr_guard = False
|
self._repr_guard = False
|
||||||
return f"{str(self)} [definitions: {', '.join(definitions)}]"
|
return f"{str(self)} [definitions: {', '.join(definitions)}]"
|
||||||
|
|
||||||
|
|
@ -136,6 +136,10 @@ class Context:
|
||||||
result = [str(self)]
|
result = [str(self)]
|
||||||
if self.parent is not None:
|
if self.parent is not None:
|
||||||
result += [f"\tParent ID: {self.parent.name}"]
|
result += [f"\tParent ID: {self.parent.name}"]
|
||||||
|
if len(self.types) > 0:
|
||||||
|
result += [f"\tTypes ({len(self.types)}):"]
|
||||||
|
for key, value in self.types.items():
|
||||||
|
result += [f"\t\t- {repr(value)}"]
|
||||||
if len(self.variables) > 0:
|
if len(self.variables) > 0:
|
||||||
result += [f"\tVariables ({len(self.variables)}):"]
|
result += [f"\tVariables ({len(self.variables)}):"]
|
||||||
for key, value in self.variables.items():
|
for key, value in self.variables.items():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue