From: Luke Kenneth Casson Leighton Date: Tue, 8 Jun 2021 12:08:18 +0000 (+0100) Subject: add support in pyparser for negative numbers X-Git-Tag: xlen-bcd~483 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b9d5ec2df1020266ae236ade5d5c5431c4279dd;p=openpower-isa.git add support in pyparser for negative numbers --- 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