UNPKG

@tanstack/highlight

Version:

Tiny class-based syntax highlighting for documentation.

14 lines (13 loc) • 869 B
// Vocabulary adapted from Highlight.js 11.11.1, see NOTICE.md. import { simpleLanguage, cComments } from '../internal/simple-language.js'; export const scala = /* @__PURE__ */ simpleLanguage({ name: "scala", aliases: ["sc"], numberSuffix: '[lLfFdD]?', comments: cComments, strings: /"""[\s\S]*?(?:"""|(?![\s\S]))|"(?:\\[\s\S]|[^"\\])*(?:"|(?![\s\S]))|\'(?:\\[^\r\n]|[^\'\\\r\n])*(?:\'|(?![\s\S]))/, keywords: "type yield lazy override def with val var sealed abstract private trait object if then forSome for while do throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit export enum given transparent", literals: "true false null", nestedComments: [["/*", "*/"]], rules: [{ className: 'function', regex: /\b[A-Za-z_]\w*(?=\s*\()/g }], });