site/node_modules/shiki/dist/langs/cypher.mjs

7 lines
6.9 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Cypher", "fileTypes": ["cql", "cyp", "cypher"], "name": "cypher", "patterns": [{ "include": "#comments" }, { "include": "#constants" }, { "include": "#keywords" }, { "include": "#functions" }, { "include": "#path-patterns" }, { "include": "#operators" }, { "include": "#identifiers" }, { "include": "#properties_literal" }, { "include": "#numbers" }, { "include": "#strings" }], "repository": { "comments": { "patterns": [{ "match": "//.*$\\n?", "name": "comment.line.double-slash.cypher" }] }, "constants": { "patterns": [{ "match": "(?i)\\bTRUE|FALSE\\b", "name": "constant.language.bool.cypher" }, { "match": "(?i)\\bNULL\\b", "name": "constant.language.missing.cypher" }] }, "functions": { "patterns": [{ "comment": "List of Cypher built-in functions from http://docs.neo4j.org/chunked/milestone/query-function.html", "match": "(?i)\\b((NOT)(?=\\s*\\()|IS\\s+NULL|IS\\s+NOT\\s+NULL)", "name": "keyword.control.function.boolean.cypher" }, { "comment": "List of Cypher built-in functions from http://docs.neo4j.org/chunked/milestone/query-function.html", "match": "(?i)\\b(ALL|ANY|NONE|SINGLE)(?=\\s*\\()", "name": "support.function.predicate.cypher" }, { "comment": "List of Cypher built-in functions from http://docs.neo4j.org/chunked/milestone/query-function.html", "match": "(?i)\\b(LENGTH|TYPE|ID|COALESCE|HEAD|LAST|TIMESTAMP|STARTNODE|ENDNODE|TOINT|TOFLOAT)(?=\\s*\\()", "name": "support.function.scalar.cypher" }, { "comment": "List of Cypher built-in functions from http://docs.neo4j.org/chunked/milestone/query-function.html", "match": "(?i)\\b(NODES|RELATIONSHIPS|LABELS|EXTRACT|FILTER|TAIL|RANGE|REDUCE)(?=\\s*\\()", "name": "support.function.collection.cypher" }, { "comment": "List of Cypher built-in functions from http://docs.neo4j.org/chunked/milestone/query-function.html", "match": "(?i)\\b(ABS|ACOS|ASIN|ATAN|ATAN2|COS|COT|DEGREES|E|EXP|FLOOR|HAVERSIN|LOG|LOG10|PI|RADIANS|RAND|ROUND|SIGN|SIN|SQRT|TAN)(?=\\s*\\()", "name": "support.function.math.cypher" }, { "comment": "List of Cypher built-in functions from http://docs.neo4j.org/chunked/milestone/query-function.html", "match": "(?i)\\b(COUNT|sum|avg|max|min|stdev|stdevp|percentileDisc|percentileCont|collect)(?=\\s*\\()", "name": "support.function.aggregation.cypher" }, { "comment": "List of Cypher built-in functions from http://docs.neo4j.org/chunked/milestone/query-function.html", "match": "(?i)\\b(STR|REPLACE|SUBSTRING|LEFT|RIGHT|LTRIM|RTRIM|TRIM|LOWER|UPPER|SPLIT)(?=\\s*\\()", "name": "support.function.string.cypher" }] }, "identifiers": { "patterns": [{ "match": "`.+?`", "name": "variable.other.quoted-identifier.cypher" }, { "match": "[\\p{L}_][\\p{L}0-9_]*", "name": "variable.other.identifier.cypher" }] }, "keywords": { "patterns": [{ "match": "(?i)\\b(START|MATCH|WHERE|RETURN|UNION|FOREACH|WITH|AS|LIMIT|SKIP|UNWIND|HAS|DISTINCT|OPTIONAL\\\\s+MATCH|ORDER\\s+BY|CALL|YIELD)\\b", "name": "keyword.control.clause.cypher" }, { "match": "(?i)\\b(ELSE|END|THEN|CASE|WHEN)\\b", "name": "keyword.control.case.cypher" }, { "match": "(?i)\\b(FIELDTERMINATOR|USING\\s+PERIODIC\\s+COMMIT|HEADERS|LOAD\\s+CSV|FROM)\\b", "name": "keyword.data.import.cypher" }, { "match": "(?i)\\b(USING\\s+INDEX|CREATE\\s+INDEX\\s+ON|DROP\\s+INDEX\\s+ON|CREATE\\s+CONSTRAINT\\s+ON|DROP\\s+CONSTRAINT\\s+ON)\\b", "name": "keyword.other.indexes.cypher" }, { "match": "(?i)\\b(MERGE|DELETE|SET|REMOVE|ON\\s+CREATE|ON\\s+MATCH|CREATE\\s+UNIQUE|CREATE)\\b", "name": "keyword.data.definition.cypher" }, { "match": "(?i)\\b(DESC|ASC)\\b", "name": "keyword.other.order.cypher" }, { "begin": "(?i)\\b(node|relationship|rel)((:)([\\p{L}_-][\\p{L}0-9_]*))?(?=\\s*\\()", "beginCaptures": { "1": { "name": "support.class.starting-functions-point.cypher" }, "2": { "name": "keyword.control.index-seperator.cypher" }, "3": { "name": "keyword.control.index-seperator.cypher" }, "4": { "name": "support.class.index.cypher" } }, "end": "\\)", "name": "source.starting-functions.cypher", "patterns": [{ "match": "((?:`.+?`)|(?:[\\p{L}_][\\p{L}0-9_]*))", "name": "variable.parameter.relationship-name.cyph
var cypher = [
lang
];
export { cypher as default };