diff options
author | Alastair Houghton <alastair@coriolis-systems.com> | 2013-01-03 12:10:25 +0000 |
---|---|---|
committer | Alastair Houghton <alastair@coriolis-systems.com> | 2013-01-03 12:10:25 +0000 |
commit | e594d501a73f5255db2f919cf841996103b115b4 (patch) | |
tree | a417cf5439e10a26afa46eb13f5b719069d6e216 /pygments/lexers/compiled.py | |
parent | 3c081914779ce96aff16717742f522a50af97c66 (diff) | |
download | pygments-e594d501a73f5255db2f919cf841996103b115b4.tar.gz |
Remove the unnecessary analyse_text methods, reduce the default priorities. Also remove some trailing whitespace and tighten-up a couple of except clauses.
Diffstat (limited to 'pygments/lexers/compiled.py')
-rw-r--r-- | pygments/lexers/compiled.py | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index 5ecc7759..83865e26 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -181,12 +181,7 @@ class CLexer(CFamilyLexer): aliases = ['c'] filenames = ['*.c', '*.h', '*.idc'] mimetypes = ['text/x-chdr', 'text/x-csrc'] - priority = 0.5 - - def analyse_text(text): - # We return 0.5 to allow other C-family languages that use .h files - # to check them to see if they are, in fact, not plain C - return 0.5 + priority = 0.1 class CppLexer(CFamilyLexer): """ @@ -198,8 +193,8 @@ class CppLexer(CFamilyLexer): '*.cc', '*.hh', '*.cxx', '*.hxx', '*.C', '*.H', '*.cp', '*.CPP'] mimetypes = ['text/x-c++hdr', 'text/x-c++src'] - priority = 0.5 - + priority = 0.1 + tokens = { 'statements': [ (r'(asm|catch|const_cast|delete|dynamic_cast|explicit|' @@ -225,11 +220,6 @@ class CppLexer(CFamilyLexer): ], } - def analyse_text(text): - # We return 0.5 to allow other C-family languages that use .h files - # to check them to see if they are, in fact, not plain C++ - return 0.5 - class ECLexer(CLexer): """ For eC source code with preprocessor directives. @@ -263,7 +253,7 @@ class ECLexer(CLexer): (r'\s*(?=>)', Text, '#pop'), ], } - + class DLexer(RegexLexer): """ For D source. @@ -1059,8 +1049,8 @@ class ObjectiveCLexer(objective(CLexer)): aliases = ['objective-c', 'objectivec', 'obj-c', 'objc'] filenames = ['*.m', '*.h'] mimetypes = ['text/x-objective-c'] - priority = 0.25 - + priority = 0.05 # Lower than C + class ObjectiveCppLexer(objective(CppLexer)): """ For Objective-C++ source code with preprocessor directives. @@ -1070,8 +1060,8 @@ class ObjectiveCppLexer(objective(CppLexer)): aliases = ['objective-c++', 'objectivec++', 'obj-c++', 'objc++'] filenames = ['*.mm', '*.hh'] mimetypes = ['text/x-objective-c++'] - priority = 0.25 - + priority = 0.05 # Lower than C++ + class FortranLexer(RegexLexer): """ Lexer for FORTRAN 90 code. |