summaryrefslogtreecommitdiff
path: root/pygments/lexers/other.py
diff options
context:
space:
mode:
authorOldes <oldes.huhuman@gmail.com>2014-05-05 12:18:56 +0200
committerOldes <oldes.huhuman@gmail.com>2014-05-05 12:18:56 +0200
commit55600c9bd9bc0eb85484cc36d5ad93d9a5ce7c04 (patch)
treed625ea39df9ae76d8e6931ddc5598035f038f788 /pygments/lexers/other.py
parent486a5b0eee1d5df81f4eb9adff998f191d48e7c9 (diff)
downloadpygments-55600c9bd9bc0eb85484cc36d5ad93d9a5ce7c04.tar.gz
Comments handling fixed in Red language lexer as well.
Diffstat (limited to 'pygments/lexers/other.py')
-rw-r--r--pygments/lexers/other.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py
index 89c2447e..01c61513 100644
--- a/pygments/lexers/other.py
+++ b/pygments/lexers/other.py
@@ -4343,7 +4343,10 @@ class RedLexer(RegexLexer):
(r'[a-zA-Z]+[^(\^{"\s:)]*://[^(\^{"\s)]*', Name.Decorator), # url
(r'mailto:[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # url
(r'[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # email
- (r'comment\s', Comment, 'comment'),
+ (r'comment\s"', Comment, 'commentString1'),
+ (r'comment\s{', Comment, 'commentString2'),
+ (r'comment\s\[', Comment, 'commentBlock'),
+ (r'comment\s[^(\s{\"\[]+', Comment),
(r'/[^(\^{^")\s/[\]]*', Name.Attribute),
(r'([^(\^{^")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback),
(r'<[a-zA-Z0-9:._-]*>', Name.Tag),
@@ -4398,12 +4401,6 @@ class RedLexer(RegexLexer):
(r'([0-1]\s*){8}', Number.Hex),
(r'}', Number.Hex, '#pop'),
],
- 'comment': [
- (r'"', Comment, 'commentString1'),
- (r'{', Comment, 'commentString2'),
- (r'\[', Comment, 'commentBlock'),
- (r'[^(\s{\"\[]+', Comment, '#pop'),
- ],
'commentString1': [
(r'[^(\^")]+', Comment),
(escape_re, Comment),
@@ -4422,6 +4419,8 @@ class RedLexer(RegexLexer):
'commentBlock': [
(r'\[', Comment, '#push'),
(r'\]', Comment, '#pop'),
- (r'[^(\[\])]+', Comment),
+ (r'"', Comment, "commentString1"),
+ (r'{', Comment, "commentString2"),
+ (r'[^(\[\]\"{)]+', Comment),
],
}