Improve Matlab language detection
This commit is contained in:
parent
be80465193
commit
87f205484f
9 changed files with 95 additions and 15 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue