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

12 lines
18 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
import html from './html.mjs';
import './javascript.mjs';
import './css.mjs';
const lang = Object.freeze({ "displayName": "Elixir", "fileTypes": ["ex", "exs"], "firstLineMatch": "^#!/.*\\belixir", "foldingStartMarker": "(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$", "foldingStopMarker": "^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)", "name": "elixir", "patterns": [{ "begin": "\\b(fn)\\b(?!.*->)", "beginCaptures": { "1": { "name": "keyword.control.elixir" } }, "end": "$", "patterns": [{ "include": "#core_syntax" }] }, { "captures": { "1": { "name": "entity.name.type.class.elixir" }, "2": { "name": "punctuation.separator.method.elixir" }, "3": { "name": "entity.name.function.elixir" } }, "match": "([A-Z]\\w+)\\s*(\\.)\\s*([a-z_]\\w*[!?]?)" }, { "captures": { "1": { "name": "constant.other.symbol.elixir" }, "2": { "name": "punctuation.separator.method.elixir" }, "3": { "name": "entity.name.function.elixir" } }, "match": "(\\:\\w+)\\s*(\\.)\\s*([_]?\\w*[!?]?)" }, { "captures": { "1": { "name": "keyword.operator.other.elixir" }, "2": { "name": "entity.name.function.elixir" } }, "match": "(\\|\\>)\\s*([a-z_]\\w*[!?]?)" }, { "match": "\\b[a-z_]\\w*[!?]?(?=\\s*\\.?\\s*\\()", "name": "entity.name.function.elixir" }, { "begin": "\\b(fn)\\b(?=.*->)", "beginCaptures": { "1": { "name": "keyword.control.elixir" } }, "end": "(?>(->)|(when)|(\\)))", "endCaptures": { "1": { "name": "keyword.operator.other.elixir" }, "2": { "name": "keyword.control.elixir" }, "3": { "name": "punctuation.section.function.elixir" } }, "patterns": [{ "include": "#core_syntax" }] }, { "include": "#core_syntax" }, { "begin": `^(?=.*->)((?![^"']*("|')[^"']*->)|(?=.*->[^"']*("|')[^"']*->))((?!.*\\([^\\)]*->)|(?=[^\\(\\)]*->)|(?=\\s*\\(.*\\).*->))((?!.*\\b(fn)\\b)|(?=.*->.*\\bfn\\b))`, "beginCaptures": { "1": { "name": "keyword.control.elixir" } }, "end": "(?>(->)|(when)|(\\)))", "endCaptures": { "1": { "name": "keyword.operator.other.elixir" }, "2": { "name": "keyword.control.elixir" }, "3": { "name": "punctuation.section.function.elixir" } }, "patterns": [{ "include": "#core_syntax" }] }], "repository": { "core_syntax": { "patterns": [{ "begin": "^\\s*(defmodule)\\b", "beginCaptures": { "1": { "name": "keyword.control.module.elixir" } }, "end": "\\b(do)\\b", "endCaptures": { "1": { "name": "keyword.control.module.elixir" } }, "name": "meta.module.elixir", "patterns": [{ "match": "\\b[A-Z]\\w*(?=\\.)", "name": "entity.other.inherited-class.elixir" }, { "match": "\\b[A-Z]\\w*\\b", "name": "entity.name.type.class.elixir" }] }, { "begin": "^\\s*(defprotocol)\\b", "beginCaptures": { "1": { "name": "keyword.control.protocol.elixir" } }, "end": "\\b(do)\\b", "endCaptures": { "1": { "name": "keyword.control.protocol.elixir" } }, "name": "meta.protocol_declaration.elixir", "patterns": [{ "match": "\\b[A-Z]\\w*\\b", "name": "entity.name.type.protocol.elixir" }] }, { "begin": "^\\s*(defimpl)\\b", "beginCaptures": { "1": { "name": "keyword.control.protocol.elixir" } }, "end": "\\b(do)\\b", "endCaptures": { "1": { "name": "keyword.control.protocol.elixir" } }, "name": "meta.protocol_implementation.elixir", "patterns": [{ "match": "\\b[A-Z]\\w*\\b", "name": "entity.name.type.protocol.elixir" }] }, { "begin": "^\\s*(def|defmacro|defdelegate|defguard)\\s+((?>[a-zA-Z_]\\w*(?>\\.|::))?(?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?))((\\()|\\s*)", "beginCaptures": { "1": { "name": "keyword.control.module.elixir" }, "2": { "name": "entity.name.function.public.elixir" }, "4": { "name": "punctuation.section.function.elixir" } }, "end": "(\\bdo:)|(\\bdo\\b)|(?=\\s+(def|defn|defmacro|defdelegate|defguard)\\b)", "endCaptures": { "1": { "name": "constant.other.keywords.elixir" }, "2": { "name": "keyword.control.module.elixir" } }, "name": "meta.function.public.elixir", "patterns": [{ "include": "$self" }, { "begin": "\\s(\\\\\\\\)", "beginCaptures": { "1": { "name": "keyword.operator.other.elixir" } }, "end": ",|\\)|$", "patterns": [{ "include": "$self" }] }, { "match": "\\b(is_atom|is_binary|is_bitstring|is_boolean|is_float|is_function|is_integer|is_list|is_map|is_nil|is_number|is_pid|is_port|is_record|
var elixir = [
...html,
lang
];
export { elixir as default };