summaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py2/pygments/lexers/graph.py
diff options
context:
space:
mode:
authorilezhankin <[email protected]>2022-02-10 16:45:55 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:55 +0300
commit1d125034f06575234f83f24f08677955133f140e (patch)
treeec05fbbd61dc118d5de37f206ab978cff58774bd /contrib/python/Pygments/py2/pygments/lexers/graph.py
parent3a7a498715ef1b66f5054455421b845e45e3a653 (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/Pygments/py2/pygments/lexers/graph.py')
-rw-r--r--contrib/python/Pygments/py2/pygments/lexers/graph.py142
1 files changed, 71 insertions, 71 deletions
diff --git a/contrib/python/Pygments/py2/pygments/lexers/graph.py b/contrib/python/Pygments/py2/pygments/lexers/graph.py
index f7b45e29ee3..86bdf5bff1f 100644
--- a/contrib/python/Pygments/py2/pygments/lexers/graph.py
+++ b/contrib/python/Pygments/py2/pygments/lexers/graph.py
@@ -1,57 +1,57 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.graph
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for graph query languages.
-
+# -*- coding: utf-8 -*-
+"""
+ pygments.lexers.graph
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Lexers for graph query languages.
+
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using, this
-from pygments.token import Keyword, Punctuation, Comment, Operator, Name,\
- String, Number, Whitespace
-
-
-__all__ = ['CypherLexer']
-
-
-class CypherLexer(RegexLexer):
- """
- For `Cypher Query Language
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from pygments.lexer import RegexLexer, include, bygroups, using, this
+from pygments.token import Keyword, Punctuation, Comment, Operator, Name,\
+ String, Number, Whitespace
+
+
+__all__ = ['CypherLexer']
+
+
+class CypherLexer(RegexLexer):
+ """
+ For `Cypher Query Language
<https://neo4j.com/docs/developer-manual/3.3/cypher/>`_
-
+
For the Cypher version in Neo4j 3.3
-
- .. versionadded:: 2.0
- """
- name = 'Cypher'
- aliases = ['cypher']
- filenames = ['*.cyp', '*.cypher']
-
- flags = re.MULTILINE | re.IGNORECASE
-
- tokens = {
- 'root': [
- include('comment'),
- include('keywords'),
- include('clauses'),
- include('relations'),
- include('strings'),
- include('whitespace'),
- include('barewords'),
- ],
- 'comment': [
- (r'^.*//.*\n', Comment.Single),
- ],
- 'keywords': [
- (r'(create|order|match|limit|set|skip|start|return|with|where|'
+
+ .. versionadded:: 2.0
+ """
+ name = 'Cypher'
+ aliases = ['cypher']
+ filenames = ['*.cyp', '*.cypher']
+
+ flags = re.MULTILINE | re.IGNORECASE
+
+ tokens = {
+ 'root': [
+ include('comment'),
+ include('keywords'),
+ include('clauses'),
+ include('relations'),
+ include('strings'),
+ include('whitespace'),
+ include('barewords'),
+ ],
+ 'comment': [
+ (r'^.*//.*\n', Comment.Single),
+ ],
+ 'keywords': [
+ (r'(create|order|match|limit|set|skip|start|return|with|where|'
r'delete|foreach|not|by|true|false)\b', Keyword),
- ],
- 'clauses': [
+ ],
+ 'clauses': [
# based on https://neo4j.com/docs/cypher-refcard/3.3/
(r'(all|any|as|asc|ascending|assert|call|case|create|'
r'create\s+index|create\s+unique|delete|desc|descending|'
@@ -62,24 +62,24 @@ class CypherLexer(RegexLexer):
r'remove|return|set|skip|single|start|starts\s+with|then|union|'
r'union\s+all|unwind|using\s+periodic\s+commit|yield|where|when|'
r'with)\b', Keyword),
- ],
- 'relations': [
- (r'(-\[)(.*?)(\]->)', bygroups(Operator, using(this), Operator)),
- (r'(<-\[)(.*?)(\]-)', bygroups(Operator, using(this), Operator)),
- (r'(-\[)(.*?)(\]-)', bygroups(Operator, using(this), Operator)),
- (r'-->|<--|\[|\]', Operator),
- (r'<|>|<>|=|<=|=>|\(|\)|\||:|,|;', Punctuation),
- (r'[.*{}]', Punctuation),
- ],
- 'strings': [
- (r'"(?:\\[tbnrf\'"\\]|[^\\"])*"', String),
- (r'`(?:``|[^`])+`', Name.Variable),
- ],
- 'whitespace': [
- (r'\s+', Whitespace),
- ],
- 'barewords': [
- (r'[a-z]\w*', Name),
- (r'\d+', Number),
- ],
- }
+ ],
+ 'relations': [
+ (r'(-\[)(.*?)(\]->)', bygroups(Operator, using(this), Operator)),
+ (r'(<-\[)(.*?)(\]-)', bygroups(Operator, using(this), Operator)),
+ (r'(-\[)(.*?)(\]-)', bygroups(Operator, using(this), Operator)),
+ (r'-->|<--|\[|\]', Operator),
+ (r'<|>|<>|=|<=|=>|\(|\)|\||:|,|;', Punctuation),
+ (r'[.*{}]', Punctuation),
+ ],
+ 'strings': [
+ (r'"(?:\\[tbnrf\'"\\]|[^\\"])*"', String),
+ (r'`(?:``|[^`])+`', Name.Variable),
+ ],
+ 'whitespace': [
+ (r'\s+', Whitespace),
+ ],
+ 'barewords': [
+ (r'[a-z]\w*', Name),
+ (r'\d+', Number),
+ ],
+ }