From 0fd09984bc9ef1828f24e7a7dd5ea5168fd6c96a Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 14 Mar 2022 15:30:46 -0700 Subject: [PATCH] Let object tokens repr themselves in the diagram. --- voussoirkit/expressionmatch.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/voussoirkit/expressionmatch.py b/voussoirkit/expressionmatch.py index c106a0f..f5cb242 100644 --- a/voussoirkit/expressionmatch.py +++ b/voussoirkit/expressionmatch.py @@ -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