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

7 lines
5.4 KiB
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Fish", "fileTypes": ["fish"], "firstLineMatch": "^#!.*\\bfish\\b", "foldingStartMarker": "^\\s*(function|while|if|switch|for|begin)\\s.*$", "foldingStopMarker": "^\\s*end\\s*$", "name": "fish", "patterns": [{ "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.fish" } }, "comment": "Double quoted string", "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.fish" } }, "name": "string.quoted.double.fish", "patterns": [{ "include": "#variable" }, { "comment": "https://fishshell.com/docs/current/#quotes", "match": '\\\\(\\"|\\$|$|\\\\)', "name": "constant.character.escape.fish" }] }, { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.fish" } }, "comment": "Single quoted string", "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.fish" } }, "name": "string.quoted.single.fish", "patterns": [{ "comment": "https://fishshell.com/docs/current/#quotes", "match": "\\\\('|`|\\\\)", "name": "constant.character.escape.fish" }] }, { "captures": { "1": { "name": "punctuation.definition.comment.fish" } }, "comment": "line comment", "match": "(?<!\\$)(#)(?!\\{).*$\\n?", "name": "comment.line.number-sign.fish" }, { "captures": { "2": { "name": "keyword.control.fish" }, "4": { "name": "support.function.command.fish" } }, "comment": "name of command, either a function or a binary", "match": "(^\\s*|&&\\s*|\\|\\s*|\\(\\s*|[;]\\s*|\\b(if|while)\\b\\s+)(?!(?<!\\.)\\b(function|while|if|else|switch|case|for|in|begin|end|continue|break|return|source|exit|wait|and|or|not)\\b(?![?!]))([a-zA-Z_\\-0-9\\[\\].]+)" }, { "comment": "keywords that affect control flow", "match": "(?<!\\.)\\b(function|while|if|else|switch|case|for|in|begin|end|continue|break|return|source|exit|wait|and|or|not)\\b(?![?!])", "name": "keyword.control.fish" }, { "match": "(?<!\\.)\\bfunction\\b(?![?!])", "name": "storage.type.fish" }, { "match": "\\|", "name": "keyword.operator.pipe.fish" }, { "comment": "IO Redirection", "match": "(?x:\n<|# Standard Input\n(>|\\^|>>|\\^\\^)(&[012\\-])?|\n[012](<|>|>>)(&[012\\-])?\n)", "name": "keyword.operator.redirect.fish" }, { "match": "&", "name": "keyword.operator.background.fish" }, { "match": "\\*\\*|\\*|\\?", "name": "keyword.operator.glob.fish" }, { "captures": { "1": { "name": "source.option.fish" } }, "comment": "command short/long options", "match": "\\s(-{1,2}[a-zA-Z_\\-0-9]+|-\\w)\\b" }, { "include": "#variable" }, { "include": "#escape" }], "repository": { "escape": { "patterns": [{ "comment": "single character character escape sequences", "match": `\\\\[abefnrtv $*?~#(){}\\[\\]<>^&|;"']`, "name": "constant.character.escape.single.fish" }, { "comment": "escapes the ascii character with the specified value (hexadecimal)", "match": "\\\\x[0-9a-fA-F]{1,2}", "name": "constant.character.escape.hex-ascii.fish" }, { "comment": "escapes a byte of data with the specified value (hexadecimal). If you are using mutibyte encoding, this can be used to enter invalid strings. Only use this if you know what are doing.", "match": "\\\\X[0-9a-fA-F]{1,2}", "name": "constant.character.escape.hex-byte.fish" }, { "comment": "escapes the ascii character with the specified value (octal)", "match": "\\\\[0-7]{1,3}", "name": "constant.character.escape.octal.fish" }, { "comment": "escapes the 16-bit unicode character with the specified value (hexadecimal)", "match": "\\\\u[0-9a-fA-F]{1,4}", "name": "constant.character.escape.unicode-16-bit.fish" }, { "comment": "escapes the 32-bit unicode character with the specified value (hexadecimal)", "match": "\\\\U[0-9a-fA-F]{1,8}", "name": "constant.character.escape.unicode-32-bit.fish" }, { "comment": "escapes the control sequence generated by pressing the control key and the specified letter", "match": "\\\\c[a-zA-Z]", "name": "constant.character.escape.control.fish" }] }, "variable": { "patterns": [{ "captures": { "1": { "name": "punctuation.definition.variable.fish" } }, "comment": "Built-in variables visible by pressing $ TAB TAB in a new shell",
var fish = [
lang
];
export { fish as default };