main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | Prism.languages.cypher = {
|
---|
2 | // https://neo4j.com/docs/cypher-manual/current/syntax/comments/
|
---|
3 | 'comment': /\/\/.*/,
|
---|
4 | 'string': {
|
---|
5 | pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/,
|
---|
6 | greedy: true
|
---|
7 | },
|
---|
8 | 'class-name': {
|
---|
9 | pattern: /(:\s*)(?:\w+|`(?:[^`\\\r\n])*`)(?=\s*[{):])/,
|
---|
10 | lookbehind: true,
|
---|
11 | greedy: true
|
---|
12 | },
|
---|
13 | 'relationship': {
|
---|
14 | pattern: /(-\[\s*(?:\w+\s*|`(?:[^`\\\r\n])*`\s*)?:\s*|\|\s*:\s*)(?:\w+|`(?:[^`\\\r\n])*`)/,
|
---|
15 | lookbehind: true,
|
---|
16 | greedy: true,
|
---|
17 | alias: 'property'
|
---|
18 | },
|
---|
19 | 'identifier': {
|
---|
20 | pattern: /`(?:[^`\\\r\n])*`/,
|
---|
21 | greedy: true
|
---|
22 | },
|
---|
23 |
|
---|
24 | 'variable': /\$\w+/,
|
---|
25 |
|
---|
26 | // https://neo4j.com/docs/cypher-manual/current/syntax/reserved/
|
---|
27 | 'keyword': /\b(?:ADD|ALL|AND|AS|ASC|ASCENDING|ASSERT|BY|CALL|CASE|COMMIT|CONSTRAINT|CONTAINS|CREATE|CSV|DELETE|DESC|DESCENDING|DETACH|DISTINCT|DO|DROP|ELSE|END|ENDS|EXISTS|FOR|FOREACH|IN|INDEX|IS|JOIN|KEY|LIMIT|LOAD|MANDATORY|MATCH|MERGE|NODE|NOT|OF|ON|OPTIONAL|OR|ORDER(?=\s+BY)|PERIODIC|REMOVE|REQUIRE|RETURN|SCALAR|SCAN|SET|SKIP|START|STARTS|THEN|UNION|UNIQUE|UNWIND|USING|WHEN|WHERE|WITH|XOR|YIELD)\b/i,
|
---|
28 |
|
---|
29 | 'function': /\b\w+\b(?=\s*\()/,
|
---|
30 |
|
---|
31 | 'boolean': /\b(?:false|null|true)\b/i,
|
---|
32 | 'number': /\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/,
|
---|
33 | // https://neo4j.com/docs/cypher-manual/current/syntax/operators/
|
---|
34 | 'operator': /:|<--?|--?>?|<>|=~?|[<>]=?|[+*/%^|]|\.\.\.?/,
|
---|
35 | 'punctuation': /[()[\]{},;.]/
|
---|
36 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.