diff options
author | thatch <devnull@localhost> | 2008-07-24 00:08:10 -0700 |
---|---|---|
committer | thatch <devnull@localhost> | 2008-07-24 00:08:10 -0700 |
commit | 8cfba083a1089f25c4e1dc4231275ca3ee5466c9 (patch) | |
tree | f70594fb887609ffa67cc3fe1e107f8948d62054 /pygments/lexers/asm.py | |
parent | 82b1240ed281398d3730551f566a2ac8bf770375 (diff) | |
download | pygments-8cfba083a1089f25c4e1dc4231275ca3ee5466c9.tar.gz |
Fixes for nasm lexer, to close #337:
* add MULTILINE flag so preproc lines starting with `%` work
* be more lenient with trailing whitespace on lines
* test example files from nasm097s
Diffstat (limited to 'pygments/lexers/asm.py')
-rw-r--r-- | pygments/lexers/asm.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py index bbfd5905..fffadcaa 100644 --- a/pygments/lexers/asm.py +++ b/pygments/lexers/asm.py @@ -267,7 +267,7 @@ class NasmLexer(RegexLexer): """ name = 'NASM' aliases = ['nasm'] - filenames = ['*.asm'] + filenames = ['*.asm', '*.ASM'] mimetypes = ['text/x-nasm'] identifier = r'[a-zA-Z$._?][a-zA-Z0-9$._?#@~]*' @@ -285,7 +285,7 @@ class NasmLexer(RegexLexer): directives = (r'BITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|' r'COMMON|CPU|GROUP|UPPERCASE|IMPORT|EXPORT|LIBRARY|MODULE') - flags = re.IGNORECASE + flags = re.IGNORECASE | re.MULTILINE tokens = { 'root': [ include('whitespace'), @@ -319,8 +319,8 @@ class NasmLexer(RegexLexer): ], 'whitespace': [ (r'\n', Text), - (r'\s+', Text), - (r';.*?\n', Comment.Single) + (r'[ \t]+', Text), + (r';.*', Comment.Single) ], 'punctuation': [ (r'[,():\[\]]+', Punctuation), |