diff options
author | Yannick Loiseau <me@yloiseau.net> | 2014-04-05 15:16:33 +0200 |
---|---|---|
committer | Yannick Loiseau <me@yloiseau.net> | 2014-04-05 15:16:33 +0200 |
commit | 793975524324df474cfc51a4b3357d14eb92788e (patch) | |
tree | 53eed78b731e30b8e864861d18228c028c8ff396 | |
parent | 9c59d9287fd0d1e5b4cf08ea8deacaf7b60031bc (diff) | |
download | pygments-793975524324df474cfc51a4b3357d14eb92788e.tar.gz |
correctly deal with docstring and - operator
-rw-r--r-- | pygments/lexers/_mapping.py | 1 | ||||
-rw-r--r-- | pygments/lexers/golo.py | 17 |
2 files changed, 5 insertions, 13 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index 669357e0..b90e0d8f 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -128,6 +128,7 @@ LEXERS = { 'GnuplotLexer': ('pygments.lexers.other', 'Gnuplot', ('gnuplot',), ('*.plot', '*.plt'), ('text/x-gnuplot',)), 'GoLexer': ('pygments.lexers.compiled', 'Go', ('go',), ('*.go',), ('text/x-gosrc',)), 'GoloLexer': ('pygments.lexers.golo', 'Golo', ('golo',), ('*.golo',), ()), + 'SimpleMarkdownLexer': ('pygments.lexers.golo', 'Markdown', ('markdown',), ('*.mkd',), ()), 'GoodDataCLLexer': ('pygments.lexers.other', 'GoodData-CL', ('gooddata-cl',), ('*.gdc',), ('text/x-gooddata-cl',)), 'GosuLexer': ('pygments.lexers.jvm', 'Gosu', ('gosu',), ('*.gs', '*.gsx', '*.gsp', '*.vark'), ('text/x-gosu',)), 'GosuTemplateLexer': ('pygments.lexers.jvm', 'Gosu Template', ('gst',), ('*.gst',), ('text/x-gosu-template',)), 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)), - ], - } |