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

25 lines
40 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
import html from './html.mjs';
import xml from './xml.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';
import lua from './lua.mjs';
import './java.mjs';
const lang = Object.freeze({ "displayName": "Ruby", "name": "ruby", "patterns": [{ "captures": { "1": { "name": "keyword.control.class.ruby" }, "2": { "name": "entity.name.type.class.ruby" }, "3": { "name": "keyword.operator.other.ruby" }, "4": { "name": "entity.other.inherited-class.ruby" }, "5": { "name": "keyword.operator.other.ruby" }, "6": { "name": "variable.other.object.ruby" } }, "match": "^\\s*(class)\\s+(?:([.a-zA-Z0-9_:]+)(?:\\s*(<)\\s*([.a-zA-Z0-9_:]+))?|(<<)\\s*([.a-zA-Z0-9_:]+))", "name": "meta.class.ruby" }, { "captures": { "1": { "name": "keyword.control.module.ruby" }, "2": { "name": "entity.name.type.module.ruby" }, "3": { "name": "entity.other.inherited-class.module.first.ruby" }, "4": { "name": "punctuation.separator.inheritance.ruby" }, "5": { "name": "entity.other.inherited-class.module.second.ruby" }, "6": { "name": "punctuation.separator.inheritance.ruby" }, "7": { "name": "entity.other.inherited-class.module.third.ruby" }, "8": { "name": "punctuation.separator.inheritance.ruby" } }, "match": "^\\s*(module)\\s+(([A-Z]\\w*(::))?([A-Z]\\w*(::))?([A-Z]\\w*(::))*[A-Z]\\w*)", "name": "meta.module.ruby" }, { "comment": "else if is a common mistake carried over from other languages. it works if you put in a second end, but it\u2019s never what you want.", "match": "(?<!\\.)\\belse(\\s)+if\\b", "name": "invalid.deprecated.ruby" }, { "captures": { "1": { "name": "punctuation.definition.constant.ruby" } }, "comment": "symbols as hash key (1.9 syntax)", "match": "(?>[a-zA-Z_]\\w*(?>[?!])?)(:)(?!:)", "name": "constant.other.symbol.hashkey.ruby" }, { "captures": { "1": { "name": "punctuation.definition.constant.ruby" } }, "comment": "symbols as hash key (1.8 syntax)", "match": "(?<!:)(:)(?>[a-zA-Z_]\\w*(?>[?!])?)(?=\\s*=>)", "name": "constant.other.symbol.hashkey.ruby" }, { "comment": "everything being a reserved word, not a value and needing a 'end' is a..", "match": "(?<!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\\b(?![?!])", "name": "keyword.control.ruby" }, { "comment": "contextual smart pair support for block parameters", "match": "(?<!\\.)\\bdo\\b", "name": "keyword.control.start-block.ruby" }, { "comment": "contextual smart pair support", "match": "(?<=\\{)(\\s+)", "name": "meta.syntax.ruby.start-block" }, { "match": "(?<!\\.)\\b(alias|alias_method|block_given[?]|break|defined[?]|iterator[?]|next|redo|retry|return|super|undef|yield)(\\b|(?<=[?]))(?![?!])", "name": "keyword.control.pseudo-method.ruby" }, { "match": "\\b(nil|true|false)\\b(?![?!])", "name": "constant.language.ruby" }, { "match": "\\b(__(dir|FILE|LINE)__)\\b(?![?!])", "name": "variable.language.ruby" }, { "begin": "^__END__\\n", "captures": { "0": { "name": "string.unquoted.program-block.ruby" } }, "comment": "__END__ marker", "contentName": "text.plain", "end": "(?=not)impossible", "patterns": [{ "begin": "(?=<?xml|<(?i:html\\b)|!DOCTYPE (?i:html\\b))", "end": "(?=not)impossible", "name": "text.html.embedded.ruby", "patterns": [{ "include": "text.html.basic" }] }] }, { "match": "\\b(self)\\b(?![?!])", "name": "variable.language.self.ruby" }, { "comment": " everything being a method but having a special function is a..", "match": "\\b(initialize|new|loop|include|extend|prepend|fail|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|private_class_method|module_function|public|public_class_method|protected|refine|using)\\b(?![?!])", "name": "keyword.other.special-method.ruby" }, { "begin": "\\b(?<!\\.|::)(require|require_relative)\\b", "captures": { "1": { "name": "keyword.other.special-method.ruby" } }, "end": "$|(?=#|\\})", "name": "meta.require.ruby", "patterns": [{ "include": "$self" }] }, { "captures": { "1": { "name": "punctuation.definition.variable.ruby" } }, "match": "(@)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.instance.ruby" }, { "captures": { "1": { "name": "punctuation.definition.variable.ruby" } }, "match": "(@@)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.class.ruby" }, { "captures": { "1": { "name": "punctuation.definition.vari
var ruby = [
...html,
...xml,
...sql,
...css,
...c,
...javascript,
...shellscript,
...lua,
lang
];
export { ruby as default };