Improve Matlab language detection

This commit is contained in:
Alan Hamlett 2017-06-07 23:32:03 -07:00
parent be80465193
commit 87f205484f
9 changed files with 95 additions and 15 deletions

View file

@ -134,9 +134,9 @@ class MatlabLexer(RegexLexer):
}
def analyse_text(text):
if re.match('^\s*%', text, re.M): # comment
if re.search(r'^\s*%', text, re.M): # comment
return 0.2
elif re.match('^!\w+', text, re.M): # system cmd
elif re.search(r'^!\w+', text, re.M): # system cmd
return 0.2