summaryrefslogtreecommitdiff
path: root/sci2jsyacc.py
diff options
context:
space:
mode:
authorSunil Shetye2018-08-27 16:37:59 +0530
committerSunil Shetye2018-08-27 16:43:40 +0530
commit17a1beeeae647a6fbd0904a5d794ce7754df7eb2 (patch)
tree00fa7aa4da4ae6b663e4c294380b93c1b92af3eb /sci2jsyacc.py
parent8e6c876e5582928ab6909cf0f3529a97f622520d (diff)
downloadsci2js-17a1beeeae647a6fbd0904a5d794ce7754df7eb2.tar.gz
sci2js-17a1beeeae647a6fbd0904a5d794ce7754df7eb2.tar.bz2
sci2js-17a1beeeae647a6fbd0904a5d794ce7754df7eb2.zip
set the initial value of exprs
Diffstat (limited to 'sci2jsyacc.py')
-rwxr-xr-xsci2jsyacc.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sci2jsyacc.py b/sci2jsyacc.py
index 6fb6960e..11ae8506 100755
--- a/sci2jsyacc.py
+++ b/sci2jsyacc.py
@@ -697,6 +697,7 @@ def p_getvalueassignment_getvalue_arguments(p):
lterm = lterm[1:-1]
ltermvars = lterm.split(',')
lastidx = len(ltermvars) - 2
+ exprs = ''
for idx, var in enumerate(ltermvars, -1):
if var[:5] == 'this.':
basevar = var[5:]
@@ -710,7 +711,7 @@ def p_getvalueassignment_getvalue_arguments(p):
if idx == -1:
p[0] = '%*svar %s = true;\n' % (INDENT_LEVEL * INDENT_SIZE, ' ', var)
elif idx == len(ltermvars) - 2:
- pass
+ p[0] += "%*svar %s = [%s];\n" % (INDENT_LEVEL * INDENT_SIZE, ' ', var, exprs[:-2])
else:
vartype = get_var_vartype(basevar, STRING_TYPE)
parsefunction = PARSE_MAP.get(vartype, '')
@@ -718,6 +719,7 @@ def p_getvalueassignment_getvalue_arguments(p):
parsecall = '%s(arguments[%d][\"%s\"])' % (parsefunction, 0, basevar)
else:
parsecall = 'arguments[%d][\"%s\"]' % (0, basevar)
+ exprs += 'arguments[%d][\"%s\"], ' % (0, basevar)
p[0] += "%*s%s = %s;\n" % (INDENT_LEVEL * INDENT_SIZE, ' ', var, parsecall)
if idx < len(LABELS):
if vartype == MATRIX_TYPE: