summaryrefslogtreecommitdiff
path: root/pygments/lexers/golo.py
diff options
context:
space:
mode:
authorYannick Loiseau <me@yloiseau.net>2014-04-05 15:16:33 +0200
committerYannick Loiseau <me@yloiseau.net>2014-04-05 15:16:33 +0200
commit793975524324df474cfc51a4b3357d14eb92788e (patch)
tree53eed78b731e30b8e864861d18228c028c8ff396 /pygments/lexers/golo.py
parent9c59d9287fd0d1e5b4cf08ea8deacaf7b60031bc (diff)
downloadpygments-793975524324df474cfc51a4b3357d14eb92788e.tar.gz
correctly deal with docstring and - operator
Diffstat (limited to 'pygments/lexers/golo.py')
-rw-r--r--pygments/lexers/golo.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/pygments/lexers/golo.py b/pygments/lexers/golo.py
index 02fbb5b7..8cf5a398 100644
--- a/pygments/lexers/golo.py
+++ b/pygments/lexers/golo.py
@@ -32,8 +32,10 @@ class GoloLexer(RegexLexer):
(r'#.*$', Comment),
- (r'(\^|\.\.\.|:|\?:|->|==|!=|=|\+|-|\*|%|/|<|<=|>|>=|=|\.)',
+ (r'(\^|\.\.\.|:|\?:|->|==|!=|=|\+|\*|%|/|<|<=|>|>=|=|\.)',
Operator),
+ (r'(?<=[^-])(-)(?=[^-])', Operator),
+
(r'(is|isnt|and|or|not|oftype|in|orIfNull)\b', Operator.Word),
(r'[]{}|(),[]', Punctuation),
@@ -80,7 +82,7 @@ class GoloLexer(RegexLexer):
(r'"""', String, combined('stringescape', 'triplestring')),
(r'"', String, combined('stringescape', 'doublestring')),
(r"'", String, combined('stringescape', 'singlestring')),
- (r'----', String.Doc, 'doc'),
+ (r'----((.|\n)*?)----', String.Doc)
],
@@ -117,15 +119,4 @@ class GoloLexer(RegexLexer):
(r"'", String, '#pop'),
include('string'),
],
- 'doc': [
- (r'----', String.Doc, '#pop'),
- (r'#\s+.*#?$', Generic.Heading),
- (r'##+\s+.*#?$', Generic.Subheading),
- (r'\*[^*]+\*', Generic.Emph),
- (r'_[^_]+_', Generic.Emph),
- (r'\*\*[^*]+\*\*', Generic.Strong),
- (r'__[^_]+__', Generic.Strong),
- #(r'`(.*?)`', using(GoloLexer)),
- ],
-
}