summaryrefslogtreecommitdiff
path: root/pygments/lexers/webmisc.py
diff options
context:
space:
mode:
authorjiyinyiyong <jiyinyiyong@gmail.com>2014-11-04 20:42:45 +0800
committerjiyinyiyong <jiyinyiyong@gmail.com>2014-11-04 20:42:45 +0800
commit972e09563f6cf6817419f6d01295309e1ddda21e (patch)
tree85fc74151f882215a60c95bddff575bb19ab797e /pygments/lexers/webmisc.py
parent3fab67d1733e969bbde92669f7dbf25acfa8d885 (diff)
downloadpygments-972e09563f6cf6817419f6d01295309e1ddda21e.tar.gz
update Cirru tests and rules
Diffstat (limited to 'pygments/lexers/webmisc.py')
-rw-r--r--pygments/lexers/webmisc.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/pygments/lexers/webmisc.py b/pygments/lexers/webmisc.py
index 6dd9cede..a1f0fe93 100644
--- a/pygments/lexers/webmisc.py
+++ b/pygments/lexers/webmisc.py
@@ -795,7 +795,7 @@ class QmlLexer(RegexLexer):
class CirruLexer(RegexLexer):
"""
Syntax rules of Cirru can be found at:
- http://grammar.cirru.org/
+ http://cirru.org/
* using ``()`` to markup blocks, but limited in the same line
* using ``""`` to markup strings, allow ``\`` to escape
@@ -807,7 +807,7 @@ class CirruLexer(RegexLexer):
name = 'Cirru'
aliases = ['cirru']
- filenames = ['*.cirru', '*.cr']
+ filenames = ['*.cirru']
mimetypes = ['text/x-cirru']
flags = re.MULTILINE
@@ -821,30 +821,26 @@ class CirruLexer(RegexLexer):
(r'.', String.Escape, '#pop'),
],
'function': [
- (r'[\w-][^\s\(\)\"]*', Name.Function, '#pop'),
+ (r'[^\s\"\(\)]+', Name.Function, '#pop'),
(r'\)', Operator, '#pop'),
(r'(?=\n)', Text, '#pop'),
(r'\(', Operator, '#push'),
(r'"', String, ('#pop', 'string')),
- (r'\s+', Text.Whitespace),
+ (r'[ ]+', Text.Whitespace),
(r'\,', Operator, '#pop'),
],
'line': [
- (r'^\B', Text.Whitespace, 'function'),
(r'\$', Operator, 'function'),
(r'\(', Operator, 'function'),
(r'\)', Operator),
(r'(?=\n)', Text, '#pop'),
- (r'\n', Text, '#pop'),
(r'"', String, 'string'),
- (r'\s+', Text.Whitespace),
- (r'[\d\.]+', Number),
- (r'[\w-][^\"\(\)\s]*', Name.Variable),
- (r'--', Comment.Single)
+ (r'[ ]+', Text.Whitespace),
+ (r'[\+\-]?[\d\.]+\b', Number),
+ (r'[^\s\"\(\)]+', Name.Variable)
],
'root': [
- (r'^\s*', Text.Whitespace, ('line', 'function')),
- (r'^\s+$', Text.Whitespace),
+ (r'^\n*', Text.Whitespace, ('line', 'function')),
]
}