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: if self.token is None:
return '""' return '""'
t = self.token t = self.token
if isinstance(t, str):
if ' ' in t: if ' ' in t:
t = f'"{t}"' t = f'"{t}"'
else:
t = repr(t)
output = t output = t
indent = 1 indent = 1