summaryrefslogtreecommitdiff
path: root/sci2jsyacc.py
diff options
context:
space:
mode:
authorSunil Shetye2018-06-29 17:35:45 +0530
committerSunil Shetye2018-06-29 17:35:45 +0530
commit154c6f55d02ccbdd48ee3876e62619de7a3ab997 (patch)
tree6414c3ef348aa2526a0d3166781993062a79623b /sci2jsyacc.py
parent1ffcfaa90ce19fea94a19bfe21b2d6cb86a2c904 (diff)
downloadsci2js-154c6f55d02ccbdd48ee3876e62619de7a3ab997.tar.gz
sci2js-154c6f55d02ccbdd48ee3876e62619de7a3ab997.tar.bz2
sci2js-154c6f55d02ccbdd48ee3876e62619de7a3ab997.zip
handle list separately
Diffstat (limited to 'sci2jsyacc.py')
-rwxr-xr-xsci2jsyacc.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/sci2jsyacc.py b/sci2jsyacc.py
index 6e8c65e2..e8332399 100755
--- a/sci2jsyacc.py
+++ b/sci2jsyacc.py
@@ -461,8 +461,8 @@ def p_assignment_expression(p):
p[0] = '%*s%s %s %s' % (INDENT_LEVEL * INDENT_SIZE, ' ', p[1], p[2], p[3])
def p_getvalueassignment_getvalue(p):
- 'getvalueassignment : lterm ASSIGNMENT SCICOS_GETVALUE OPENBRACKET list CLOSEBRACKET'
- p[0] = '%*s%s %s %s(%s)' % (INDENT_LEVEL * INDENT_SIZE, ' ', p[1], p[2], p[3], p[5])
+ 'getvalueassignment : lterm ASSIGNMENT SCICOS_GETVALUE OPENBRACKET expression COMMA expression COMMA expression COMMA expression CLOSEBRACKET'
+ p[0] = '%*s%s %s %s(%s,%s,%s,%s)' % (INDENT_LEVEL * INDENT_SIZE, ' ', p[1], p[2], p[3], p[5], p[7], p[9], p[11])
lterm = p[1]
if lterm[0] == '[':
lterm = lterm[1:-1]
@@ -824,11 +824,21 @@ def p_term_function_parameters(p):
'term : FUNCTIONNAME OPENBRACKET list CLOSEBRACKET'
p[0] = '%s(%s)' % (p[1], p[3])
+# list(2,3)
+def p_term_list_parameters(p):
+ 'term : LIST OPENBRACKET list CLOSEBRACKET'
+ p[0] = '%s(%s)' % (p[1], p[3])
+
# A()
def p_term_function(p):
'term : FUNCTIONNAME OPENBRACKET CLOSEBRACKET'
p[0] = '%s()' % (p[1])
+# list()
+def p_term_list(p):
+ 'term : LIST OPENBRACKET CLOSEBRACKET'
+ p[0] = '%s()' % (p[1])
+
# $
def p_term_lastindex(p):
'term : LASTINDEX'