From ef967c61da13d8c80ff5424fe43c35756928b145 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 22 Jun 2022 15:04:04 +0100 Subject: [PATCH] argh horrible hack that does not work yet for fixing precedence --- src/openpower/decoder/pseudo/parser.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openpower/decoder/pseudo/parser.py b/src/openpower/decoder/pseudo/parser.py index 51fd100a..9b203d44 100644 --- a/src/openpower/decoder/pseudo/parser.py +++ b/src/openpower/decoder/pseudo/parser.py @@ -711,6 +711,11 @@ class PowerParser: p[0] = ast.Call(ast.Name("concat", ast.Load()), l, keywords) else: p[0] = ast.BinOp(p[1], binary_ops[p[2]], p[3]) + # HORRENDOUS hack, add brackets around the bin-op by + # creating a function call with a *blank* function name! + # XXX argh doesn't work because of analysis of + # identify_sint_pattern + #p[0] = ast.Call(ast.Name("", ast.Load()), [p[0]], []) elif len(p) == 3: if isinstance(p[2], str) and p[2] == '-': p[0] = ast.UnaryOp(unary_ops[p[2]], p[1]) -- 2.30.2