Let object tokens repr themselves in the diagram.

master
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
1 changed files with 5 additions and 2 deletions

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