diff options
author | Larry Price <larry@industrialintellect.com> | 2013-11-29 20:40:11 -0800 |
---|---|---|
committer | Larry Price <larry@industrialintellect.com> | 2013-11-29 20:40:11 -0800 |
commit | 55aad0042b2430a4ab09a4ed8633a653eb1a66ef (patch) | |
tree | 00818fcc0ed7ecccee0e6098226f65817ce7aa19 | |
parent | d48cb263d74313374737e23edba8c4f3cdf98c11 (diff) | |
download | pygments-55aad0042b2430a4ab09a4ed8633a653eb1a66ef.tar.gz |
added more punctuation. tweaked the keywords to prevent in word matches.
-rw-r--r-- | pygments/lexers/cypher.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pygments/lexers/cypher.py b/pygments/lexers/cypher.py index cbea947a..f996e02b 100644 --- a/pygments/lexers/cypher.py +++ b/pygments/lexers/cypher.py @@ -34,24 +34,27 @@ class CypherLexer(RegexLexer): name = 'Cypher' aliases = ['cypher'] filenames = ['*.cyp','*.cypher'] + flags = re.MULTILINE | re.IGNORECASE tokens = { 'root': [ include('comment'), include('keywords'), include('clauses'), - include('relations') + include('relations'), + include('strings') ], 'comment': [(r'^.*//.*\n', Comment.Single)], 'keywords': [ (r'create|order|match|limit|set|skip|start|return|with|where|delete' - r'|foreach|not|by|as', Keyword)], + r'|foreach|not| by ', Keyword)], 'clauses': [(r' all | any | as | asc |create|create unique|delete|' r'desc |distinct|foreach| in |is null|limit|match|none|' r'order by|return|set|skip|single|start|union|where|with', Keyword)], - 'relations': [(r'-->|-\[.*\]->|<-\[.*\]-|<--', Punctuation), - (r'<|>|<>|=|<=|=>', Operator)] + 'relations': [(r'-->|-\[.*\]->|<-\[.*\]-|<--|\[|\]', Operator), + (r'<|>|<>|=|<=|=>|\(|\)|\||:|,|;', Punctuation)], + 'strings': [(r'\".*\"', String)] } |