From 2044f888d45f5fdf85a474ea2b237818d0d02db5 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Wed, 9 Sep 2015 04:14:55 +0200 Subject: [PATCH] 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. --- lslopt/lsloutput.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lslopt/lsloutput.py b/lslopt/lsloutput.py index 21a02e3..8f8614c 100644 --- a/lslopt/lsloutput.py +++ b/lslopt/lsloutput.py @@ -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':