diff options
author | Georg Brandl <georg@python.org> | 2013-01-09 14:04:54 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-01-09 14:04:54 +0100 |
commit | 9cc134d20b8505b6d472cca6872406dbecf5fda3 (patch) | |
tree | 773193024f85183f92d1ee4e32fe7a2b5ea70349 /pygments/lexers/asm.py | |
parent | 2867cf9479652aebd216e0c081e14bdc9aa4897b (diff) | |
parent | 0b03ce73a68bc794d4891b3cbbc581c7ccf3e03a (diff) | |
download | pygments-9cc134d20b8505b6d472cca6872406dbecf5fda3.tar.gz |
Merged in blackjack/pygments-main (pull request #88: CBM BASIC V2 and ca65 assembler)
Diffstat (limited to 'pygments/lexers/asm.py')
-rw-r--r-- | pygments/lexers/asm.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py index aebe74f5..5f1d808a 100644 --- a/pygments/lexers/asm.py +++ b/pygments/lexers/asm.py @@ -5,7 +5,7 @@ Lexers for assembly languages. - :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -240,8 +240,8 @@ class LlvmLexer(RegexLexer): r'|linkonce_odr|weak|weak_odr|appending|dllimport|dllexport' r'|common|default|hidden|protected|extern_weak|external' r'|thread_local|zeroinitializer|undef|null|to|tail|target|triple' - r'|deplibs|datalayout|volatile|nuw|nsw|exact|inbounds|align' - r'|addrspace|section|alias|module|asm|sideeffect|gc|dbg' + r'|datalayout|volatile|nuw|nsw|nnan|ninf|nsz|arcp|fast|exact|inbounds' + r'|align|addrspace|section|alias|module|asm|sideeffect|gc|dbg' r'|ccc|fastcc|coldcc|x86_stdcallcc|x86_fastcallcc|arm_apcscc' r'|arm_aapcscc|arm_aapcs_vfpcc' @@ -359,16 +359,19 @@ class NasmLexer(RegexLexer): ], } + class Ca65Lexer(RegexLexer): """ For ca65 assembler sources. + + *New in Pygments 1.6.* """ name = 'ca65' aliases = ['ca65'] filenames = ['*.s'] - + flags = re.IGNORECASE - + tokens = { 'root': [ (r';.*', Comment.Single), @@ -388,3 +391,8 @@ class Ca65Lexer(RegexLexer): (r'[\w.@$][\w.@$\d]*', Name), ] } + + def analyse_text(self, text): + # comments in GAS start with "#" + if re.match(r'^\s*;', text, re.MULTILINE): + return 0.9 |