Issue #704 resolved

Bad GasLexer causes guess_lexer to fail

eddiec
created an issue

The current analyse_text method of GasLexer mistakenly returns a regular expression and causes guess_lexer to fail:

{{{

!python

from pygments.lexers import guess_lexer guess_lexer('.code {}') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/caoyi3/Development/hashdown/venv/lib/python2.6/site-packages/pygments/lexers/init.py", line 199, in guess_lexer rv = lexer.analyse_text(_text) File "/Users/caoyi3/Development/hashdown/venv/lib/python2.6/site-packages/pygments/util.py", line 120, in text_analyse return min(1.0, max(0.0, float(rv))) TypeError: float() argument must be a string or a number }}}

I am including a very simple patch.

Comments (1)

  1. Log in to comment