diff options
-rw-r--r-- | js/Misc/MBLOCK.js | 2 | ||||
-rw-r--r-- | js/Misc/MPBLOCK.js | 2 | ||||
-rwxr-xr-x | sci2jsyacc.py | 10 |
3 files changed, 12 insertions, 2 deletions
diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js index b5741088..5630f8e4 100644 --- a/js/Misc/MBLOCK.js +++ b/js/Misc/MBLOCK.js @@ -1,3 +1,3 @@ -Syntax error in input LexToken(COLON,':',1,14003) +Syntax error in input LexToken(CLOSEOPENBRACKET,')(',1,14999) /* autogenerated from "macros/Misc/MBLOCK.sci" */ None diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index dfd5f058..9ccd9397 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -1,3 +1,3 @@ -Syntax error in input LexToken(COLON,':',1,13483) +Syntax error in input LexToken(CLOSEOPENBRACKET,')(',1,14518) /* autogenerated from "macros/Misc/MPBLOCK.sci" */ None diff --git a/sci2jsyacc.py b/sci2jsyacc.py index 420af69a..a3b3f5d8 100755 --- a/sci2jsyacc.py +++ b/sci2jsyacc.py @@ -558,6 +558,16 @@ def p_term_termfunc_parameter_parameter(p): else: p[0] = '%s(%s)' % (base, p[5]) +# B($-2)(:) +def p_term_termfunc_parameter_slice(p): + 'term : termvar OPENBRACKET expression CLOSEOPENBRACKET COLON CLOSEBRACKET' + if isarray(p[1]): + base = '%s[%s-1]' % (p[1], p[3]) + else: + base = '%s(%s)' % (p[1], p[3]) + addtoarray(base) + p[0] = '%s.slice()' % (base) + # B($-2)('function parameter')(3) def p_term_termfunc_parameter_parameter_parameter(p): 'term : termvar OPENBRACKET expression CLOSEOPENBRACKET expression CLOSEOPENBRACKET expression CLOSEBRACKET' |