summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Lee <anntzer.lee@gmail.com>2019-12-05 15:11:16 +0100
committerAntony Lee <anntzer.lee@gmail.com>2019-12-06 17:50:43 +0100
commited0f3566b4497e76d238f266a8746cd69312abb3 (patch)
tree3cc282632f4fc8214b59ea13bc3353636c0d9fd2
parentfddbfffc7699120d9687d55b5ebd473d8f530ec6 (diff)
downloadpygments-git-ed0f3566b4497e76d238f266a8746cd69312abb3.tar.gz
More fixes to MATLAB lexer.
-rw-r--r--pygments/lexers/matlab.py9
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'),
]
}