From 2912052ab44a2fcbf720419df62c4a02c56747b0 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 3 Apr 2020 17:25:06 +0100 Subject: [PATCH] add one to end subscript --- src/soc/decoder/pseudo/parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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]] -- 2.30.2