diff options
Diffstat (limited to 'pygments')
-rw-r--r-- | pygments/lexers/asm.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py index 75d65f9f..87dcff38 100644 --- a/pygments/lexers/asm.py +++ b/pygments/lexers/asm.py @@ -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): """ |