Fix bug where (typecast)[single_expr] was output as (typecast)(list)single_expr, producing a syntax error in the output for lack of extra parentheses.

This commit is contained in:
Sei Lisa 2015-09-09 04:14:55 +02:00
parent 6b7b366f63
commit 2044f888d4

View file

@ -262,7 +262,8 @@ class outscript(object):
expr = child[0]
if expr['nt'] in ('CONST', 'IDENT', 'V++', 'V--', 'VECTOR',
'ROTATION', 'LIST', 'FIELD', 'PRINT', 'FNCALL'):
return ret + self.OutExpr(expr)
if expr['nt'] != 'LIST' or len(expr['ch']) != 1:
return ret + self.OutExpr(expr)
return ret + '(' + self.OutExpr(expr) + ')'
if nt == 'LIST':