diff options
author | Sunil Shetye | 2018-06-16 18:58:14 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-16 18:58:14 +0530 |
commit | 3a3e1d6aa7fd38a910a7416040050ffa9550566e (patch) | |
tree | dcc92d9645e3389855686e6356af24cc8160754f /sci2jsyacc.py | |
parent | a208791a02511d50eed1663203ac26eabfdfaa6f (diff) | |
download | sci2js-3a3e1d6aa7fd38a910a7416040050ffa9550566e.tar.gz sci2js-3a3e1d6aa7fd38a910a7416040050ffa9550566e.tar.bz2 sci2js-3a3e1d6aa7fd38a910a7416040050ffa9550566e.zip |
support (a:b) syntax
Diffstat (limited to 'sci2jsyacc.py')
-rwxr-xr-x | sci2jsyacc.py | 5 |
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): |