From 19ad85c5800be2750533753355cf78e9bf48ecf4 Mon Sep 17 00:00:00 2001 From: Brennan Ashton Date: Wed, 2 Sep 2020 16:04:56 -0700 Subject: Add support for ARM constant notation in GAS lexer GNU supports ARM syntax which uses notation like #1 for constants. Currently this is handled like a comment which is incorrect. Take the case of: ldr r0, [r1, #0] Right now the #0] would be treated like a comment and looks very poor. Was referenced in issue #627 Signed-off-by: Brennan Ashton --- pygments/lexers/asm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pygments') diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py index 33d2f05d..d94204b6 100644 --- a/pygments/lexers/asm.py +++ b/pygments/lexers/asm.py @@ -37,7 +37,7 @@ class GasLexer(RegexLexer): string = r'"(\\"|[^"])*"' char = r'[\w$.@-]' identifier = r'(?:[a-zA-Z$_]' + char + r'*|\.' + char + '+)' - number = r'(?:0[xX][a-zA-Z0-9]+|\d+)' + number = r'(?:0[xX][a-fA-F0-9]+|#?-?\d+)' register = '%' + identifier tokens = { -- cgit v1.2.1