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

10 lines
27 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
import markdown from './markdown.mjs';
const lang = Object.freeze({ "displayName": "F#", "name": "fsharp", "patterns": [{ "include": "#compiler_directives" }, { "include": "#comments" }, { "include": "#constants" }, { "include": "#strings" }, { "include": "#chars" }, { "include": "#double_tick" }, { "include": "#definition" }, { "include": "#abstract_definition" }, { "include": "#attributes" }, { "include": "#modules" }, { "include": "#anonymous_functions" }, { "include": "#du_declaration" }, { "include": "#record_declaration" }, { "include": "#records" }, { "include": "#strp_inlined" }, { "include": "#keywords" }, { "include": "#cexprs" }, { "include": "#text" }], "repository": { "abstract_definition": { "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(<)?", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "support.function.attribute.fsharp" }, "5": { "name": "keyword.symbol.fsharp" } }, "end": "\\s*(with)\\b|=|$", "endCaptures": { "1": { "name": "keyword.fsharp" } }, "name": "abstract.definition.fsharp", "patterns": [{ "include": "#comments" }, { "include": "#common_declaration" }, { "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" }, "3": { "name": "keyword.symbol.fsharp" }, "4": { "name": "entity.name.type.fsharp" } }, "match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)((?!with\\b)\\b([\\w0-9'`^._ ]+)){0,1}" }, { "captures": { "1": { "name": "entity.name.type.fsharp" } }, "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted", "match": "(?!with|get|set\\b)\\s*([\\w0-9'`^._]+)" }, { "include": "#keywords" }] }, "anonymous_functions": { "patterns": [{ "begin": "\\b(fun)\\b", "beginCaptures": { "1": { "name": "keyword.fsharp" } }, "end": "(->)", "endCaptures": { "1": { "name": "keyword.symbol.arrow.fsharp" } }, "name": "function.anonymous", "patterns": [{ "include": "#comments" }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "\\s*(?=(->))", "endCaptures": { "1": { "name": "keyword.symbol.arrow.fsharp" } }, "patterns": [{ "include": "#member_declaration" }] }, { "include": "#variables" }] }] }, "anonymous_record_declaration": { "begin": "(\\{\\|)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\|\\})", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [{ "captures": { "1": { "name": "keyword.symbol.fsharp" } }, "match": "[[:alpha:]0-9'`^_ ]+(:)" }, { "captures": { "1": { "name": "entity.name.type.fsharp" } }, "match": "([[:alpha:]0-9'`^_ ]+)" }, { "include": "#anonymous_record_declaration" }, { "include": "#keywords" }] }, "attributes": { "patterns": [{ "begin": "\\[\\<", "end": "\\>\\]|\\]", "name": "support.function.attribute.fsharp", "patterns": [{ "include": "$self" }] }] }, "cexprs": { "patterns": [{ "captures": { "0": { "name": "keyword.fsharp" } }, "match": "\\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)(?=\\s*\\{)", "name": "cexpr.fsharp" }] }, "chars": { "patterns": [{ "captures": { "1": { "name": "string.quoted.single.fsharp" } }, "match": "('\\\\?.')", "name": "char.fsharp" }] }, "comments": { "patterns": [{ "beginCaptures": { "1": { "name": "comment.block.fsharp" } }, "match": "(\\(\\*{3}.*\\*{3}\\))", "name": "comment.literate.command.fsharp" }, { "begin": "^\\s*(\\(\\*\\*(?!\\)))((?!\\*\\)).)*$", "beginCaptures": { "1": { "name": "comment.block.fsharp" } }, "endCaptures": { "1": { "name": "comment.block.fsharp" } }, "name": "comment.block.markdown.fsharp", "patterns": [{ "include": "text.html.markdown" }], "while": "^(?!\\s*(\\*)+\\)\\s*$)" }, { "begin": "(\\(\\*(?!\\)))", "beginCaptures": { "1": { "name": "comment.block.fsharp" } }, "end": "(\\*+\\))", "endCaptures": { "1": { "name": "comment.block.fsharp" } }, "name": "comment.block.fsharp", "patterns": [{ "comments": "Capture // when inside of (* *) like that the rule which capture comments starting by // is not trigger. See https://github.com/ionide/ionide-fsgrammar/issues/155", "m
var fsharp = [
...markdown,
lang
];
export { fsharp as default };