summaryrefslogtreecommitdiff
path: root/pygments/lexers/graph.py
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2021-12-29 17:00:12 +0100
committerMatthäus G. Chajdas <dev@anteru.net>2021-12-29 17:00:12 +0100
commit2817227fa86f11db389304572e21ecaff37b2226 (patch)
tree0345a2a32a18e8b1df92f124959ca2baaf9fcc7d /pygments/lexers/graph.py
parent7b3692f99d5100dd1471ec37e22e10fa37e54c30 (diff)
downloadpygments-git-2817227fa86f11db389304572e21ecaff37b2226.tar.gz
Use words in Cypher lexer.
Diffstat (limited to 'pygments/lexers/graph.py')
-rw-r--r--pygments/lexers/graph.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/pygments/lexers/graph.py b/pygments/lexers/graph.py
index 163cf804..2af56af2 100644
--- a/pygments/lexers/graph.py
+++ b/pygments/lexers/graph.py
@@ -10,7 +10,7 @@
import re
-from pygments.lexer import RegexLexer, include, bygroups, using, this
+from pygments.lexer import RegexLexer, include, bygroups, using, this, words
from pygments.token import Keyword, Punctuation, Comment, Operator, Name,\
String, Number, Whitespace
@@ -76,11 +76,12 @@ class CypherLexer(RegexLexer):
bygroups(Keyword, Whitespace, Keyword)),
(r'(using)(\s+)(periodic)(\s+)(commit)\b',
bygroups(Keyword, Whitespace, Keyword, Whitespace, Keyword)),
- (r'(all|any|as|asc|ascending|assert|call|case|create|'
- r'delete|desc|descending|distinct|end|fieldterminator|'
- r'foreach|in|limit|match|merge|none|not|null|'
- r'remove|return|set|skip|single|start|then|union|'
- r'unwind|yield|where|when|with)\b', 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),
],
'relations': [
(r'(-\[)(.*?)(\]->)', bygroups(Operator, using(this), Operator)),