diff options
author | robot-contrib <[email protected]> | 2023-12-09 00:19:25 +0300 |
---|---|---|
committer | robot-contrib <[email protected]> | 2023-12-09 00:50:41 +0300 |
commit | 83b8a2f9228353759e59a093cb3c1270ea2c9d5b (patch) | |
tree | a90f4f91780c0613bea19f33ff8af8e93a335e8b /contrib/python/Pygments/py3/pygments/lexers/graph.py | |
parent | 460528e80f26d04487dc242b7333d45bbeb43a4d (diff) |
Update contrib/python/Pygments/py3 to 2.17.2
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/graph.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/graph.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/graph.py b/contrib/python/Pygments/py3/pygments/lexers/graph.py index 4b043c3ddb0..753df361c85 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/graph.py +++ b/contrib/python/Pygments/py3/pygments/lexers/graph.py @@ -35,16 +35,13 @@ class CypherLexer(RegexLexer): tokens = { 'root': [ - include('comment'), include('clauses'), include('keywords'), include('relations'), include('strings'), include('whitespace'), include('barewords'), - ], - 'comment': [ - (r'^.*//.*$', Comment.Single), + include('comment'), ], 'keywords': [ (r'(create|order|match|limit|set|skip|start|return|with|where|' @@ -76,12 +73,16 @@ class CypherLexer(RegexLexer): bygroups(Keyword, Whitespace, Keyword)), (r'(using)(\s+)(periodic)(\s+)(commit)\b', bygroups(Keyword, Whitespace, Keyword, Whitespace, Keyword)), + (r'(using)(\s+)(index)\b', + bygroups(Keyword, Whitespace, Keyword)), + (r'(using)(\s+)(range|text|point)(\s+)(index)\b', + bygroups(Keyword, Whitespace, Name, Whitespace, Keyword)), (words(( 'all', 'any', 'as', 'asc', 'ascending', 'assert', 'call', 'case', 'create', 'delete', 'desc', 'descending', 'distinct', 'end', 'fieldterminator', 'foreach', 'in', 'limit', 'match', 'merge', 'none', 'not', 'null', 'remove', 'return', 'set', 'skip', 'single', 'start', 'then', 'union', - 'unwind', 'yield', 'where', 'when', 'with'), suffix=r'\b'), Keyword), + 'unwind', 'yield', 'where', 'when', 'with', 'collect'), suffix=r'\b'), Keyword), ], 'relations': [ (r'(-\[)(.*?)(\]->)', bygroups(Operator, using(this), Operator)), @@ -92,7 +93,7 @@ class CypherLexer(RegexLexer): (r'[.*{}]', Punctuation), ], 'strings': [ - (r'"(?:\\[tbnrf\'"\\]|[^\\"])*"', String), + (r'([\'"])(?:\\[tbnrf\'"\\]|[^\\])*?\1', String), (r'`(?:``|[^`])+`', Name.Variable), ], 'whitespace': [ @@ -102,4 +103,7 @@ class CypherLexer(RegexLexer): (r'[a-z]\w*', Name), (r'\d+', Number), ], + 'comment': [ + (r'//.*$', Comment.Single), + ], } |