From: Luke Kenneth Casson Leighton Date: Fri, 3 Apr 2020 16:25:06 +0000 (+0100) Subject: add one to end subscript X-Git-Tag: div_pipeline~1553 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2912052ab44a2fcbf720419df62c4a02c56747b0;p=soc.git add one to end subscript --- diff --git a/src/soc/decoder/pseudo/parser.py b/src/soc/decoder/pseudo/parser.py index 59da968d..ffb8ec0f 100644 --- a/src/soc/decoder/pseudo/parser.py +++ b/src/soc/decoder/pseudo/parser.py @@ -450,7 +450,12 @@ class PowerParser: | test """ if len(p) == 4: - p[0] = [p[1], p[3]] + # add one to end + if isinstance(p[3], ast.Constant): + end = ast.Constant(p[3].value+1) + else: + end = ast.BinOp(p[3], ast.Add(), ast.Constant(1)) + p[0] = [p[1], end] else: p[0] = [p[1]]