summaryrefslogtreecommitdiff
path: root/pygments/lexers/webmisc.py
diff options
context:
space:
mode:
authorjiyinyiyong <jiyinyiyong@gmail.com>2015-11-24 17:42:57 +0800
committerjiyinyiyong <jiyinyiyong@gmail.com>2015-11-24 17:42:57 +0800
commit174e34b3cf0736e1bf8134adaed567a5c56d131f (patch)
tree3e96953f28efd321a94d250078e790ae06046aae /pygments/lexers/webmisc.py
parent2b910cf6b576321b1261379ca2be2d2f19d88ae1 (diff)
downloadpygments-174e34b3cf0736e1bf8134adaed567a5c56d131f.tar.gz
Cirru update, on dollar in variables
Diffstat (limited to 'pygments/lexers/webmisc.py')
-rw-r--r--pygments/lexers/webmisc.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/pygments/lexers/webmisc.py b/pygments/lexers/webmisc.py
index def11dba..a18d2b09 100644
--- a/pygments/lexers/webmisc.py
+++ b/pygments/lexers/webmisc.py
@@ -437,7 +437,7 @@ class XQueryLexer(ExtendedRegexLexer):
# Marklogic specific type?
(r'(processing-instruction)(\s*)(\()',
bygroups(Keyword, Text, Punctuation),
- ('occurrenceindicator', 'kindtestforpi')),
+ ('occurrenceindicator', 'kindtestforpi')),
(r'(item)(\s*)(\()(\s*)(\))(?=[*+?])',
bygroups(Keyword, Text, Punctuation, Text, Punctuation),
'occurrenceindicator'),
@@ -833,10 +833,11 @@ class CirruLexer(RegexLexer):
Syntax rules of Cirru can be found at:
http://cirru.org/
- * using ``()`` to markup blocks, but limited in the same line
- * using ``""`` to markup strings, allow ``\`` to escape
- * using ``$`` as a shorthand for ``()`` till indentation end or ``)``
- * using indentations for create nesting
+ * using ``()`` for expressions, but restricted in a same line
+ * using ``""`` for strings, with ``\`` for escaping chars
+ * using ``$`` as folding operator
+ * using ``,`` as unfolding operator
+ * using indentations for nested blocks
.. versionadded:: 2.0
"""
@@ -857,16 +858,16 @@ class CirruLexer(RegexLexer):
(r'.', String.Escape, '#pop'),
],
'function': [
+ (r'\,', Operator, '#pop'),
(r'[^\s"()]+', Name.Function, '#pop'),
(r'\)', Operator, '#pop'),
(r'(?=\n)', Text, '#pop'),
(r'\(', Operator, '#push'),
(r'"', String, ('#pop', 'string')),
(r'[ ]+', Text.Whitespace),
- (r'\,', Operator, '#pop'),
],
'line': [
- (r'\$', Operator, 'function'),
+ (r'(?<!\w)\$(?!\w)', Operator, 'function'),
(r'\(', Operator, 'function'),
(r'\)', Operator),
(r'\n', Text, '#pop'),