Let object tokens repr themselves in the diagram.

This commit is contained in:
voussoir 2022-03-14 15:30:46 -07:00
parent ed952ffdda
commit 0fd09984bc
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -225,8 +225,11 @@ class ExpressionTree:
if self.token is None:
return '""'
t = self.token
if ' ' in t:
t = f'"{t}"'
if isinstance(t, str):
if ' ' in t:
t = f'"{t}"'
else:
t = repr(t)
output = t
indent = 1