From 3b9d5ec2df1020266ae236ade5d5c5431c4279dd Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 8 Jun 2021 13:08:18 +0100 Subject: [PATCH] add support in pyparser for negative numbers --- src/openpower/decoder/pseudo/lexer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openpower/decoder/pseudo/lexer.py b/src/openpower/decoder/pseudo/lexer.py index b420798b..aad11a04 100644 --- a/src/openpower/decoder/pseudo/lexer.py +++ b/src/openpower/decoder/pseudo/lexer.py @@ -346,7 +346,7 @@ class PowerLexer: #t_NUMBER = r'\d+' # taken from decmial.py but without the leading sign def t_NUMBER(self, t): - r"""(\d+(\.\d*)?|\.\d+)([eE][-+]? \d+)?""" + r"""[-]?(\d+(\.\d*)?|\.\d+)([eE][-+]? \d+)?""" t.value = int(t.value) return t -- 2.30.2