summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-12-25 11:24:14 +0100
committerGeorg Brandl <georg@python.org>2012-12-25 11:24:14 +0100
commitca69c4d881c5238055ffbbbcc851ce9083692935 (patch)
tree22c85bc5df89be6ea372cd27d0d2948944dcaea0
parente874ba8fafa042242b1a920f483ac566315124ea (diff)
downloadpygments-ca69c4d881c5238055ffbbbcc851ce9083692935.tar.gz
Closes #807: add number tokens to matlab/scilab/octave.
-rw-r--r--pygments/lexers/math.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pygments/lexers/math.py b/pygments/lexers/math.py
index b36e7a7c..5f6bb7c8 100644
--- a/pygments/lexers/math.py
+++ b/pygments/lexers/math.py
@@ -343,6 +343,10 @@ class MatlabLexer(RegexLexer):
# (not great, but handles common cases...)
(r'(?<=[\w\)\]])\'', Operator),
+ (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
+ (r'\d+[eEf][+-]?[0-9]+', Number.Float),
+ (r'\d+', Number.Integer),
+
(r'(?<![\w\)\]])\'', String, 'string'),
('[a-zA-Z_][a-zA-Z0-9_]*', Name),
(r'.', Text),
@@ -789,6 +793,10 @@ class OctaveLexer(RegexLexer):
(r'"[^"]*"', String),
+ (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
+ (r'\d+[eEf][+-]?[0-9]+', Number.Float),
+ (r'\d+', Number.Integer),
+
# quote can be transpose, instead of string:
# (not great, but handles common cases...)
(r'(?<=[\w\)\]])\'', Operator),
@@ -860,6 +868,10 @@ class ScilabLexer(RegexLexer):
(r'(?<=[\w\)\]])\'', Operator),
(r'(?<![\w\)\]])\'', String, 'string'),
+ (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
+ (r'\d+[eEf][+-]?[0-9]+', Number.Float),
+ (r'\d+', Number.Integer),
+
('[a-zA-Z_][a-zA-Z0-9_]*', Name),
(r'.', Text),
],