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

7 lines
16 KiB
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Nix", "fileTypes": ["nix"], "name": "nix", "patterns": [{ "include": "#expression" }], "repository": { "attribute-bind": { "patterns": [{ "include": "#attribute-name" }, { "include": "#attribute-bind-from-equals" }] }, "attribute-bind-from-equals": { "begin": "\\=", "beginCaptures": { "0": { "name": "keyword.operator.bind.nix" } }, "end": "\\;", "endCaptures": { "0": { "name": "punctuation.terminator.bind.nix" } }, "patterns": [{ "include": "#expression" }] }, "attribute-inherit": { "begin": "\\binherit\\b", "beginCaptures": { "0": { "name": "keyword.other.inherit.nix" } }, "end": "\\;", "endCaptures": { "0": { "name": "punctuation.terminator.inherit.nix" } }, "patterns": [{ "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.section.function.arguments.nix" } }, "end": "(?=\\;)", "patterns": [{ "begin": "\\)", "beginCaptures": { "0": { "name": "punctuation.section.function.arguments.nix" } }, "end": "(?=\\;)", "patterns": [{ "include": "#bad-reserved" }, { "include": "#attribute-name-single" }, { "include": "#others" }] }, { "include": "#expression" }] }, { "begin": "(?=[a-zA-Z\\_])", "end": "(?=\\;)", "patterns": [{ "include": "#bad-reserved" }, { "include": "#attribute-name-single" }, { "include": "#others" }] }, { "include": "#others" }] }, "attribute-name": { "patterns": [{ "match": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", "name": "entity.other.attribute-name.multipart.nix" }, { "match": "\\." }, { "include": "#string-quoted" }, { "include": "#interpolation" }] }, "attribute-name-single": { "match": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", "name": "entity.other.attribute-name.single.nix" }, "attrset-contents": { "patterns": [{ "include": "#attribute-inherit" }, { "include": "#bad-reserved" }, { "include": "#attribute-bind" }, { "include": "#others" }] }, "attrset-definition": { "begin": "(?=\\{)", "end": "(?=([\\])};,]|\\b(else|then)\\b))", "patterns": [{ "begin": "(\\{)", "beginCaptures": { "0": { "name": "punctuation.definition.attrset.nix" } }, "end": "(\\})", "endCaptures": { "0": { "name": "punctuation.definition.attrset.nix" } }, "patterns": [{ "include": "#attrset-contents" }] }, { "begin": "(?<=\\})", "end": "(?=([\\])};,]|\\b(else|then)\\b))", "patterns": [{ "include": "#expression-cont" }] }] }, "attrset-definition-brace-opened": { "patterns": [{ "begin": "(?<=\\})", "end": "(?=([\\])};,]|\\b(else|then)\\b))", "patterns": [{ "include": "#expression-cont" }] }, { "begin": "(?=.?)", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.attrset.nix" } }, "patterns": [{ "include": "#attrset-contents" }] }] }, "attrset-for-sure": { "patterns": [{ "begin": "(?=\\brec\\b)", "end": "(?=([\\])};,]|\\b(else|then)\\b))", "patterns": [{ "begin": "\\brec\\b", "beginCaptures": { "0": { "name": "keyword.other.nix" } }, "end": "(?=\\{)", "patterns": [{ "include": "#others" }] }, { "include": "#attrset-definition" }, { "include": "#others" }] }, { "begin": "(?=\\{\\s*(\\}|[^,?]*(=|;)))", "end": "(?=([\\])};,]|\\b(else|then)\\b))", "patterns": [{ "include": "#attrset-definition" }, { "include": "#others" }] }] }, "attrset-or-function": { "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.definition.attrset-or-function.nix" } }, "end": "(?=([\\])};]|\\b(else|then)\\b))", "patterns": [{ "begin": `(?=(\\s*\\}|\\"|\\binherit\\b|\\$\\{|\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*(\\s*\\.|\\s*=[^=])))`, "end": "(?=([\\])};,]|\\b(else|then)\\b))", "patterns": [{ "include": "#attrset-definition-brace-opened" }] }, { "begin": "(?=(\\.\\.\\.|\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*\\s*[,?]))", "end": "(?=([\\])};,]|\\b(else|then)\\b))", "patterns": [{ "include": "#function-definition-brace-opened" }] }, { "include": "#bad-reserved" }, { "begin": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", "beginCaptures": { "0": { "name": "variable.parameter.function.maybe.nix" } }, "end": "(?=([\\])};]|\\b(else|then)\\b))", "patterns": [{ "begin": "(?=\\.)", "end": "(?=([\\])};,]|\\b(else|then)\\b))", "patterns": [{ "include": "#attrset-definition-brace-opened" }] }, { "begin": "\\s*(\\,)"
var nix = [
lang
];
export { nix as default };