From: Jacob Lifshay Date: Fri, 19 May 2023 06:26:51 +0000 (-0700) Subject: support binary literals with embedded _ (e.g. 0b10_01) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a3b737729b12565c38cb865cf85d32392e70a43;p=openpower-isa.git support binary literals with embedded _ (e.g. 0b10_01) --- diff --git a/src/openpower/decoder/pseudo/lexer.py b/src/openpower/decoder/pseudo/lexer.py index 6cf3020b..d90105e4 100644 --- a/src/openpower/decoder/pseudo/lexer.py +++ b/src/openpower/decoder/pseudo/lexer.py @@ -368,8 +368,9 @@ class PowerLexer: return t def t_BINARY(self, t): - r"""0b[01]+""" - t.value = SelectableInt(int(t.value, 2), len(t.value)-2) + r"""0b[01_]+""" + val = t.value.replace("_", "") + t.value = SelectableInt(int(val, 2), len(val)-2) return t #t_NUMBER = r'\d+'