Commits

tvansteenburgh committed 69997f5

Fix bug in GasLexer.analyse_text(). Make sure return val can be cast to float.

  • Participants
  • Parent commits f73bbeb

Comments (0)

Files changed (2)

pygments/lexers/asm.py

     }
 
     def analyse_text(text):
-        return re.match(r'^\.\w+', text, re.M)
+        return bool(re.match(r'^\.\w+', text, re.M))
 
 class ObjdumpLexer(RegexLexer):
     """

tests/test_basic_api.py

                    "%s: %s attribute wrong" % (cls, attr)
         result = cls.analyse_text("abc")
         assert isinstance(result, float) and 0.0 <= result <= 1.0
+        result = cls.analyse_text(".abc")
+        assert isinstance(result, float) and 0.0 <= result <= 1.0
 
         inst = cls(opt1="val1", opt2="val2")
         if issubclass(cls, RegexLexer):