summaryrefslogtreecommitdiff
path: root/pygments/lexers/asm.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/asm.py')
-rw-r--r--pygments/lexers/asm.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py
index 3d2933d6..87dcff38 100644
--- a/pygments/lexers/asm.py
+++ b/pygments/lexers/asm.py
@@ -5,7 +5,7 @@
Lexers for assembly languages.
- :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -455,6 +455,10 @@ class NasmLexer(RegexLexer):
filenames = ['*.asm', '*.ASM']
mimetypes = ['text/x-nasm']
+ # Tasm uses the same file endings, but TASM is not as common as NASM, so
+ # we prioritize NASM higher by default
+ priority = 1.0
+
identifier = r'[a-z$._?][\w$.?#@~]*'
hexn = r'(?:0x[0-9a-f]+|$0[0-9a-f]*|[0-9]+[0-9a-f]*h)'
octn = r'[0-7]+q'
@@ -520,6 +524,11 @@ class NasmLexer(RegexLexer):
],
}
+ def analyse_text(text):
+ # Probably TASM
+ if re.match(r'PROC', text, re.IGNORECASE):
+ return False
+
class NasmObjdumpLexer(ObjdumpLexer):
"""
@@ -614,6 +623,11 @@ class TasmLexer(RegexLexer):
],
}
+ def analyse_text(text):
+ # See above
+ if re.match(r'PROC', text, re.I):
+ return True
+
class Ca65Lexer(RegexLexer):
"""