From a8e5849586f23ffb1ecd2fe47a636b61c80c2e70 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Fri, 15 Jun 2018 17:57:02 +0530 Subject: support second form of exponentiation --- sci2jsyacc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sci2jsyacc.py') diff --git a/sci2jsyacc.py b/sci2jsyacc.py index 1ba1d84b..cff7a331 100755 --- a/sci2jsyacc.py +++ b/sci2jsyacc.py @@ -335,7 +335,13 @@ def p_expression_term_transpose(p): def p_expression_expression_multiplication_expression(p): 'expression : expression MULTIPLICATION expression' - p[0] = str(p[1]) + str(p[2]) + str(p[3]) + if p[2] == '**': + op = '^' + elif p[2] == '\\': + op = '\\' + else: + op = p[2] + p[0] = str(p[1]) + op + str(p[3]) def p_expression_expression_addition_expression(p): 'expression : expression ADDITION expression' -- cgit