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) |