20 lines
35 KiB
JavaScript
20 lines
35 KiB
JavaScript
|
import html from './html.mjs';
|
||
|
import sql from './sql.mjs';
|
||
|
import css from './css.mjs';
|
||
|
import c from './c.mjs';
|
||
|
import javascript from './javascript.mjs';
|
||
|
import shellscript from './shellscript.mjs';
|
||
|
|
||
|
const lang = Object.freeze({ "displayName": "Crystal", "fileTypes": ["cr"], "firstLineMatch": "^#!/.*\\bcrystal", "foldingStartMarker": `(?x)^(\\s*+(annotation|module|class|struct|union|enum|def(?!.*\\bend\\s*$)|unless|if|case|begin|for|while|until|^=begin|("(\\\\.|[^"])*+"|'(\\\\.|[^'])*+'|[^#"'])*(\\s(do|begin|case)|(?<!\\$)[-+=&|*/~%^<>~]\\s*+(if|unless)))\\b(?![^;]*+;.*?\\bend\\b)|("(\\\\.|[^"])*+"|'(\\\\.|[^'])*+'|[^#"'])*(\\{(?![^}]*+\\})|\\[(?![^\\]]*+\\]))).*$|[#].*?\\(fold\\)\\s*+$`, "foldingStopMarker": "(?x)((^|;)\\s*+end\\s*+([#].*)?$|(^|;)\\s*+end\\..*$|^\\s*+[}\\]] ,?\\s*+([#].*)?$|[#].*?\\(end\\)\\s*+$|^=end)", "name": "crystal", "patterns": [{ "captures": { "1": { "name": "keyword.control.class.crystal" }, "2": { "name": "keyword.control.class.crystal" }, "3": { "name": "entity.name.type.class.crystal" }, "5": { "name": "punctuation.separator.crystal" }, "6": { "name": "support.class.other.type-param.crystal" }, "7": { "name": "entity.other.inherited-class.crystal" }, "8": { "name": "punctuation.separator.crystal" }, "9": { "name": "punctuation.separator.crystal" }, "10": { "name": "support.class.other.type-param.crystal" }, "11": { "name": "punctuation.definition.variable.crystal" } }, "match": "(?x)^\\s*(abstract)?\\s*(class|struct|union|annotation|enum)\\s+(([.A-Z_:\\x{80}-\\x{10FFFF}][.\\w:\\x{80}-\\x{10FFFF}]*(\\(([,\\s.a-zA-Z0-9_:\\x{80}-\\x{10FFFF}]+)\\))?(\\s*(<)\\s*[.:A-Z\\x{80}-\\x{10FFFF}][.:\\w\\x{80}-\\x{10FFFF}]*(\\(([.a-zA-Z0-9_:]+\\s,)\\))?)?)|((<<)\\s*[.A-Z0-9_:\\x{80}-\\x{10FFFF}]+))", "name": "meta.class.crystal" }, { "captures": { "1": { "name": "keyword.control.module.crystal" }, "2": { "name": "entity.name.type.module.crystal" }, "3": { "name": "entity.other.inherited-class.module.first.crystal" }, "4": { "name": "punctuation.separator.inheritance.crystal" }, "5": { "name": "entity.other.inherited-class.module.second.crystal" }, "6": { "name": "punctuation.separator.inheritance.crystal" }, "7": { "name": "entity.other.inherited-class.module.third.crystal" }, "8": { "name": "punctuation.separator.inheritance.crystal" } }, "match": "^\\s*(module)\\s+(([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))?([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))?([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))*[A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*)", "name": "meta.module.crystal" }, { "captures": { "1": { "name": "keyword.control.lib.crystal" }, "2": { "name": "entity.name.type.lib.crystal" }, "3": { "name": "entity.other.inherited-class.lib.first.crystal" }, "4": { "name": "punctuation.separator.inheritance.crystal" }, "5": { "name": "entity.other.inherited-class.lib.second.crystal" }, "6": { "name": "punctuation.separator.inheritance.crystal" }, "7": { "name": "entity.other.inherited-class.lib.third.crystal" }, "8": { "name": "punctuation.separator.inheritance.crystal" } }, "match": "^\\s*(lib)\\s+(([A-Z]\\w*(::))?([A-Z]\\w*(::))?([A-Z]\\w*(::))*[A-Z]\\w*)", "name": "meta.lib.crystal" }, { "captures": { "1": { "name": "keyword.control.lib.type.crystal" }, "2": { "name": "entity.name.lib.type.crystal" }, "3": { "name": "keyword.control.lib.crystal" }, "4": { "name": "entity.name.lib.type.value.crystal" } }, "comment": "type in lib", "match": "(?<!\\.)\\b(type)\\s+([A-Z]\\w+)\\s*(=)\\s*(.+)", "name": "meta.lib.type.crystal" }, { "comment": "everything being a reserved word, not a value, and needing a 'end' is a..", "match": "(?<!\\.)\\b(fun|begin|case|class|else|elsif|end|ensure|enum|for|if|macro|module|rescue|struct|then|union|unless|until|when|while)\\b(?![?!:])", "name": "keyword.control.crystal" }, { "comment": "everything being a reserved word, not a value, and not needing a 'end' is a..", "match": "(?<!\\.)\\b(abstract|alias|asm|break|extend|in|include|next|of|private|protected|struct|return|select|super|with|yield)\\b(?![?!:])", "name": "keyword.control.primary.crystal" }, { "comment": "everything being a spec keyword, not a value, and needing a block is a..", "match": "(?<!\\.)\\b(describe|context|it|expect_raises)\\b(?![?!:])", "name": "keyword.control.crysta
|
||
|
var crystal = [
|
||
|
...html,
|
||
|
...sql,
|
||
|
...css,
|
||
|
...c,
|
||
|
...javascript,
|
||
|
...shellscript,
|
||
|
lang
|
||
|
];
|
||
|
|
||
|
export { crystal as default };
|