Don't always output a space after the unary minus, only when necessary.

This commit is contained in:
Sei Lisa 2015-03-28 23:35:08 +01:00
parent 4fbbda60a7
commit 01d8bba3f4

View file

@ -271,9 +271,11 @@ class outscript(object):
lnt = child[0]['nt'] lnt = child[0]['nt']
paren = False paren = False
if nt == 'NEG': if nt == 'NEG':
ret = '- ' ret = '-'
if lnt in self.op_priority: if lnt in self.op_priority:
paren = self.op_priority[lnt] <= self.op_priority['-'] paren = self.op_priority[lnt] <= self.op_priority['-']
elif lnt == 'NEG' or lnt == '--V':
ret += ' ' # don't output -- as that's a different token
else: else:
if lnt in self.op_priority: if lnt in self.op_priority:
paren = True paren = True