ThirdParty/Pygments/pygments/lexers/__init__.py

changeset 2426
da76c71624de
parent 1705
b0fbc9300f2b
child 2591
b1c918293219
equal deleted inserted replaced
2425:ace8a08028f3 2426:da76c71624de
3 pygments.lexers 3 pygments.lexers
4 ~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~
5 5
6 Pygments lexers. 6 Pygments lexers.
7 7
8 :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import sys 12 import sys
13 import types 13 import types
111 # the Lexer class. The default implementation returns None which 111 # the Lexer class. The default implementation returns None which
112 # gets turned into 0.0. Run scripts/detect_missing_analyse_text.py 112 # gets turned into 0.0. Run scripts/detect_missing_analyse_text.py
113 # to find lexers which need it overridden. 113 # to find lexers which need it overridden.
114 if code: 114 if code:
115 return cls.analyse_text(code) + bonus 115 return cls.analyse_text(code) + bonus
116 return bonus 116 return cls.priority + bonus
117 117
118 if matches: 118 if matches:
119 matches.sort(key=get_rating) 119 matches.sort(key=get_rating)
120 #print "Possible lexers, after sort:", matches 120 #print "Possible lexers, after sort:", matches
121 return matches[-1][0](**options) 121 return matches[-1][0](**options)

eric ide

mercurial