diff options
Diffstat (limited to 'pygments/lexers/matlab.py')
-rw-r--r-- | pygments/lexers/matlab.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pygments/lexers/matlab.py b/pygments/lexers/matlab.py index ee85d088..4ff063c2 100644 --- a/pygments/lexers/matlab.py +++ b/pygments/lexers/matlab.py @@ -101,8 +101,8 @@ class MatlabLexer(RegexLexer): # is recognized if it is either surrounded by spaces or by no # spaces on both sides; only the former case matters for us. (This # allows distinguishing `cd ./foo` from `cd ./ foo`.) - (r'(?:^|(?<=;))\s*\w+\s+(?!=|\(|(%s)\s+)' % _operators, Name, - 'commandargs'), + (r'(?:^|(?<=;))(\s*)(\w+)(\s+)(?!=|\(|(%s)\s+)' % _operators, + bygroups(Text, Name, Text), 'commandargs'), # operators: (_operators, Operator), @@ -142,9 +142,10 @@ class MatlabLexer(RegexLexer): (r"[^']*'", String, '#pop'), ], 'commandargs': [ + (r"[ \t]+", Text), ("'[^']*'", String), - ("[^';\n]+", String), - (";?\n?", Punctuation, '#pop'), + (r"[^';\s]+", String), + (";?", Punctuation, '#pop'), ] } |