UNPKG

@tanstack/highlight

Version:

Tiny class-based syntax highlighting for documentation.

13 lines (12 loc) • 846 B
// Vocabulary adapted from Highlight.js 11.11.1, see NOTICE.md. import { simpleLanguage, quotedStrings } from '../internal/simple-language.js'; export const crystal = /* @__PURE__ */ simpleLanguage({ name: "crystal", wordCharacters: "\\w$!?", aliases: ["cr"], comments: /#[^\r\n]*/, strings: quotedStrings, keywords: "abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__", literals: "false nil true", rules: [{ className: 'function', regex: /\b[A-Za-z_]\w*(?=\s*\()/g }], });