diff options
author | Brennan Ashton <bashton@brennanashton.com> | 2020-09-02 16:04:56 -0700 |
---|---|---|
committer | Brennan Ashton <bashton@brennanashton.com> | 2020-09-02 16:04:56 -0700 |
commit | 19ad85c5800be2750533753355cf78e9bf48ecf4 (patch) | |
tree | 785aab370089056fa2be1646d1a156ae0b28a716 | |
parent | ceaad0372055ed0064121020fea032fdda429779 (diff) | |
download | pygments-git-19ad85c5800be2750533753355cf78e9bf48ecf4.tar.gz |
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 <bashton@brennanashton.com>
-rw-r--r-- | pygments/lexers/asm.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 = { |