summaryrefslogtreecommitdiff
path: root/sci2jsyacc.py
diff options
context:
space:
mode:
Diffstat (limited to 'sci2jsyacc.py')
-rwxr-xr-xsci2jsyacc.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sci2jsyacc.py b/sci2jsyacc.py
index cc09a5b0..ccb45980 100755
--- a/sci2jsyacc.py
+++ b/sci2jsyacc.py
@@ -477,6 +477,11 @@ def p_term_full_slice_expression(p):
'term : termvar OPENBRACKET COLON COMMA expression CLOSEBRACKET'
p[0] = p[1] + '.slice()[' + str(p[5]) + '-1]'
+# (1:10)
+def p_term_range(p):
+ 'term : OPENBRACKET expression COLON expression CLOSEBRACKET'
+ p[0] = '[%s:%s]' % (p[2], p[4])
+
# B($-2)
# C('function parameter')
def p_term_index(p):