From 11aeddf0622f3a2f7bb5093748504dfcdb62d1df Mon Sep 17 00:00:00 2001 From: minify-bot Date: Tue, 10 Sep 2024 01:57:17 +0000 Subject: [PATCH] Auto minify --- dist/common.js | 1 + dist/detect.d.ts | 2 +- dist/detect.js | 1 + dist/index.d.ts | 8 ++++---- dist/index.d.ts.map | 2 +- dist/index.js | 4 ++++ dist/languages/asm.js | 1 + dist/languages/bash.js | 1 + dist/languages/bf.js | 1 + dist/languages/c.js | 1 + dist/languages/css.js | 1 + dist/languages/csv.js | 1 + dist/languages/diff.js | 1 + dist/languages/docker.js | 1 + dist/languages/git.js | 1 + dist/languages/go.js | 1 + dist/languages/html.js | 1 + dist/languages/http.d.ts | 2 +- dist/languages/http.js | 1 + dist/languages/ini.js | 1 + dist/languages/java.js | 1 + dist/languages/js.js | 1 + dist/languages/js_template_literals.js | 1 + dist/languages/jsdoc.js | 1 + dist/languages/json.js | 1 + dist/languages/leanpub-md.d.ts | 2 +- dist/languages/leanpub-md.js | 2 ++ dist/languages/log.js | 1 + dist/languages/lua.js | 1 + dist/languages/make.js | 1 + dist/languages/md.js | 2 ++ dist/languages/pl.js | 1 + dist/languages/plain.js | 1 + dist/languages/py.js | 1 + dist/languages/regex.js | 1 + dist/languages/rs.js | 1 + dist/languages/sql.js | 1 + dist/languages/todo.js | 1 + dist/languages/toml.js | 1 + dist/languages/ts.js | 1 + dist/languages/uri.js | 1 + dist/languages/xml.js | 1 + dist/languages/yaml.js | 1 + dist/node/common.js | 1 + dist/node/detect.d.ts | 2 +- dist/node/detect.js | 1 + dist/node/index.d.ts | 8 ++++---- dist/node/index.d.ts.map | 2 +- dist/node/index.js | 4 ++++ dist/node/languages/asm.js | 1 + dist/node/languages/bash.js | 1 + dist/node/languages/bf.js | 1 + dist/node/languages/c.js | 1 + dist/node/languages/css.js | 1 + dist/node/languages/csv.js | 1 + dist/node/languages/diff.js | 1 + dist/node/languages/docker.js | 1 + dist/node/languages/git.js | 1 + dist/node/languages/go.js | 1 + dist/node/languages/html.js | 1 + dist/node/languages/http.d.ts | 2 +- dist/node/languages/http.js | 1 + dist/node/languages/ini.js | 1 + dist/node/languages/java.js | 1 + dist/node/languages/js.js | 1 + dist/node/languages/js_template_literals.js | 1 + dist/node/languages/jsdoc.js | 1 + dist/node/languages/json.js | 1 + dist/node/languages/leanpub-md.d.ts | 2 +- dist/node/languages/leanpub-md.js | 2 ++ dist/node/languages/log.js | 1 + dist/node/languages/lua.js | 1 + dist/node/languages/make.js | 1 + dist/node/languages/md.js | 2 ++ dist/node/languages/pl.js | 1 + dist/node/languages/plain.js | 1 + dist/node/languages/py.js | 1 + dist/node/languages/regex.js | 1 + dist/node/languages/rs.js | 1 + dist/node/languages/sql.js | 1 + dist/node/languages/todo.js | 1 + dist/node/languages/toml.js | 1 + dist/node/languages/ts.js | 1 + dist/node/languages/uri.js | 1 + dist/node/languages/xml.js | 1 + dist/node/languages/yaml.js | 1 + dist/node/terminal.d.ts | 4 ++-- dist/node/terminal.d.ts.map | 2 +- dist/node/terminal.js | 2 ++ dist/node/themes/atom-dark.js | 1 + dist/node/themes/default.js | 1 + dist/node/themes/termcolor.js | 1 + dist/terminal.d.ts | 4 ++-- dist/terminal.d.ts.map | 2 +- dist/terminal.js | 2 ++ dist/themes/atom-dark.js | 1 + dist/themes/default.js | 1 + dist/themes/termcolor.js | 1 + docs/functions/detect.detectLanguage.html | 2 +- docs/functions/index.highlightAll.html | 2 +- docs/functions/index.highlightElement.html | 2 +- docs/functions/index.highlightText.html | 2 +- docs/functions/index.loadLanguage.html | 2 +- docs/functions/index.tokenize.html | 2 +- docs/functions/terminal.highlightText.html | 2 +- docs/functions/terminal.printHighlight.html | 2 +- docs/functions/terminal.setTheme.html | 2 +- docs/interfaces/index.ShjOptions.html | 4 ++-- docs/modules/detect.html | 2 +- docs/modules/index.html | 2 +- docs/modules/terminal.html | 2 +- docs/types/index.ShjBrowserTheme.html | 2 +- docs/types/index.ShjDisplayMode.html | 2 +- docs/types/index.ShjLanguage.html | 2 +- docs/types/index.ShjLanguageComponent.html | 2 +- docs/types/index.ShjLanguageDefinition.html | 2 +- docs/types/index.ShjToken.html | 2 +- docs/types/terminal.ShjTerminalTheme.html | 2 +- 118 files changed, 139 insertions(+), 43 deletions(-) create mode 100644 dist/common.js create mode 100644 dist/detect.js create mode 100644 dist/index.js create mode 100644 dist/languages/asm.js create mode 100644 dist/languages/bash.js create mode 100644 dist/languages/bf.js create mode 100644 dist/languages/c.js create mode 100644 dist/languages/css.js create mode 100644 dist/languages/csv.js create mode 100644 dist/languages/diff.js create mode 100644 dist/languages/docker.js create mode 100644 dist/languages/git.js create mode 100644 dist/languages/go.js create mode 100644 dist/languages/html.js create mode 100644 dist/languages/http.js create mode 100644 dist/languages/ini.js create mode 100644 dist/languages/java.js create mode 100644 dist/languages/js.js create mode 100644 dist/languages/js_template_literals.js create mode 100644 dist/languages/jsdoc.js create mode 100644 dist/languages/json.js create mode 100644 dist/languages/leanpub-md.js create mode 100644 dist/languages/log.js create mode 100644 dist/languages/lua.js create mode 100644 dist/languages/make.js create mode 100644 dist/languages/md.js create mode 100644 dist/languages/pl.js create mode 100644 dist/languages/plain.js create mode 100644 dist/languages/py.js create mode 100644 dist/languages/regex.js create mode 100644 dist/languages/rs.js create mode 100644 dist/languages/sql.js create mode 100644 dist/languages/todo.js create mode 100644 dist/languages/toml.js create mode 100644 dist/languages/ts.js create mode 100644 dist/languages/uri.js create mode 100644 dist/languages/xml.js create mode 100644 dist/languages/yaml.js create mode 100644 dist/node/common.js create mode 100644 dist/node/detect.js create mode 100644 dist/node/index.js create mode 100644 dist/node/languages/asm.js create mode 100644 dist/node/languages/bash.js create mode 100644 dist/node/languages/bf.js create mode 100644 dist/node/languages/c.js create mode 100644 dist/node/languages/css.js create mode 100644 dist/node/languages/csv.js create mode 100644 dist/node/languages/diff.js create mode 100644 dist/node/languages/docker.js create mode 100644 dist/node/languages/git.js create mode 100644 dist/node/languages/go.js create mode 100644 dist/node/languages/html.js create mode 100644 dist/node/languages/http.js create mode 100644 dist/node/languages/ini.js create mode 100644 dist/node/languages/java.js create mode 100644 dist/node/languages/js.js create mode 100644 dist/node/languages/js_template_literals.js create mode 100644 dist/node/languages/jsdoc.js create mode 100644 dist/node/languages/json.js create mode 100644 dist/node/languages/leanpub-md.js create mode 100644 dist/node/languages/log.js create mode 100644 dist/node/languages/lua.js create mode 100644 dist/node/languages/make.js create mode 100644 dist/node/languages/md.js create mode 100644 dist/node/languages/pl.js create mode 100644 dist/node/languages/plain.js create mode 100644 dist/node/languages/py.js create mode 100644 dist/node/languages/regex.js create mode 100644 dist/node/languages/rs.js create mode 100644 dist/node/languages/sql.js create mode 100644 dist/node/languages/todo.js create mode 100644 dist/node/languages/toml.js create mode 100644 dist/node/languages/ts.js create mode 100644 dist/node/languages/uri.js create mode 100644 dist/node/languages/xml.js create mode 100644 dist/node/languages/yaml.js create mode 100644 dist/node/terminal.js create mode 100644 dist/node/themes/atom-dark.js create mode 100644 dist/node/themes/default.js create mode 100644 dist/node/themes/termcolor.js create mode 100644 dist/terminal.js create mode 100644 dist/themes/atom-dark.js create mode 100644 dist/themes/default.js create mode 100644 dist/themes/termcolor.js diff --git a/dist/common.js b/dist/common.js new file mode 100644 index 0000000..e045620 --- /dev/null +++ b/dist/common.js @@ -0,0 +1 @@ +var t={num:{type:"num",match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:"str",match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:"str",match:/"((?!")[^\r\n\\]|\\[^])*"?/g}};export{t as default}; diff --git a/dist/detect.d.ts b/dist/detect.d.ts index 5e0eb92..0b8dc67 100644 --- a/dist/detect.d.ts +++ b/dist/detect.d.ts @@ -1,3 +1,3 @@ export function detectLanguage(code: string): ShjLanguage; -export type ShjLanguage = import('./index.js').ShjLanguage; +export type ShjLanguage = import("./index.js").ShjLanguage; //# sourceMappingURL=detect.d.ts.map \ No newline at end of file diff --git a/dist/detect.js b/dist/detect.js new file mode 100644 index 0000000..c3c5f11 --- /dev/null +++ b/dist/detect.js @@ -0,0 +1 @@ +var g=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],m=e=>g.map(([t,...a])=>[t,a.reduce((s,[n,i])=>s+[...e.matchAll(n)].length*i,0)]).filter(([t,a])=>a>20).sort((t,a)=>a[1]-t[1])[0]?.[0]||"plain";export{m as detectLanguage}; diff --git a/dist/index.d.ts b/dist/index.d.ts index 8bb1d14..8ca980c 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -42,11 +42,11 @@ export function loadLanguage(languageName: string, language: { /** * Default languages supported */ -export type ShjLanguage = ('asm' | 'bash' | 'bf' | 'c' | 'css' | 'csv' | 'diff' | 'docker' | 'git' | 'go' | 'html' | 'http' | 'ini' | 'java' | 'js' | 'jsdoc' | 'json' | 'leanpub-md' | 'log' | 'lua' | 'make' | 'md' | 'pl' | 'plain' | 'py' | 'regex' | 'rs' | 'sql' | 'todo' | 'toml' | 'ts' | 'uri' | 'xml' | 'yaml'); +export type ShjLanguage = ("asm" | "bash" | "bf" | "c" | "css" | "csv" | "diff" | "docker" | "git" | "go" | "html" | "http" | "ini" | "java" | "js" | "jsdoc" | "json" | "leanpub-md" | "log" | "lua" | "make" | "md" | "pl" | "plain" | "py" | "regex" | "rs" | "sql" | "todo" | "toml" | "ts" | "uri" | "xml" | "yaml"); /** * Themes supported in the browser */ -export type ShjBrowserTheme = ('atom-dark' | 'github-dark' | 'github-dim' | 'dark' | 'default' | 'github-light' | 'visual-studio-dark'); +export type ShjBrowserTheme = ("atom-dark" | "github-dark" | "github-dim" | "dark" | "default" | "github-light" | "visual-studio-dark"); export type ShjOptions = { /** * Indicates whether to hide line numbers @@ -58,11 +58,11 @@ export type ShjOptions = { * * `oneline` inside `div` element and containing only one line * * `multiline` inside `div` element */ -export type ShjDisplayMode = ('inline' | 'oneline' | 'multiline'); +export type ShjDisplayMode = ("inline" | "oneline" | "multiline"); /** * Token types */ -export type ShjToken = ('deleted' | 'err' | 'var' | 'section' | 'kwd' | 'class' | 'cmnt' | 'insert' | 'type' | 'func' | 'bool' | 'num' | 'oper' | 'str' | 'esc'); +export type ShjToken = ("deleted" | "err" | "var" | "section" | "kwd" | "class" | "cmnt" | "insert" | "type" | "func" | "bool" | "num" | "oper" | "str" | "esc"); export type ShjLanguageComponent = { match: RegExp; type: string; diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map index e591b8d..ec1beac 100644 --- a/dist/index.d.ts.map +++ b/dist/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;GAUG;AACH,8BAPW,MAAM,QACN,WAAW,QAAM,gBACR,MAAM,QAAE,QAAQ,iBAAG,IAAI,iBAyD1C;AAED;;;;;;;;;;;;GAYG;AACH,mCANW,MAAM,QACN,WAAW,6BAEX,UAAU,GACR,QAAQ,MAAM,CAAC,CAS3B;AAED;;;;;;;;;GASG;AACH,sDAJW,WAAW,SACX,cAAc,QACd,UAAU,iBAQpB;AASM,mCAFI,UAAU,mBAK2C;AAoBzD,2CAHI,MAAM,YACN;IAAE,OAAO,wBAAuB;CAAE,QAI5C;;;;0BAlLY,CAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,GAAG,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,GAAC,QAAQ,GAAC,KAAK,GAAC,IAAI,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,OAAO,GAAC,MAAM,GAAC,YAAY,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,IAAI,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,IAAI,GAAC,KAAK,GAAC,MAAM,GAAC,MAAM,GAAC,IAAI,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,CAAC;;;;8BAK7N,CAAC,WAAW,GAAC,aAAa,GAAC,YAAY,GAAC,MAAM,GAAC,SAAS,GAAC,cAAc,GAAC,oBAAoB,CAAC;;;;;;;;;;;;6BAS7F,CAAC,QAAQ,GAAC,SAAS,GAAC,WAAW,CAAC;;;;uBAQhC,CAAC,SAAS,GAAC,KAAK,GAAC,KAAK,GAAC,SAAS,GAAC,KAAK,GAAC,OAAO,GAAC,MAAM,GAAC,QAAQ,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,MAAM,GAAC,KAAK,GAAC,KAAK,CAAC;;WAyIpG,MAAM;UAAQ,MAAM;;WAC1B,MAAM;kDAA8C,MAAM,KAAK,oBAAoB;;YAClF,MAAM;;oCAKV,oBAAoB,EAAE"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;GAUG;AACH,8BAPW,MAAM,QACN,WAAW,QAAM,SACjB,CAAS,IAAM,EAAN,MAAM,EAAE,IAAS,EAAT,QAAQ,YAAC,KAAE,IAAI,iBAyD1C;AAED;;;;;;;;;;;;GAYG;AACH,mCANW,MAAM,QACN,WAAW,6BAEX,UAAU,GACR,OAAO,CAAC,MAAM,CAAC,CAS3B;AAED;;;;;;;;;GASG;AACH,sCALW,OAAO,SACP,WAAW,SACX,cAAc,QACd,UAAU,iBAQpB;AASM,mCAFI,UAAU,mBAK2C;AAoBzD,2CAHI,MAAM,YACN;IAAE,OAAO,EAAE,qBAAqB,CAAA;CAAE,QAI5C;;;;0BAlLY,CAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,GAAG,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,GAAC,QAAQ,GAAC,KAAK,GAAC,IAAI,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,OAAO,GAAC,MAAM,GAAC,YAAY,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,IAAI,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,IAAI,GAAC,KAAK,GAAC,MAAM,GAAC,MAAM,GAAC,IAAI,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,CAAC;;;;8BAK7N,CAAC,WAAW,GAAC,aAAa,GAAC,YAAY,GAAC,MAAM,GAAC,SAAS,GAAC,cAAc,GAAC,oBAAoB,CAAC;;;;;;;;;;;;6BAS7F,CAAC,QAAQ,GAAC,SAAS,GAAC,WAAW,CAAC;;;;uBAQhC,CAAC,SAAS,GAAC,KAAK,GAAC,KAAK,GAAC,SAAS,GAAC,KAAK,GAAC,OAAO,GAAC,MAAM,GAAC,QAAQ,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,MAAM,GAAC,KAAK,GAAC,KAAK,CAAC;mCAyI7G;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,IAAG,CAAC,IAAI,EAAC,MAAM,KAAK,oBAAoB,CAAA,CAAA;CAAE,GAC9F;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;oCAKZ,oBAAoB,EAAE"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..6986572 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,4 @@ +var Yt=Object.defineProperty;var D=t=>e=>{var s=t[e];if(s)return s();throw new Error("Module not found in bundle: "+e)};var a=(t,e)=>()=>(t&&(e=t(t=0)),e);var p=(t,e)=>{for(var s in e)Yt(t,s,{get:e[s],enumerable:!0})};var U={};p(U,{default:()=>Zt});var Zt,P=a(()=>{Zt=[{type:"cmnt",match:/(;|#).*/gm},{expand:"str"},{expand:"num"},{type:"num",match:/\$[\da-fA-F]*\b/g},{type:"kwd",match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:"func",match:/^[a-z]+/g}]},{type:"kwd",match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:"oper"}]});var v={};p(v,{default:()=>y});var M,y,T=a(()=>{M={type:"var",match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},y=[{sub:"todo",match:/#.*/g},{type:"str",match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[M]},{type:"oper",match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:"kwd",match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:"num"},{type:"func",match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi},{type:"bool",match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:"oper",match:/[=(){}<>!]+/g},{type:"var",match:/(?<=\s|^)[\w_]+(?=\s*=)/g},M]});var $={};p($,{default:()=>Xt});var Xt,B=a(()=>{Xt=[{match:/[^\[\->+.<\]\s].*/g,sub:"todo"},{type:"func",match:/\.+/g},{type:"kwd",match:/[<>]+/g},{type:"oper",match:/[+-]+/g}]});var G={};p(G,{default:()=>Wt});var Wt,F=a(()=>{Wt=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/#\s*include (<.*>|".*")/g,sub:[{type:"str",match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:"kwd",match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:"asm"}]},{type:"kwd",match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var H={};p(H,{default:()=>jt});var jt,k=a(()=>{jt=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:"var",match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:"func",match:/#[\w-]+(?=[^{}]*{)/g},{type:"num",match:/#[\da-f]{3,8}/g},{type:"num",match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:"var",match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:"func",match:/url(?=\()/g},{type:"str",match:/[^()]+/g}]},{type:"func",match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:"num",match:/\b[a-z-]+\b/g}]});var z={};p(z,{default:()=>Kt});var Kt,_=a(()=>{Kt=[{expand:"strDouble"},{type:"oper",match:/,/g}]});var Y={};p(Y,{default:()=>f});var f,I=a(()=>{f=[{type:"deleted",match:/^[-<].*/gm},{type:"insert",match:/^[+>].*/gm},{type:"kwd",match:/!.*/gm},{type:"section",match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]});var Z={};p(Z,{default:()=>Vt});var Vt,X=a(()=>{T();Vt=[{type:"kwd",match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gmi},...y]});var W={};p(W,{default:()=>qt});var qt,j=a(()=>{I();qt=[{match:/^#.*/gm,sub:"todo"},{expand:"str"},...f,{type:"func",match:/^(\$ )?git(\s.*)?$/gm},{type:"kwd",match:/^commit \w+$/gm}]});var K={};p(K,{default:()=>Qt});var Qt,V=a(()=>{Qt=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"oper",match:/[+\-*\/%&|^~=!<>.^-]+/g}]});var q={};p(q,{default:()=>N,property:()=>l,xmlElement:()=>o});var l,o,N,A=a(()=>{l=`\\s*(\\s+[a-z-]+\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,o={match:RegExp(``,"g"),sub:[{type:"var",match:/^<\/?[^\s>\/]+/g,sub:[{type:"oper",match:/^<\/?/g}]},{type:"str",match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/\/?>/g},{type:"class",match:/[a-z-]+/gi}]},N=[{match:/)[^])*-->/g,sub:"todo"},{type:"class",match:RegExp(`<\\?xml${l}\\?>`,"gi"),sub:[{type:"oper",match:/^<\?|\?>$/g},{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"var",match:/xml/gi}]},{type:"class",match://gi},o,{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}]});var Q={};p(Q,{default:()=>Jt});var Jt,J=a(()=>{A();Jt=[{type:"class",match:/])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:o.sub},{match:RegExp(`${o.match}|[^]*(?=$)`,"g"),sub:"css"},o]},{match:RegExp(`((?!<\/script>)[^])*<\/script\\s*>`,"g"),sub:[{match:RegExp(`^`,"g"),sub:o.sub},{match:RegExp(`${o.match}|[^]*(?=<\/script\\s*>$)`,"g"),sub:"js"},o]},...N]});var te,E,g=a(()=>{te=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],E=t=>te.map(([e,...s])=>[e,s.reduce((c,[m,n])=>c+[...t.matchAll(m)].length*n,0)]).filter(([e,s])=>s>20).sort((e,s)=>s[1]-e[1])[0]?.[0]||"plain"});var tt={};p(tt,{default:()=>ee});var ee,et=a(()=>{g();ee=[{type:"kwd",match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:"str"},{type:"section",match:/\bHTTP\/[\d.]+\b/g},{expand:"num"},{type:"oper",match:/[,;:=]/g},{type:"var",match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:E}]});var at={};p(at,{default:()=>ae});var ae,pt=a(()=>{ae=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:"todo"},{type:"str",match:/.*/g},{type:"var",match:/.*(?==)/g},{type:"section",match:/^\s*\[.+\]\s*$/gm},{type:"oper",match:/=/g}]});var st={};p(st,{default:()=>pe});var pe,ct=a(()=>{pe=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var nt={};p(nt,{default:()=>R});var R,O=a(()=>{R=[{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,sub:"js_template_literals"},{type:"kwd",match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]});var mt={};p(mt,{default:()=>se,type:()=>ce});var se,ce,rt=a(()=>{se=[{match:new class{exec(t){let e=this.lastIndex,s,c=m=>{for(;++eL,type:()=>ne});var L,ne,x=a(()=>{L=[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}],ne="cmnt"});var lt={};p(lt,{default:()=>me,type:()=>re});var me,re,Et=a(()=>{x();me=[{type:"kwd",match:/@\w+/g},{type:"class",match:/{[\w\s|<>,.@\[\]]+}/g},{type:"var",match:/\[[\w\s="']+\]/g},...L],re="cmnt"});var ht={};p(ht,{default:()=>oe});var oe,it=a(()=>{oe=[{type:"var",match:/("|')?[a-zA-Z]\w*\1(?=\s*:)/g},{expand:"str"},{expand:"num"},{type:"num",match:/\bnull\b/g},{type:"bool",match:/\b(true|false)\b/g}]});var ut={};p(ut,{default:()=>S});var S,C=a(()=>{g();S=[{type:"cmnt",match:/^>.*|(=|-)\1+/gm},{type:"class",match:/\*\*((?!\*\*).)*\*\*/g},{match:/```((?!```)[^])*\n```/g,sub:t=>({type:"kwd",sub:[{match:/\n[^]*(?=```)/g,sub:t.split(` +`)[0].slice(3)||E(t)}]})},{type:"str",match:/`[^`]*`/g},{type:"var",match:/~~((?!~~).)*~~/g},{type:"kwd",match:/_[^_]*_|\*[^*]*\*/g},{type:"kwd",match:/^\s*(\*|\d+\.)\s/gm},{type:"oper",match:/\[[^\]]*]/g},{type:"func",match:/\([^)]*\)/g}]});var gt={};p(gt,{default:()=>le});var le,dt=a(()=>{C();g();le=[{type:"insert",match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:"insert",match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:E}]},{type:"deleted",match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:"deleted",match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:E}]},...S]});var bt={};p(bt,{default:()=>Ee});var Ee,yt=a(()=>{Ee=[{type:"cmnt",match:/^#.*/gm},{expand:"strDouble"},{expand:"num"},{type:"err",match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:"num",match:/\b(null|undefined)\b/gi},{type:"bool",match:/\b(false|true|yes|no)\b/gi},{type:"oper",match:/\.|,/g}]});var Tt={};p(Tt,{default:()=>he});var he,ft=a(()=>{he=[{match:/^#!.*|--(\[(=*)\[((?!--\]\2\])[^])*--\]\2\]|.*)/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:"bool",match:/\b(true|false|nil)\b/g},{type:"oper",match:/[+*/%^#=~<>:,.-]+/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*[({])/g}]});var It={};p(It,{default:()=>ie});var ie,Nt=a(()=>{ie=[{match:/^\s*#.*/gm,sub:"todo"},{expand:"str"},{type:"oper",match:/[${}()]+/g},{type:"class",match:/.PHONY:/gm},{type:"section",match:/^[\w.]+:/gm},{type:"kwd",match:/\b(ifneq|endif)\b/g},{expand:"num"},{type:"var",match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:"bash"}]});var At={};p(At,{default:()=>ue});var ue,Rt=a(()=>{ue=[{match:/#.*/g,sub:"todo"},{type:"str",match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:"num"},{type:"kwd",match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:"oper",match:/[-+*/%~!&<>|=?,]+/g},{type:"func",match:/[a-z_]+(?=\s*\()/g}]});var Ot={};p(Ot,{default:()=>ge});var ge,Lt=a(()=>{ge=[{expand:"strDouble"}]});var xt={};p(xt,{default:()=>de});var de,St=a(()=>{de=[{match:/#.*/g,sub:"todo"},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:"todo"},{type:"str",match:/f("|')(\\[^]|(?!\1).)*\1?|f((["'])\4\4)(\\[^]|(?!\3)[^])*\3?/gi,sub:[{type:"var",match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:"py"}]}]},{expand:"str"},{type:"kwd",match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:"bool",match:/\b(False|True|None)\b/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*\()/g},{type:"oper",match:/[-/*+<>,=!&|^%]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var Ct={};p(Ct,{default:()=>be,type:()=>ye});var be,ye,Dt=a(()=>{be=[{match:/^(?!\/).*/gm,sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match:/\*|\+|\{\d+,\d+\}/g}],ye="oper"});var wt={};p(wt,{default:()=>Te});var Te,Ut=a(()=>{Te=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]});var Pt={};p(Pt,{default:()=>fe});var fe,Mt=a(()=>{fe=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"func",match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:"kwd",match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:"num",match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:"bool",match:/\b(TRUE|FALSE)\b/g},{type:"oper",match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:"var",match:/@\S+/g}]});var vt={};p(vt,{default:()=>Ie});var Ie,$t=a(()=>{Ie=[{match:/#.*/g,sub:"todo"},{type:"str",match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:"str"},{type:"section",match:/^\[.+\]\s*$/gm},{type:"num",match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:"num"},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[+,.=-]/g},{type:"var",match:/\w+(?= \=)/g}]});var Bt={};p(Bt,{default:()=>Ne});var Ne,Gt=a(()=>{O();Ne=[{type:"type",match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:"kwd",match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...R]});var Ft={};p(Ft,{default:()=>Ae});var Ae,Ht=a(()=>{Ae=[{match:/^#.*/gm,sub:"todo"},{type:"class",match:/^\w+(?=:?)/gm},{type:"num",match:/:\d+/g},{type:"oper",match:/[:/&?]|\w+=/g},{type:"func",match:/[.\w]+@|#[\w]+$/gm},{type:"var",match:/\w+\.\w+(\.\w+)*/g}]});var kt={};p(kt,{default:()=>Re});var Re,zt=a(()=>{Re=[{match:/#.*/g,sub:"todo"},{expand:"str"},{type:"str",match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:"type",match:/!![a-z]+/g},{type:"bool",match:/\b(Yes|No)\b/g},{type:"oper",match:/[+:-]/g},{expand:"num"},{type:"var",match:/[a-zA-Z]\w*(?=:)/g}]});var w={num:{type:"num",match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:"str",match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:"str",match:/"((?!")[^\r\n\\]|\\[^])*"?/g}};var Oe=D({"./languages/asm.js":()=>Promise.resolve().then(()=>(P(),U)),"./languages/bash.js":()=>Promise.resolve().then(()=>(T(),v)),"./languages/bf.js":()=>Promise.resolve().then(()=>(B(),$)),"./languages/c.js":()=>Promise.resolve().then(()=>(F(),G)),"./languages/css.js":()=>Promise.resolve().then(()=>(k(),H)),"./languages/csv.js":()=>Promise.resolve().then(()=>(_(),z)),"./languages/diff.js":()=>Promise.resolve().then(()=>(I(),Y)),"./languages/docker.js":()=>Promise.resolve().then(()=>(X(),Z)),"./languages/git.js":()=>Promise.resolve().then(()=>(j(),W)),"./languages/go.js":()=>Promise.resolve().then(()=>(V(),K)),"./languages/html.js":()=>Promise.resolve().then(()=>(J(),Q)),"./languages/http.js":()=>Promise.resolve().then(()=>(et(),tt)),"./languages/ini.js":()=>Promise.resolve().then(()=>(pt(),at)),"./languages/java.js":()=>Promise.resolve().then(()=>(ct(),st)),"./languages/js.js":()=>Promise.resolve().then(()=>(O(),nt)),"./languages/js_template_literals.js":()=>Promise.resolve().then(()=>(rt(),mt)),"./languages/jsdoc.js":()=>Promise.resolve().then(()=>(Et(),lt)),"./languages/json.js":()=>Promise.resolve().then(()=>(it(),ht)),"./languages/leanpub-md.js":()=>Promise.resolve().then(()=>(dt(),gt)),"./languages/log.js":()=>Promise.resolve().then(()=>(yt(),bt)),"./languages/lua.js":()=>Promise.resolve().then(()=>(ft(),Tt)),"./languages/make.js":()=>Promise.resolve().then(()=>(Nt(),It)),"./languages/md.js":()=>Promise.resolve().then(()=>(C(),ut)),"./languages/pl.js":()=>Promise.resolve().then(()=>(Rt(),At)),"./languages/plain.js":()=>Promise.resolve().then(()=>(Lt(),Ot)),"./languages/py.js":()=>Promise.resolve().then(()=>(St(),xt)),"./languages/regex.js":()=>Promise.resolve().then(()=>(Dt(),Ct)),"./languages/rs.js":()=>Promise.resolve().then(()=>(Ut(),wt)),"./languages/sql.js":()=>Promise.resolve().then(()=>(Mt(),Pt)),"./languages/todo.js":()=>Promise.resolve().then(()=>(x(),ot)),"./languages/toml.js":()=>Promise.resolve().then(()=>($t(),vt)),"./languages/ts.js":()=>Promise.resolve().then(()=>(Gt(),Bt)),"./languages/uri.js":()=>Promise.resolve().then(()=>(Ht(),Ft)),"./languages/xml.js":()=>Promise.resolve().then(()=>(A(),q)),"./languages/yaml.js":()=>Promise.resolve().then(()=>(zt(),kt))});var d={},Le=(t="")=>t.replaceAll("&","&").replaceAll?.("<","<").replaceAll?.(">",">"),xe=(t,e)=>e?`${t}`:t;async function _t(t,e,s){try{let c,m,n={},i,r=[],h=0,b=typeof e=="string"?await(d[e]??(d[e]=Oe(`./languages/${e}.js`))):e,u=[...typeof e=="string"?b.default:e.sub];for(;h0;){if(m=u[c].expand?w[u[c].expand]:u[c],r[c]===void 0||r[c].match.indexm+=xe(Le(n),i)),s?`
${"
".repeat(!c.hideLineNumbers&&t.split(` +`).length)}
${m}
`:m}async function Ce(t,e=t.className.match(/shj-lang-([\w-]+)/)?.[1],s,c){let m=t.textContent;s??(s=`${t.tagName=="CODE"?"in":m.split(` +`).length<2?"one":"multi"}line`),t.dataset.lang=e,t.className=`${[...t.classList].filter(n=>!n.startsWith("shj-")).join(" ")} shj-lang-${e} shj-${s}`,t.innerHTML=await Se(m,e,s=="multiline",c)}var Xe=async t=>Promise.all(Array.from(document.querySelectorAll('[class*="shj-lang-"]')).map(e=>Ce(e,void 0,void 0,t))),We=(t,e)=>{d[t]=e};export{Xe as highlightAll,Ce as highlightElement,Se as highlightText,We as loadLanguage,_t as tokenize}; diff --git a/dist/languages/asm.js b/dist/languages/asm.js new file mode 100644 index 0000000..56af9fa --- /dev/null +++ b/dist/languages/asm.js @@ -0,0 +1 @@ +var t=[{type:"cmnt",match:/(;|#).*/gm},{expand:"str"},{expand:"num"},{type:"num",match:/\$[\da-fA-F]*\b/g},{type:"kwd",match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:"func",match:/^[a-z]+/g}]},{type:"kwd",match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:"oper"}];export{t as default}; diff --git a/dist/languages/bash.js b/dist/languages/bash.js new file mode 100644 index 0000000..4dd2324 --- /dev/null +++ b/dist/languages/bash.js @@ -0,0 +1 @@ +var e={type:"var",match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},t=[{sub:"todo",match:/#.*/g},{type:"str",match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[e]},{type:"oper",match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:"kwd",match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:"num"},{type:"func",match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi},{type:"bool",match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:"oper",match:/[=(){}<>!]+/g},{type:"var",match:/(?<=\s|^)[\w_]+(?=\s*=)/g},e];export{t as default}; diff --git a/dist/languages/bf.js b/dist/languages/bf.js new file mode 100644 index 0000000..3ff389e --- /dev/null +++ b/dist/languages/bf.js @@ -0,0 +1 @@ +var t=[{match:/[^\[\->+.<\]\s].*/g,sub:"todo"},{type:"func",match:/\.+/g},{type:"kwd",match:/[<>]+/g},{type:"oper",match:/[+-]+/g}];export{t as default}; diff --git a/dist/languages/c.js b/dist/languages/c.js new file mode 100644 index 0000000..7ae7f6c --- /dev/null +++ b/dist/languages/c.js @@ -0,0 +1 @@ +var t=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/#\s*include (<.*>|".*")/g,sub:[{type:"str",match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:"kwd",match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:"asm"}]},{type:"kwd",match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}];export{t as default}; diff --git a/dist/languages/css.js b/dist/languages/css.js new file mode 100644 index 0000000..8f14f89 --- /dev/null +++ b/dist/languages/css.js @@ -0,0 +1 @@ +var t=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:"var",match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:"func",match:/#[\w-]+(?=[^{}]*{)/g},{type:"num",match:/#[\da-f]{3,8}/g},{type:"num",match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:"var",match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:"func",match:/url(?=\()/g},{type:"str",match:/[^()]+/g}]},{type:"func",match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:"num",match:/\b[a-z-]+\b/g}];export{t as default}; diff --git a/dist/languages/csv.js b/dist/languages/csv.js new file mode 100644 index 0000000..d514d65 --- /dev/null +++ b/dist/languages/csv.js @@ -0,0 +1 @@ +var e=[{expand:"strDouble"},{type:"oper",match:/,/g}];export{e as default}; diff --git a/dist/languages/diff.js b/dist/languages/diff.js new file mode 100644 index 0000000..b73dd48 --- /dev/null +++ b/dist/languages/diff.js @@ -0,0 +1 @@ +var t=[{type:"deleted",match:/^[-<].*/gm},{type:"insert",match:/^[+>].*/gm},{type:"kwd",match:/!.*/gm},{type:"section",match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}];export{t as default}; diff --git a/dist/languages/docker.js b/dist/languages/docker.js new file mode 100644 index 0000000..2907c93 --- /dev/null +++ b/dist/languages/docker.js @@ -0,0 +1 @@ +var e={type:"var",match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},t=[{sub:"todo",match:/#.*/g},{type:"str",match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[e]},{type:"oper",match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:"kwd",match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:"num"},{type:"func",match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi},{type:"bool",match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:"oper",match:/[=(){}<>!]+/g},{type:"var",match:/(?<=\s|^)[\w_]+(?=\s*=)/g},e];var r=[{type:"kwd",match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gmi},...t];export{r as default}; diff --git a/dist/languages/git.js b/dist/languages/git.js new file mode 100644 index 0000000..ab0be9b --- /dev/null +++ b/dist/languages/git.js @@ -0,0 +1 @@ +var t=[{type:"deleted",match:/^[-<].*/gm},{type:"insert",match:/^[+>].*/gm},{type:"kwd",match:/!.*/gm},{type:"section",match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}];var a=[{match:/^#.*/gm,sub:"todo"},{expand:"str"},...t,{type:"func",match:/^(\$ )?git(\s.*)?$/gm},{type:"kwd",match:/^commit \w+$/gm}];export{a as default}; diff --git a/dist/languages/go.js b/dist/languages/go.js new file mode 100644 index 0000000..b80df3f --- /dev/null +++ b/dist/languages/go.js @@ -0,0 +1 @@ +var t=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"oper",match:/[+\-*\/%&|^~=!<>.^-]+/g}];export{t as default}; diff --git a/dist/languages/html.js b/dist/languages/html.js new file mode 100644 index 0000000..1576e73 --- /dev/null +++ b/dist/languages/html.js @@ -0,0 +1 @@ +var s=`\\s*(\\s+[a-z-]+\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,t={match:RegExp(``,"g"),sub:[{type:"var",match:/^<\/?[^\s>\/]+/g,sub:[{type:"oper",match:/^<\/?/g}]},{type:"str",match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/\/?>/g},{type:"class",match:/[a-z-]+/gi}]},e=[{match:/)[^])*-->/g,sub:"todo"},{type:"class",match:RegExp(`<\\?xml${s}\\?>`,"gi"),sub:[{type:"oper",match:/^<\?|\?>$/g},{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"var",match:/xml/gi}]},{type:"class",match://gi},t,{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];var c=[{type:"class",match:/])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:t.sub},{match:RegExp(`${t.match}|[^]*(?=$)`,"g"),sub:"css"},t]},{match:RegExp(`((?!<\/script>)[^])*<\/script\\s*>`,"g"),sub:[{match:RegExp(`^`,"g"),sub:t.sub},{match:RegExp(`${t.match}|[^]*(?=<\/script\\s*>$)`,"g"),sub:"js"},t]},...e];export{c as default}; diff --git a/dist/languages/http.d.ts b/dist/languages/http.d.ts index db08b7b..b27ecba 100644 --- a/dist/languages/http.d.ts +++ b/dist/languages/http.d.ts @@ -10,7 +10,7 @@ declare const _default: ({ sub?: undefined; } | { match: RegExp; - sub: (code: string) => import("../index.js").ShjLanguage; + sub: (code: string) => ShjLanguage; type?: undefined; expand?: undefined; })[]; diff --git a/dist/languages/http.js b/dist/languages/http.js new file mode 100644 index 0000000..74d4f1d --- /dev/null +++ b/dist/languages/http.js @@ -0,0 +1 @@ +var i=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],e=n=>i.map(([a,...t])=>[a,t.reduce((m,[s,g])=>m+[...n.matchAll(s)].length*g,0)]).filter(([a,t])=>t>20).sort((a,t)=>t[1]-a[1])[0]?.[0]||"plain";var o=[{type:"kwd",match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:"str"},{type:"section",match:/\bHTTP\/[\d.]+\b/g},{expand:"num"},{type:"oper",match:/[,;:=]/g},{type:"var",match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:e}];export{o as default}; diff --git a/dist/languages/ini.js b/dist/languages/ini.js new file mode 100644 index 0000000..4b86cda --- /dev/null +++ b/dist/languages/ini.js @@ -0,0 +1 @@ +var t=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:"todo"},{type:"str",match:/.*/g},{type:"var",match:/.*(?==)/g},{type:"section",match:/^\s*\[.+\]\s*$/gm},{type:"oper",match:/=/g}];export{t as default}; diff --git a/dist/languages/java.js b/dist/languages/java.js new file mode 100644 index 0000000..0c3dbc3 --- /dev/null +++ b/dist/languages/java.js @@ -0,0 +1 @@ +var t=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}];export{t as default}; diff --git a/dist/languages/js.js b/dist/languages/js.js new file mode 100644 index 0000000..9066aa6 --- /dev/null +++ b/dist/languages/js.js @@ -0,0 +1 @@ +var t=[{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,sub:"js_template_literals"},{type:"kwd",match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}];export{t as default}; diff --git a/dist/languages/js_template_literals.js b/dist/languages/js_template_literals.js new file mode 100644 index 0000000..e89f0d4 --- /dev/null +++ b/dist/languages/js_template_literals.js @@ -0,0 +1 @@ +var h=[{match:new class{exec(l){let e=this.lastIndex,t,n=i=>{for(;++e,.@\[\]]+}/g},{type:"var",match:/\[[\w\s="']+\]/g},...t],c="cmnt";export{a as default,c as type}; diff --git a/dist/languages/json.js b/dist/languages/json.js new file mode 100644 index 0000000..5274760 --- /dev/null +++ b/dist/languages/json.js @@ -0,0 +1 @@ +var t=[{type:"var",match:/("|')?[a-zA-Z]\w*\1(?=\s*:)/g},{expand:"str"},{expand:"num"},{type:"num",match:/\bnull\b/g},{type:"bool",match:/\b(true|false)\b/g}];export{t as default}; diff --git a/dist/languages/leanpub-md.d.ts b/dist/languages/leanpub-md.d.ts index de1e942..29a26ee 100644 --- a/dist/languages/leanpub-md.d.ts +++ b/dist/languages/leanpub-md.d.ts @@ -21,7 +21,7 @@ declare const _default: ({ sub?: undefined; } | { match: RegExp; - sub: (code: string) => import("../index.js").ShjLanguage; + sub: (code: string) => ShjLanguage; type?: undefined; })[]; })[]; diff --git a/dist/languages/leanpub-md.js b/dist/languages/leanpub-md.js new file mode 100644 index 0000000..bf80d08 --- /dev/null +++ b/dist/languages/leanpub-md.js @@ -0,0 +1,2 @@ +var r=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],t=a=>r.map(([n,...e])=>[n,e.reduce((m,[l,g])=>m+[...a.matchAll(l)].length*g,0)]).filter(([n,e])=>e>20).sort((n,e)=>e[1]-n[1])[0]?.[0]||"plain";var s=[{type:"cmnt",match:/^>.*|(=|-)\1+/gm},{type:"class",match:/\*\*((?!\*\*).)*\*\*/g},{match:/```((?!```)[^])*\n```/g,sub:a=>({type:"kwd",sub:[{match:/\n[^]*(?=```)/g,sub:a.split(` +`)[0].slice(3)||t(a)}]})},{type:"str",match:/`[^`]*`/g},{type:"var",match:/~~((?!~~).)*~~/g},{type:"kwd",match:/_[^_]*_|\*[^*]*\*/g},{type:"kwd",match:/^\s*(\*|\d+\.)\s/gm},{type:"oper",match:/\[[^\]]*]/g},{type:"func",match:/\([^)]*\)/g}];var o=[{type:"insert",match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:"insert",match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:t}]},{type:"deleted",match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:"deleted",match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:t}]},...s];export{o as default}; diff --git a/dist/languages/log.js b/dist/languages/log.js new file mode 100644 index 0000000..32f6c73 --- /dev/null +++ b/dist/languages/log.js @@ -0,0 +1 @@ +var e=[{type:"cmnt",match:/^#.*/gm},{expand:"strDouble"},{expand:"num"},{type:"err",match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:"num",match:/\b(null|undefined)\b/gi},{type:"bool",match:/\b(false|true|yes|no)\b/gi},{type:"oper",match:/\.|,/g}];export{e as default}; diff --git a/dist/languages/lua.js b/dist/languages/lua.js new file mode 100644 index 0000000..35a1fcb --- /dev/null +++ b/dist/languages/lua.js @@ -0,0 +1 @@ +var e=[{match:/^#!.*|--(\[(=*)\[((?!--\]\2\])[^])*--\]\2\]|.*)/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:"bool",match:/\b(true|false|nil)\b/g},{type:"oper",match:/[+*/%^#=~<>:,.-]+/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*[({])/g}];export{e as default}; diff --git a/dist/languages/make.js b/dist/languages/make.js new file mode 100644 index 0000000..2c05431 --- /dev/null +++ b/dist/languages/make.js @@ -0,0 +1 @@ +var t=[{match:/^\s*#.*/gm,sub:"todo"},{expand:"str"},{type:"oper",match:/[${}()]+/g},{type:"class",match:/.PHONY:/gm},{type:"section",match:/^[\w.]+:/gm},{type:"kwd",match:/\b(ifneq|endif)\b/g},{expand:"num"},{type:"var",match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:"bash"}];export{t as default}; diff --git a/dist/languages/md.js b/dist/languages/md.js new file mode 100644 index 0000000..01bdf88 --- /dev/null +++ b/dist/languages/md.js @@ -0,0 +1,2 @@ +var i=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],s=a=>i.map(([e,...t])=>[e,t.reduce((m,[g,n])=>m+[...a.matchAll(g)].length*n,0)]).filter(([e,t])=>t>20).sort((e,t)=>t[1]-e[1])[0]?.[0]||"plain";var r=[{type:"cmnt",match:/^>.*|(=|-)\1+/gm},{type:"class",match:/\*\*((?!\*\*).)*\*\*/g},{match:/```((?!```)[^])*\n```/g,sub:a=>({type:"kwd",sub:[{match:/\n[^]*(?=```)/g,sub:a.split(` +`)[0].slice(3)||s(a)}]})},{type:"str",match:/`[^`]*`/g},{type:"var",match:/~~((?!~~).)*~~/g},{type:"kwd",match:/_[^_]*_|\*[^*]*\*/g},{type:"kwd",match:/^\s*(\*|\d+\.)\s/gm},{type:"oper",match:/\[[^\]]*]/g},{type:"func",match:/\([^)]*\)/g}];export{r as default}; diff --git a/dist/languages/pl.js b/dist/languages/pl.js new file mode 100644 index 0000000..074131c --- /dev/null +++ b/dist/languages/pl.js @@ -0,0 +1 @@ +var e=[{match:/#.*/g,sub:"todo"},{type:"str",match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:"num"},{type:"kwd",match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:"oper",match:/[-+*/%~!&<>|=?,]+/g},{type:"func",match:/[a-z_]+(?=\s*\()/g}];export{e as default}; diff --git a/dist/languages/plain.js b/dist/languages/plain.js new file mode 100644 index 0000000..38b5c43 --- /dev/null +++ b/dist/languages/plain.js @@ -0,0 +1 @@ +var e=[{expand:"strDouble"}];export{e as default}; diff --git a/dist/languages/py.js b/dist/languages/py.js new file mode 100644 index 0000000..a15cdec --- /dev/null +++ b/dist/languages/py.js @@ -0,0 +1 @@ +var t=[{match:/#.*/g,sub:"todo"},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:"todo"},{type:"str",match:/f("|')(\\[^]|(?!\1).)*\1?|f((["'])\4\4)(\\[^]|(?!\3)[^])*\3?/gi,sub:[{type:"var",match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:"py"}]}]},{expand:"str"},{type:"kwd",match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:"bool",match:/\b(False|True|None)\b/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*\()/g},{type:"oper",match:/[-/*+<>,=!&|^%]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}];export{t as default}; diff --git a/dist/languages/regex.js b/dist/languages/regex.js new file mode 100644 index 0000000..1ba4f25 --- /dev/null +++ b/dist/languages/regex.js @@ -0,0 +1 @@ +var t=[{match:/^(?!\/).*/gm,sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match:/\*|\+|\{\d+,\d+\}/g}],e="oper";export{t as default,e as type}; diff --git a/dist/languages/rs.js b/dist/languages/rs.js new file mode 100644 index 0000000..712cfec --- /dev/null +++ b/dist/languages/rs.js @@ -0,0 +1 @@ +var e=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}];export{e as default}; diff --git a/dist/languages/sql.js b/dist/languages/sql.js new file mode 100644 index 0000000..6211196 --- /dev/null +++ b/dist/languages/sql.js @@ -0,0 +1 @@ +var E=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"func",match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:"kwd",match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:"num",match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:"bool",match:/\b(TRUE|FALSE)\b/g},{type:"oper",match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:"var",match:/@\S+/g}];export{E as default}; diff --git a/dist/languages/todo.js b/dist/languages/todo.js new file mode 100644 index 0000000..99702b7 --- /dev/null +++ b/dist/languages/todo.js @@ -0,0 +1 @@ +var t=[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}],e="cmnt";export{t as default,e as type}; diff --git a/dist/languages/toml.js b/dist/languages/toml.js new file mode 100644 index 0000000..0f062cd --- /dev/null +++ b/dist/languages/toml.js @@ -0,0 +1 @@ +var t=[{match:/#.*/g,sub:"todo"},{type:"str",match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:"str"},{type:"section",match:/^\[.+\]\s*$/gm},{type:"num",match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:"num"},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[+,.=-]/g},{type:"var",match:/\w+(?= \=)/g}];export{t as default}; diff --git a/dist/languages/ts.js b/dist/languages/ts.js new file mode 100644 index 0000000..f091409 --- /dev/null +++ b/dist/languages/ts.js @@ -0,0 +1 @@ +var e=[{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,sub:"js_template_literals"},{type:"kwd",match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}];var c=[{type:"type",match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:"kwd",match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...e];export{c as default}; diff --git a/dist/languages/uri.js b/dist/languages/uri.js new file mode 100644 index 0000000..9d37c32 --- /dev/null +++ b/dist/languages/uri.js @@ -0,0 +1 @@ +var t=[{match:/^#.*/gm,sub:"todo"},{type:"class",match:/^\w+(?=:?)/gm},{type:"num",match:/:\d+/g},{type:"oper",match:/[:/&?]|\w+=/g},{type:"func",match:/[.\w]+@|#[\w]+$/gm},{type:"var",match:/\w+\.\w+(\.\w+)*/g}];export{t as default}; diff --git a/dist/languages/xml.js b/dist/languages/xml.js new file mode 100644 index 0000000..9868c61 --- /dev/null +++ b/dist/languages/xml.js @@ -0,0 +1 @@ +var t=`\\s*(\\s+[a-z-]+\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,a={match:RegExp(``,"g"),sub:[{type:"var",match:/^<\/?[^\s>\/]+/g,sub:[{type:"oper",match:/^<\/?/g}]},{type:"str",match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/\/?>/g},{type:"class",match:/[a-z-]+/gi}]},e=[{match:/)[^])*-->/g,sub:"todo"},{type:"class",match:RegExp(`<\\?xml${t}\\?>`,"gi"),sub:[{type:"oper",match:/^<\?|\?>$/g},{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"var",match:/xml/gi}]},{type:"class",match://gi},a,{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];export{e as default,t as property,a as xmlElement}; diff --git a/dist/languages/yaml.js b/dist/languages/yaml.js new file mode 100644 index 0000000..90b6ad0 --- /dev/null +++ b/dist/languages/yaml.js @@ -0,0 +1 @@ +var t=[{match:/#.*/g,sub:"todo"},{expand:"str"},{type:"str",match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:"type",match:/!![a-z]+/g},{type:"bool",match:/\b(Yes|No)\b/g},{type:"oper",match:/[+:-]/g},{expand:"num"},{type:"var",match:/[a-zA-Z]\w*(?=:)/g}];export{t as default}; diff --git a/dist/node/common.js b/dist/node/common.js new file mode 100644 index 0000000..22c787c --- /dev/null +++ b/dist/node/common.js @@ -0,0 +1 @@ +var m=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var a in t)m(e,a,{get:t[a],enumerable:!0})},c=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of s(t))!u.call(e,r)&&r!==a&&m(e,r,{get:()=>t[r],enumerable:!(n=p(t,r))||n.enumerable});return e};var d=e=>c(m({},"__esModule",{value:!0}),e);var h={};b(h,{default:()=>g});module.exports=d(h);var g={num:{type:"num",match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:"str",match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:"str",match:/"((?!")[^\r\n\\]|\\[^])*"?/g}}; diff --git a/dist/node/detect.d.ts b/dist/node/detect.d.ts index 5e0eb92..0b8dc67 100644 --- a/dist/node/detect.d.ts +++ b/dist/node/detect.d.ts @@ -1,3 +1,3 @@ export function detectLanguage(code: string): ShjLanguage; -export type ShjLanguage = import('./index.js').ShjLanguage; +export type ShjLanguage = import("./index.js").ShjLanguage; //# sourceMappingURL=detect.d.ts.map \ No newline at end of file diff --git a/dist/node/detect.js b/dist/node/detect.js new file mode 100644 index 0000000..2503c46 --- /dev/null +++ b/dist/node/detect.js @@ -0,0 +1 @@ +var i=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(t,a)=>{for(var e in a)i(t,e,{get:a[e],enumerable:!0})},b=(t,a,e,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of r(a))!o.call(t,n)&&n!==e&&i(t,n,{get:()=>a[n],enumerable:!(s=l(a,n))||s.enumerable});return t};var p=t=>b(i({},"__esModule",{value:!0}),t);var h={};c(h,{detectLanguage:()=>u});module.exports=p(h);var f=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],u=t=>{var a;return((a=f.map(([e,...s])=>[e,s.reduce((n,[g,m])=>n+[...t.matchAll(g)].length*m,0)]).filter(([e,s])=>s>20).sort((e,s)=>s[1]-e[1])[0])==null?void 0:a[0])||"plain"};0&&(module.exports={detectLanguage}); diff --git a/dist/node/index.d.ts b/dist/node/index.d.ts index 8bb1d14..8ca980c 100644 --- a/dist/node/index.d.ts +++ b/dist/node/index.d.ts @@ -42,11 +42,11 @@ export function loadLanguage(languageName: string, language: { /** * Default languages supported */ -export type ShjLanguage = ('asm' | 'bash' | 'bf' | 'c' | 'css' | 'csv' | 'diff' | 'docker' | 'git' | 'go' | 'html' | 'http' | 'ini' | 'java' | 'js' | 'jsdoc' | 'json' | 'leanpub-md' | 'log' | 'lua' | 'make' | 'md' | 'pl' | 'plain' | 'py' | 'regex' | 'rs' | 'sql' | 'todo' | 'toml' | 'ts' | 'uri' | 'xml' | 'yaml'); +export type ShjLanguage = ("asm" | "bash" | "bf" | "c" | "css" | "csv" | "diff" | "docker" | "git" | "go" | "html" | "http" | "ini" | "java" | "js" | "jsdoc" | "json" | "leanpub-md" | "log" | "lua" | "make" | "md" | "pl" | "plain" | "py" | "regex" | "rs" | "sql" | "todo" | "toml" | "ts" | "uri" | "xml" | "yaml"); /** * Themes supported in the browser */ -export type ShjBrowserTheme = ('atom-dark' | 'github-dark' | 'github-dim' | 'dark' | 'default' | 'github-light' | 'visual-studio-dark'); +export type ShjBrowserTheme = ("atom-dark" | "github-dark" | "github-dim" | "dark" | "default" | "github-light" | "visual-studio-dark"); export type ShjOptions = { /** * Indicates whether to hide line numbers @@ -58,11 +58,11 @@ export type ShjOptions = { * * `oneline` inside `div` element and containing only one line * * `multiline` inside `div` element */ -export type ShjDisplayMode = ('inline' | 'oneline' | 'multiline'); +export type ShjDisplayMode = ("inline" | "oneline" | "multiline"); /** * Token types */ -export type ShjToken = ('deleted' | 'err' | 'var' | 'section' | 'kwd' | 'class' | 'cmnt' | 'insert' | 'type' | 'func' | 'bool' | 'num' | 'oper' | 'str' | 'esc'); +export type ShjToken = ("deleted" | "err" | "var" | "section" | "kwd" | "class" | "cmnt" | "insert" | "type" | "func" | "bool" | "num" | "oper" | "str" | "esc"); export type ShjLanguageComponent = { match: RegExp; type: string; diff --git a/dist/node/index.d.ts.map b/dist/node/index.d.ts.map index b74f814..c4abc0c 100644 --- a/dist/node/index.d.ts.map +++ b/dist/node/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;GAUG;AACH,8BAPW,MAAM,QACN,WAAW,QAAM,gBACR,MAAM,QAAE,QAAQ,iBAAG,IAAI,iBAyD1C;AAED;;;;;;;;;;;;GAYG;AACH,mCANW,MAAM,QACN,WAAW,6BAEX,UAAU,GACR,QAAQ,MAAM,CAAC,CAS3B;AAED;;;;;;;;;GASG;AACH,sDAJW,WAAW,SACX,cAAc,QACd,UAAU,iBAQpB;AASM,mCAFI,UAAU,mBAK2C;AAoBzD,2CAHI,MAAM,YACN;IAAE,OAAO,wBAAuB;CAAE,QAI5C;;;;0BAlLY,CAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,GAAG,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,GAAC,QAAQ,GAAC,KAAK,GAAC,IAAI,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,OAAO,GAAC,MAAM,GAAC,YAAY,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,IAAI,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,IAAI,GAAC,KAAK,GAAC,MAAM,GAAC,MAAM,GAAC,IAAI,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,CAAC;;;;8BAK7N,CAAC,WAAW,GAAC,aAAa,GAAC,YAAY,GAAC,MAAM,GAAC,SAAS,GAAC,cAAc,GAAC,oBAAoB,CAAC;;;;;;;;;;;;6BAS7F,CAAC,QAAQ,GAAC,SAAS,GAAC,WAAW,CAAC;;;;uBAQhC,CAAC,SAAS,GAAC,KAAK,GAAC,KAAK,GAAC,SAAS,GAAC,KAAK,GAAC,OAAO,GAAC,MAAM,GAAC,QAAQ,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,MAAM,GAAC,KAAK,GAAC,KAAK,CAAC;;WAyIpG,MAAM;UAAQ,MAAM;;WAC1B,MAAM;kDAA8C,MAAM,KAAK,oBAAoB;;YAClF,MAAM;;oCAKV,oBAAoB,EAAE"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;GAUG;AACH,8BAPW,MAAM,QACN,WAAW,QAAM,SACjB,CAAS,IAAM,EAAN,MAAM,EAAE,IAAS,EAAT,QAAQ,YAAC,KAAE,IAAI,iBAyD1C;AAED;;;;;;;;;;;;GAYG;AACH,mCANW,MAAM,QACN,WAAW,6BAEX,UAAU,GACR,OAAO,CAAC,MAAM,CAAC,CAS3B;AAED;;;;;;;;;GASG;AACH,sCALW,OAAO,SACP,WAAW,SACX,cAAc,QACd,UAAU,iBAQpB;AASM,mCAFI,UAAU,mBAK2C;AAoBzD,2CAHI,MAAM,YACN;IAAE,OAAO,EAAE,qBAAqB,CAAA;CAAE,QAI5C;;;;0BAlLY,CAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,GAAG,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,GAAC,QAAQ,GAAC,KAAK,GAAC,IAAI,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,OAAO,GAAC,MAAM,GAAC,YAAY,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,GAAC,IAAI,GAAC,IAAI,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,IAAI,GAAC,KAAK,GAAC,MAAM,GAAC,MAAM,GAAC,IAAI,GAAC,KAAK,GAAC,KAAK,GAAC,MAAM,CAAC;;;;8BAK7N,CAAC,WAAW,GAAC,aAAa,GAAC,YAAY,GAAC,MAAM,GAAC,SAAS,GAAC,cAAc,GAAC,oBAAoB,CAAC;;;;;;;;;;;;6BAS7F,CAAC,QAAQ,GAAC,SAAS,GAAC,WAAW,CAAC;;;;uBAQhC,CAAC,SAAS,GAAC,KAAK,GAAC,KAAK,GAAC,SAAS,GAAC,KAAK,GAAC,OAAO,GAAC,MAAM,GAAC,QAAQ,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,MAAM,GAAC,KAAK,GAAC,KAAK,CAAC;mCAyI7G;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,IAAG,CAAC,IAAI,EAAC,MAAM,KAAK,oBAAoB,CAAA,CAAA;CAAE,GAC9F;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;oCAKZ,oBAAoB,EAAE"} \ No newline at end of file diff --git a/dist/node/index.js b/dist/node/index.js new file mode 100644 index 0000000..d028046 --- /dev/null +++ b/dist/node/index.js @@ -0,0 +1,4 @@ +var T=Object.defineProperty;var jt=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var Vt=Object.prototype.hasOwnProperty;var P=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var a=(e,t)=>()=>(e&&(t=e(e=0)),t);var p=(e,t)=>{for(var s in t)T(e,s,{get:t[s],enumerable:!0})},qt=(e,t,s,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of Kt(t))!Vt.call(e,c)&&c!==s&&T(e,c,{get:()=>t[c],enumerable:!(m=jt(t,c))||m.enumerable});return e};var Qt=e=>qt(T({},"__esModule",{value:!0}),e);var v={};p(v,{default:()=>Jt});var Jt,$=a(()=>{Jt=[{type:"cmnt",match:/(;|#).*/gm},{expand:"str"},{expand:"num"},{type:"num",match:/\$[\da-fA-F]*\b/g},{type:"kwd",match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:"func",match:/^[a-z]+/g}]},{type:"kwd",match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:"oper"}]});var G={};p(G,{default:()=>f});var B,f,I=a(()=>{B={type:"var",match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},f=[{sub:"todo",match:/#.*/g},{type:"str",match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[B]},{type:"oper",match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:"kwd",match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:"num"},{type:"func",match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi},{type:"bool",match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:"oper",match:/[=(){}<>!]+/g},{type:"var",match:/(?<=\s|^)[\w_]+(?=\s*=)/g},B]});var F={};p(F,{default:()=>te});var te,H=a(()=>{te=[{match:/[^\[\->+.<\]\s].*/g,sub:"todo"},{type:"func",match:/\.+/g},{type:"kwd",match:/[<>]+/g},{type:"oper",match:/[+-]+/g}]});var k={};p(k,{default:()=>ee});var ee,z=a(()=>{ee=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/#\s*include (<.*>|".*")/g,sub:[{type:"str",match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:"kwd",match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:"asm"}]},{type:"kwd",match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var _={};p(_,{default:()=>ae});var ae,Y=a(()=>{ae=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:"var",match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:"func",match:/#[\w-]+(?=[^{}]*{)/g},{type:"num",match:/#[\da-f]{3,8}/g},{type:"num",match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:"var",match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:"func",match:/url(?=\()/g},{type:"str",match:/[^()]+/g}]},{type:"func",match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:"num",match:/\b[a-z-]+\b/g}]});var Z={};p(Z,{default:()=>pe});var pe,X=a(()=>{pe=[{expand:"strDouble"},{type:"oper",match:/,/g}]});var W={};p(W,{default:()=>N});var N,A=a(()=>{N=[{type:"deleted",match:/^[-<].*/gm},{type:"insert",match:/^[+>].*/gm},{type:"kwd",match:/!.*/gm},{type:"section",match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]});var j={};p(j,{default:()=>se});var se,K=a(()=>{I();se=[{type:"kwd",match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gmi},...f]});var V={};p(V,{default:()=>ce});var ce,q=a(()=>{A();ce=[{match:/^#.*/gm,sub:"todo"},{expand:"str"},...N,{type:"func",match:/^(\$ )?git(\s.*)?$/gm},{type:"kwd",match:/^commit \w+$/gm}]});var Q={};p(Q,{default:()=>ne});var ne,J=a(()=>{ne=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"oper",match:/[+\-*\/%&|^~=!<>.^-]+/g}]});var tt={};p(tt,{default:()=>R,property:()=>E,xmlElement:()=>l});var E,l,R,O=a(()=>{E=`\\s*(\\s+[a-z-]+\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,l={match:RegExp(``,"g"),sub:[{type:"var",match:/^<\/?[^\s>\/]+/g,sub:[{type:"oper",match:/^<\/?/g}]},{type:"str",match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/\/?>/g},{type:"class",match:/[a-z-]+/gi}]},R=[{match:/)[^])*-->/g,sub:"todo"},{type:"class",match:RegExp(`<\\?xml${E}\\?>`,"gi"),sub:[{type:"oper",match:/^<\?|\?>$/g},{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"var",match:/xml/gi}]},{type:"class",match://gi},l,{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}]});var et={};p(et,{default:()=>me});var me,at=a(()=>{O();me=[{type:"class",match:/])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:l.sub},{match:RegExp(`${l.match}|[^]*(?=$)`,"g"),sub:"css"},l]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:l.sub},{match:RegExp(`${l.match}|[^]*(?=$)`,"g"),sub:"js"},l]},...R]});var re,h,g=a(()=>{re=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],h=e=>{var t;return((t=re.map(([s,...m])=>[s,m.reduce((c,[r,n])=>c+[...e.matchAll(r)].length*n,0)]).filter(([s,m])=>m>20).sort((s,m)=>m[1]-s[1])[0])==null?void 0:t[0])||"plain"}});var pt={};p(pt,{default:()=>oe});var oe,st=a(()=>{g();oe=[{type:"kwd",match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:"str"},{type:"section",match:/\bHTTP\/[\d.]+\b/g},{expand:"num"},{type:"oper",match:/[,;:=]/g},{type:"var",match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:h}]});var ct={};p(ct,{default:()=>le});var le,nt=a(()=>{le=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:"todo"},{type:"str",match:/.*/g},{type:"var",match:/.*(?==)/g},{type:"section",match:/^\s*\[.+\]\s*$/gm},{type:"oper",match:/=/g}]});var mt={};p(mt,{default:()=>Ee});var Ee,rt=a(()=>{Ee=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var ot={};p(ot,{default:()=>L});var L,x=a(()=>{L=[{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,sub:"js_template_literals"},{type:"kwd",match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]});var lt={};p(lt,{default:()=>he,type:()=>ie});var he,ie,Et=a(()=>{he=[{match:new class{exec(e){let t=this.lastIndex,s,m=c=>{for(;++tS,type:()=>ue});var S,ue,C=a(()=>{S=[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}],ue="cmnt"});var it={};p(it,{default:()=>ge,type:()=>de});var ge,de,ut=a(()=>{C();ge=[{type:"kwd",match:/@\w+/g},{type:"class",match:/{[\w\s|<>,.@\[\]]+}/g},{type:"var",match:/\[[\w\s="']+\]/g},...S],de="cmnt"});var gt={};p(gt,{default:()=>be});var be,dt=a(()=>{be=[{type:"var",match:/("|')?[a-zA-Z]\w*\1(?=\s*:)/g},{expand:"str"},{expand:"num"},{type:"num",match:/\bnull\b/g},{type:"bool",match:/\b(true|false)\b/g}]});var bt={};p(bt,{default:()=>D});var D,w=a(()=>{g();D=[{type:"cmnt",match:/^>.*|(=|-)\1+/gm},{type:"class",match:/\*\*((?!\*\*).)*\*\*/g},{match:/```((?!```)[^])*\n```/g,sub:e=>({type:"kwd",sub:[{match:/\n[^]*(?=```)/g,sub:e.split(` +`)[0].slice(3)||h(e)}]})},{type:"str",match:/`[^`]*`/g},{type:"var",match:/~~((?!~~).)*~~/g},{type:"kwd",match:/_[^_]*_|\*[^*]*\*/g},{type:"kwd",match:/^\s*(\*|\d+\.)\s/gm},{type:"oper",match:/\[[^\]]*]/g},{type:"func",match:/\([^)]*\)/g}]});var yt={};p(yt,{default:()=>ye});var ye,Tt=a(()=>{w();g();ye=[{type:"insert",match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:"insert",match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:h}]},{type:"deleted",match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:"deleted",match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:h}]},...D]});var ft={};p(ft,{default:()=>Te});var Te,It=a(()=>{Te=[{type:"cmnt",match:/^#.*/gm},{expand:"strDouble"},{expand:"num"},{type:"err",match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:"num",match:/\b(null|undefined)\b/gi},{type:"bool",match:/\b(false|true|yes|no)\b/gi},{type:"oper",match:/\.|,/g}]});var Nt={};p(Nt,{default:()=>fe});var fe,At=a(()=>{fe=[{match:/^#!.*|--(\[(=*)\[((?!--\]\2\])[^])*--\]\2\]|.*)/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:"bool",match:/\b(true|false|nil)\b/g},{type:"oper",match:/[+*/%^#=~<>:,.-]+/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*[({])/g}]});var Rt={};p(Rt,{default:()=>Ie});var Ie,Ot=a(()=>{Ie=[{match:/^\s*#.*/gm,sub:"todo"},{expand:"str"},{type:"oper",match:/[${}()]+/g},{type:"class",match:/.PHONY:/gm},{type:"section",match:/^[\w.]+:/gm},{type:"kwd",match:/\b(ifneq|endif)\b/g},{expand:"num"},{type:"var",match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:"bash"}]});var Lt={};p(Lt,{default:()=>Ne});var Ne,xt=a(()=>{Ne=[{match:/#.*/g,sub:"todo"},{type:"str",match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:"num"},{type:"kwd",match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:"oper",match:/[-+*/%~!&<>|=?,]+/g},{type:"func",match:/[a-z_]+(?=\s*\()/g}]});var St={};p(St,{default:()=>Ae});var Ae,Ct=a(()=>{Ae=[{expand:"strDouble"}]});var Dt={};p(Dt,{default:()=>Re});var Re,wt=a(()=>{Re=[{match:/#.*/g,sub:"todo"},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:"todo"},{type:"str",match:/f("|')(\\[^]|(?!\1).)*\1?|f((["'])\4\4)(\\[^]|(?!\3)[^])*\3?/gi,sub:[{type:"var",match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:"py"}]}]},{expand:"str"},{type:"kwd",match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:"bool",match:/\b(False|True|None)\b/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*\()/g},{type:"oper",match:/[-/*+<>,=!&|^%]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var Ut={};p(Ut,{default:()=>Oe,type:()=>Le});var Oe,Le,Pt=a(()=>{Oe=[{match:/^(?!\/).*/gm,sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match:/\*|\+|\{\d+,\d+\}/g}],Le="oper"});var Mt={};p(Mt,{default:()=>xe});var xe,vt=a(()=>{xe=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]});var $t={};p($t,{default:()=>Se});var Se,Bt=a(()=>{Se=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"func",match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:"kwd",match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:"num",match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:"bool",match:/\b(TRUE|FALSE)\b/g},{type:"oper",match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:"var",match:/@\S+/g}]});var Gt={};p(Gt,{default:()=>Ce});var Ce,Ft=a(()=>{Ce=[{match:/#.*/g,sub:"todo"},{type:"str",match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:"str"},{type:"section",match:/^\[.+\]\s*$/gm},{type:"num",match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:"num"},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[+,.=-]/g},{type:"var",match:/\w+(?= \=)/g}]});var Ht={};p(Ht,{default:()=>De});var De,kt=a(()=>{x();De=[{type:"type",match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:"kwd",match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...L]});var zt={};p(zt,{default:()=>we});var we,_t=a(()=>{we=[{match:/^#.*/gm,sub:"todo"},{type:"class",match:/^\w+(?=:?)/gm},{type:"num",match:/:\d+/g},{type:"oper",match:/[:/&?]|\w+=/g},{type:"func",match:/[.\w]+@|#[\w]+$/gm},{type:"var",match:/\w+\.\w+(\.\w+)*/g}]});var Yt={};p(Yt,{default:()=>Ue});var Ue,Zt=a(()=>{Ue=[{match:/#.*/g,sub:"todo"},{expand:"str"},{type:"str",match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:"type",match:/!![a-z]+/g},{type:"bool",match:/\b(Yes|No)\b/g},{type:"oper",match:/[+:-]/g},{expand:"num"},{type:"var",match:/[a-zA-Z]\w*(?=:)/g}]});var Ge={};p(Ge,{highlightAll:()=>$e,highlightElement:()=>Wt,highlightText:()=>Xt,loadLanguage:()=>Be,tokenize:()=>U});module.exports=Qt(Ge);var M={num:{type:"num",match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:"str",match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:"str",match:/"((?!")[^\r\n\\]|\\[^])*"?/g}};var Pe=P({"./languages/asm.js":()=>Promise.resolve().then(()=>($(),v)),"./languages/bash.js":()=>Promise.resolve().then(()=>(I(),G)),"./languages/bf.js":()=>Promise.resolve().then(()=>(H(),F)),"./languages/c.js":()=>Promise.resolve().then(()=>(z(),k)),"./languages/css.js":()=>Promise.resolve().then(()=>(Y(),_)),"./languages/csv.js":()=>Promise.resolve().then(()=>(X(),Z)),"./languages/diff.js":()=>Promise.resolve().then(()=>(A(),W)),"./languages/docker.js":()=>Promise.resolve().then(()=>(K(),j)),"./languages/git.js":()=>Promise.resolve().then(()=>(q(),V)),"./languages/go.js":()=>Promise.resolve().then(()=>(J(),Q)),"./languages/html.js":()=>Promise.resolve().then(()=>(at(),et)),"./languages/http.js":()=>Promise.resolve().then(()=>(st(),pt)),"./languages/ini.js":()=>Promise.resolve().then(()=>(nt(),ct)),"./languages/java.js":()=>Promise.resolve().then(()=>(rt(),mt)),"./languages/js.js":()=>Promise.resolve().then(()=>(x(),ot)),"./languages/js_template_literals.js":()=>Promise.resolve().then(()=>(Et(),lt)),"./languages/jsdoc.js":()=>Promise.resolve().then(()=>(ut(),it)),"./languages/json.js":()=>Promise.resolve().then(()=>(dt(),gt)),"./languages/leanpub-md.js":()=>Promise.resolve().then(()=>(Tt(),yt)),"./languages/log.js":()=>Promise.resolve().then(()=>(It(),ft)),"./languages/lua.js":()=>Promise.resolve().then(()=>(At(),Nt)),"./languages/make.js":()=>Promise.resolve().then(()=>(Ot(),Rt)),"./languages/md.js":()=>Promise.resolve().then(()=>(w(),bt)),"./languages/pl.js":()=>Promise.resolve().then(()=>(xt(),Lt)),"./languages/plain.js":()=>Promise.resolve().then(()=>(Ct(),St)),"./languages/py.js":()=>Promise.resolve().then(()=>(wt(),Dt)),"./languages/regex.js":()=>Promise.resolve().then(()=>(Pt(),Ut)),"./languages/rs.js":()=>Promise.resolve().then(()=>(vt(),Mt)),"./languages/sql.js":()=>Promise.resolve().then(()=>(Bt(),$t)),"./languages/todo.js":()=>Promise.resolve().then(()=>(C(),ht)),"./languages/toml.js":()=>Promise.resolve().then(()=>(Ft(),Gt)),"./languages/ts.js":()=>Promise.resolve().then(()=>(kt(),Ht)),"./languages/uri.js":()=>Promise.resolve().then(()=>(_t(),zt)),"./languages/xml.js":()=>Promise.resolve().then(()=>(O(),tt)),"./languages/yaml.js":()=>Promise.resolve().then(()=>(Zt(),Yt))});var d={},Me=(e="")=>{var t,s,m,c;return(c=(s=(t=e.replaceAll("&","&")).replaceAll)==null?void 0:(m=s.call(t,"<","<")).replaceAll)==null?void 0:c.call(m,">",">")},ve=(e,t)=>t?`${e}`:e;async function U(e,t,s){var m;try{let c,r,n={},b,o=[],i=0,y=typeof t=="string"?await((m=d[t])!=null?m:d[t]=Pe(`./languages/${t}.js`)):t,u=[...typeof t=="string"?y.default:t.sub];for(;i0;){if(r=u[c].expand?M[u[c].expand]:u[c],o[c]===void 0||o[c].match.indexc+=ve(Me(r),n)),s?`
${"
".repeat(!m.hideLineNumbers&&e.split(` +`).length)}
${c}
`:c}async function Wt(e,t=(c=>(c=e.className.match(/shj-lang-([\w-]+)/))==null?void 0:c[1])(),s,m){let r=e.textContent;s!=null||(s=`${e.tagName=="CODE"?"in":r.split(` +`).length<2?"one":"multi"}line`),e.dataset.lang=t,e.className=`${[...e.classList].filter(n=>!n.startsWith("shj-")).join(" ")} shj-lang-${t} shj-${s}`,e.innerHTML=await Xt(r,t,s=="multiline",m)}var $e=async e=>Promise.all(Array.from(document.querySelectorAll('[class*="shj-lang-"]')).map(t=>Wt(t,void 0,void 0,e))),Be=(e,t)=>{d[e]=t};0&&(module.exports={highlightAll,highlightElement,highlightText,loadLanguage,tokenize}); diff --git a/dist/node/languages/asm.js b/dist/node/languages/asm.js new file mode 100644 index 0000000..55c0b16 --- /dev/null +++ b/dist/node/languages/asm.js @@ -0,0 +1 @@ +var p=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var n=(a,t)=>{for(var e in t)p(a,e,{get:t[e],enumerable:!0})},y=(a,t,e,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of g(t))!h.call(a,m)&&m!==e&&p(a,m,{get:()=>t[m],enumerable:!(c=d(t,m))||c.enumerable});return a};var u=a=>y(p({},"__esModule",{value:!0}),a);var b={};n(b,{default:()=>z});module.exports=u(b);var z=[{type:"cmnt",match:/(;|#).*/gm},{expand:"str"},{expand:"num"},{type:"num",match:/\$[\da-fA-F]*\b/g},{type:"kwd",match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:"func",match:/^[a-z]+/g}]},{type:"kwd",match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:"oper"}]; diff --git a/dist/node/languages/bash.js b/dist/node/languages/bash.js new file mode 100644 index 0000000..9f07311 --- /dev/null +++ b/dist/node/languages/bash.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var n=(t,e)=>{for(var s in e)l(t,s,{get:e[s],enumerable:!0})},m=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of o(e))!i.call(t,a)&&a!==s&&l(t,a,{get:()=>e[a],enumerable:!(r=p(e,a))||r.enumerable});return t};var d=t=>m(l({},"__esModule",{value:!0}),t);var u={};n(u,{default:()=>h});module.exports=d(u);var c={type:"var",match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},h=[{sub:"todo",match:/#.*/g},{type:"str",match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[c]},{type:"oper",match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:"kwd",match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:"num"},{type:"func",match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi},{type:"bool",match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:"oper",match:/[=(){}<>!]+/g},{type:"var",match:/(?<=\s|^)[\w_]+(?=\s*=)/g},c]; diff --git a/dist/node/languages/bf.js b/dist/node/languages/bf.js new file mode 100644 index 0000000..83977d0 --- /dev/null +++ b/dist/node/languages/bf.js @@ -0,0 +1 @@ +var p=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var c in t)p(e,c,{get:t[c],enumerable:!0})},u=(e,t,c,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of m(t))!o.call(e,a)&&a!==c&&p(e,a,{get:()=>t[a],enumerable:!(g=h(t,a))||g.enumerable});return e};var y=e=>u(p({},"__esModule",{value:!0}),e);var r={};d(r,{default:()=>f});module.exports=y(r);var f=[{match:/[^\[\->+.<\]\s].*/g,sub:"todo"},{type:"func",match:/\.+/g},{type:"kwd",match:/[<>]+/g},{type:"oper",match:/[+-]+/g}]; diff --git a/dist/node/languages/c.js b/dist/node/languages/c.js new file mode 100644 index 0000000..ae6241c --- /dev/null +++ b/dist/node/languages/c.js @@ -0,0 +1 @@ +var c=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of u(t))!m.call(e,a)&&a!==s&&c(e,a,{get:()=>t[a],enumerable:!(n=o(t,a))||n.enumerable});return e};var h=e=>g(c({},"__esModule",{value:!0}),e);var r={};d(r,{default:()=>i});module.exports=h(r);var i=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/#\s*include (<.*>|".*")/g,sub:[{type:"str",match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:"kwd",match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:"asm"}]},{type:"kwd",match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]; diff --git a/dist/node/languages/css.js b/dist/node/languages/css.js new file mode 100644 index 0000000..9ff433d --- /dev/null +++ b/dist/node/languages/css.js @@ -0,0 +1 @@ +var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var u=(a,t)=>{for(var c in t)e(a,c,{get:t[c],enumerable:!0})},b=(a,t,c,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of g(t))!n.call(a,m)&&m!==c&&e(a,m,{get:()=>t[m],enumerable:!(p=h(t,m))||p.enumerable});return a};var y=a=>b(e({},"__esModule",{value:!0}),a);var d={};u(d,{default:()=>r});module.exports=y(d);var r=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:"var",match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:"func",match:/#[\w-]+(?=[^{}]*{)/g},{type:"num",match:/#[\da-f]{3,8}/g},{type:"num",match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:"var",match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:"func",match:/url(?=\()/g},{type:"str",match:/[^()]+/g}]},{type:"func",match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:"num",match:/\b[a-z-]+\b/g}]; diff --git a/dist/node/languages/csv.js b/dist/node/languages/csv.js new file mode 100644 index 0000000..ddf1bc3 --- /dev/null +++ b/dist/node/languages/csv.js @@ -0,0 +1 @@ +var o=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var a in e)o(t,a,{get:e[a],enumerable:!0})},b=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of l(e))!u.call(t,p)&&p!==a&&o(t,p,{get:()=>e[p],enumerable:!(r=d(e,p))||r.enumerable});return t};var c=t=>b(o({},"__esModule",{value:!0}),t);var g={};x(g,{default:()=>f});module.exports=c(g);var f=[{expand:"strDouble"},{type:"oper",match:/,/g}]; diff --git a/dist/node/languages/diff.js b/dist/node/languages/diff.js new file mode 100644 index 0000000..0aa0775 --- /dev/null +++ b/dist/node/languages/diff.js @@ -0,0 +1 @@ +var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var a in t)c(e,a,{get:t[a],enumerable:!0})},i=(e,t,a,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of g(t))!h.call(e,m)&&m!==a&&c(e,m,{get:()=>t[m],enumerable:!(d=p(t,m))||d.enumerable});return e};var l=e=>i(c({},"__esModule",{value:!0}),e);var o={};y(o,{default:()=>n});module.exports=l(o);var n=[{type:"deleted",match:/^[-<].*/gm},{type:"insert",match:/^[+>].*/gm},{type:"kwd",match:/!.*/gm},{type:"section",match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]; diff --git a/dist/node/languages/docker.js b/dist/node/languages/docker.js new file mode 100644 index 0000000..ce8a0cc --- /dev/null +++ b/dist/node/languages/docker.js @@ -0,0 +1 @@ +var r=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var s in e)r(t,s,{get:e[s],enumerable:!0})},h=(t,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of m(e))!i.call(t,a)&&a!==s&&r(t,a,{get:()=>e[a],enumerable:!(l=o(e,a))||l.enumerable});return t};var n=t=>h(r({},"__esModule",{value:!0}),t);var y={};d(y,{default:()=>u});module.exports=n(y);var p={type:"var",match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},c=[{sub:"todo",match:/#.*/g},{type:"str",match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[p]},{type:"oper",match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:"kwd",match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:"num"},{type:"func",match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi},{type:"bool",match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:"oper",match:/[=(){}<>!]+/g},{type:"var",match:/(?<=\s|^)[\w_]+(?=\s*=)/g},p];var u=[{type:"kwd",match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gmi},...c]; diff --git a/dist/node/languages/git.js b/dist/node/languages/git.js new file mode 100644 index 0000000..f16a0a4 --- /dev/null +++ b/dist/node/languages/git.js @@ -0,0 +1 @@ +var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var f=(m,t)=>{for(var a in t)c(m,a,{get:t[a],enumerable:!0})},i=(m,t,a,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of o(t))!h.call(m,e)&&e!==a&&c(m,e,{get:()=>t[e],enumerable:!(d=g(t,e))||d.enumerable});return m};var r=m=>i(c({},"__esModule",{value:!0}),m);var s={};f(s,{default:()=>y});module.exports=r(s);var p=[{type:"deleted",match:/^[-<].*/gm},{type:"insert",match:/^[+>].*/gm},{type:"kwd",match:/!.*/gm},{type:"section",match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}];var y=[{match:/^#.*/gm,sub:"todo"},{expand:"str"},...p,{type:"func",match:/^(\$ )?git(\s.*)?$/gm},{type:"kwd",match:/^commit \w+$/gm}]; diff --git a/dist/node/languages/go.js b/dist/node/languages/go.js new file mode 100644 index 0000000..c18c378 --- /dev/null +++ b/dist/node/languages/go.js @@ -0,0 +1 @@ +var r=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var c in t)r(e,c,{get:t[c],enumerable:!0})},u=(e,t,c,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of p(t))!s.call(e,a)&&a!==c&&r(e,a,{get:()=>t[a],enumerable:!(n=o(t,a))||n.enumerable});return e};var f=e=>u(r({},"__esModule",{value:!0}),e);var m={};g(m,{default:()=>h});module.exports=f(m);var h=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"oper",match:/[+\-*\/%&|^~=!<>.^-]+/g}]; diff --git a/dist/node/languages/html.js b/dist/node/languages/html.js new file mode 100644 index 0000000..c163f3a --- /dev/null +++ b/dist/node/languages/html.js @@ -0,0 +1 @@ +var m=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var c in t)m(e,c,{get:t[c],enumerable:!0})},u=(e,t,c,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of y(t))!l.call(e,a)&&a!==c&&m(e,a,{get:()=>t[a],enumerable:!(g=r(t,a))||g.enumerable});return e};var b=e=>u(m({},"__esModule",{value:!0}),e);var i={};x(i,{default:()=>o});module.exports=b(i);var p=`\\s*(\\s+[a-z-]+\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,s={match:RegExp(``,"g"),sub:[{type:"var",match:/^<\/?[^\s>\/]+/g,sub:[{type:"oper",match:/^<\/?/g}]},{type:"str",match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/\/?>/g},{type:"class",match:/[a-z-]+/gi}]},h=[{match:/)[^])*-->/g,sub:"todo"},{type:"class",match:RegExp(`<\\?xml${p}\\?>`,"gi"),sub:[{type:"oper",match:/^<\?|\?>$/g},{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"var",match:/xml/gi}]},{type:"class",match://gi},s,{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];var o=[{type:"class",match:/])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:s.sub},{match:RegExp(`${s.match}|[^]*(?=$)`,"g"),sub:"css"},s]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:s.sub},{match:RegExp(`${s.match}|[^]*(?=$)`,"g"),sub:"js"},s]},...h]; diff --git a/dist/node/languages/http.d.ts b/dist/node/languages/http.d.ts index db08b7b..b27ecba 100644 --- a/dist/node/languages/http.d.ts +++ b/dist/node/languages/http.d.ts @@ -10,7 +10,7 @@ declare const _default: ({ sub?: undefined; } | { match: RegExp; - sub: (code: string) => import("../index.js").ShjLanguage; + sub: (code: string) => ShjLanguage; type?: undefined; expand?: undefined; })[]; diff --git a/dist/node/languages/http.js b/dist/node/languages/http.js new file mode 100644 index 0000000..bd0d917 --- /dev/null +++ b/dist/node/languages/http.js @@ -0,0 +1 @@ +var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(a,t)=>{for(var e in t)s(a,e,{get:t[e],enumerable:!0})},b=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of o(t))!c.call(a,m)&&m!==e&&s(a,m,{get:()=>t[m],enumerable:!(n=l(t,m))||n.enumerable});return a};var f=a=>b(s({},"__esModule",{value:!0}),a);var h={};p(h,{default:()=>T});module.exports=f(h);var u=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],g=a=>{var t;return((t=u.map(([e,...n])=>[e,n.reduce((m,[i,r])=>m+[...a.matchAll(i)].length*r,0)]).filter(([e,n])=>n>20).sort((e,n)=>n[1]-e[1])[0])==null?void 0:t[0])||"plain"};var T=[{type:"kwd",match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:"str"},{type:"section",match:/\bHTTP\/[\d.]+\b/g},{expand:"num"},{type:"oper",match:/[,;:=]/g},{type:"var",match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:g}]; diff --git a/dist/node/languages/ini.js b/dist/node/languages/ini.js new file mode 100644 index 0000000..40a001e --- /dev/null +++ b/dist/node/languages/ini.js @@ -0,0 +1 @@ +var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var s=(e,t)=>{for(var m in t)c(e,m,{get:t[m],enumerable:!0})},r=(e,t,m,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of h(t))!o.call(e,a)&&a!==m&&c(e,a,{get:()=>t[a],enumerable:!(p=g(t,a))||p.enumerable});return e};var y=e=>r(c({},"__esModule",{value:!0}),e);var f={};s(f,{default:()=>d});module.exports=y(f);var d=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:"todo"},{type:"str",match:/.*/g},{type:"var",match:/.*(?==)/g},{type:"section",match:/^\s*\[.+\]\s*$/gm},{type:"oper",match:/=/g}]; diff --git a/dist/node/languages/java.js b/dist/node/languages/java.js new file mode 100644 index 0000000..e86faaf --- /dev/null +++ b/dist/node/languages/java.js @@ -0,0 +1 @@ +var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var l=(e,t)=>{for(var s in t)n(e,s,{get:t[s],enumerable:!0})},p=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of c(t))!i.call(e,a)&&a!==s&&n(e,a,{get:()=>t[a],enumerable:!(o=r(t,a))||o.enumerable});return e};var h=e=>p(n({},"__esModule",{value:!0}),e);var u={};l(u,{default:()=>d});module.exports=h(u);var d=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]; diff --git a/dist/node/languages/js.js b/dist/node/languages/js.js new file mode 100644 index 0000000..7796915 --- /dev/null +++ b/dist/node/languages/js.js @@ -0,0 +1 @@ +var c=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var u=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},l=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of r(t))!i.call(e,a)&&a!==s&&c(e,a,{get:()=>t[a],enumerable:!(n=o(t,a))||n.enumerable});return e};var p=e=>l(c({},"__esModule",{value:!0}),e);var b={};u(b,{default:()=>m});module.exports=p(b);var m=[{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,sub:"js_template_literals"},{type:"kwd",match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]; diff --git a/dist/node/languages/js_template_literals.js b/dist/node/languages/js_template_literals.js new file mode 100644 index 0000000..9a28ce0 --- /dev/null +++ b/dist/node/languages/js_template_literals.js @@ -0,0 +1 @@ +var h=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(l,e)=>{for(var t in e)h(l,t,{get:e[t],enumerable:!0})},x=(l,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of u(e))!c.call(l,n)&&n!==t&&h(l,n,{get:()=>e[n],enumerable:!(i=a(e,n))||i.enumerable});return l};var d=l=>x(h({},"__esModule",{value:!0}),l);var g={};f(g,{default:()=>s,type:()=>$});module.exports=d(g);var s=[{match:new class{exec(l){let e=this.lastIndex,t,i=n=>{for(;++e{for(var a in t)c(e,a,{get:t[a],enumerable:!0})},h=(e,t,a,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of y(t))!b.call(e,p)&&p!==a&&c(e,p,{get:()=>t[p],enumerable:!(m=o(t,p))||m.enumerable});return e};var s=e=>h(c({},"__esModule",{value:!0}),e);var l={};g(l,{default:()=>E,type:()=>I});module.exports=s(l);var r=[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}];var E=[{type:"kwd",match:/@\w+/g},{type:"class",match:/{[\w\s|<>,.@\[\]]+}/g},{type:"var",match:/\[[\w\s="']+\]/g},...r],I="cmnt";0&&(module.exports={type}); diff --git a/dist/node/languages/json.js b/dist/node/languages/json.js new file mode 100644 index 0000000..7816cdf --- /dev/null +++ b/dist/node/languages/json.js @@ -0,0 +1 @@ +var b=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var r=(a,t)=>{for(var p in t)b(a,p,{get:t[p],enumerable:!0})},c=(a,t,p,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of n(t))!u.call(a,e)&&e!==p&&b(a,e,{get:()=>t[e],enumerable:!(l=m(t,e))||l.enumerable});return a};var d=a=>c(b({},"__esModule",{value:!0}),a);var h={};r(h,{default:()=>g});module.exports=d(h);var g=[{type:"var",match:/("|')?[a-zA-Z]\w*\1(?=\s*:)/g},{expand:"str"},{expand:"num"},{type:"num",match:/\bnull\b/g},{type:"bool",match:/\b(true|false)\b/g}]; diff --git a/dist/node/languages/leanpub-md.d.ts b/dist/node/languages/leanpub-md.d.ts index de1e942..29a26ee 100644 --- a/dist/node/languages/leanpub-md.d.ts +++ b/dist/node/languages/leanpub-md.d.ts @@ -21,7 +21,7 @@ declare const _default: ({ sub?: undefined; } | { match: RegExp; - sub: (code: string) => import("../index.js").ShjLanguage; + sub: (code: string) => ShjLanguage; type?: undefined; })[]; })[]; diff --git a/dist/node/languages/leanpub-md.js b/dist/node/languages/leanpub-md.js new file mode 100644 index 0000000..547fa4f --- /dev/null +++ b/dist/node/languages/leanpub-md.js @@ -0,0 +1,2 @@ +var l=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var u=(e,t)=>{for(var a in t)l(e,a,{get:t[a],enumerable:!0})},o=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of c(t))!b.call(e,s)&&s!==a&&l(e,s,{get:()=>t[s],enumerable:!(n=i(t,s))||n.enumerable});return e};var d=e=>o(l({},"__esModule",{value:!0}),e);var y={};u(y,{default:()=>f});module.exports=d(y);var h=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],m=e=>{var t;return((t=h.map(([a,...n])=>[a,n.reduce((s,[r,p])=>s+[...e.matchAll(r)].length*p,0)]).filter(([a,n])=>n>20).sort((a,n)=>n[1]-a[1])[0])==null?void 0:t[0])||"plain"};var g=[{type:"cmnt",match:/^>.*|(=|-)\1+/gm},{type:"class",match:/\*\*((?!\*\*).)*\*\*/g},{match:/```((?!```)[^])*\n```/g,sub:e=>({type:"kwd",sub:[{match:/\n[^]*(?=```)/g,sub:e.split(` +`)[0].slice(3)||m(e)}]})},{type:"str",match:/`[^`]*`/g},{type:"var",match:/~~((?!~~).)*~~/g},{type:"kwd",match:/_[^_]*_|\*[^*]*\*/g},{type:"kwd",match:/^\s*(\*|\d+\.)\s/gm},{type:"oper",match:/\[[^\]]*]/g},{type:"func",match:/\([^)]*\)/g}];var f=[{type:"insert",match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:"insert",match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:m}]},{type:"deleted",match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:"deleted",match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:m}]},...g]; diff --git a/dist/node/languages/log.js b/dist/node/languages/log.js new file mode 100644 index 0000000..10f54b8 --- /dev/null +++ b/dist/node/languages/log.js @@ -0,0 +1 @@ +var r=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},b=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of p(e))!i.call(t,a)&&a!==n&&r(t,a,{get:()=>e[a],enumerable:!(o=l(e,a))||o.enumerable});return t};var d=t=>b(r({},"__esModule",{value:!0}),t);var c={};m(c,{default:()=>u});module.exports=d(c);var u=[{type:"cmnt",match:/^#.*/gm},{expand:"strDouble"},{expand:"num"},{type:"err",match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:"num",match:/\b(null|undefined)\b/gi},{type:"bool",match:/\b(false|true|yes|no)\b/gi},{type:"oper",match:/\.|,/g}]; diff --git a/dist/node/languages/lua.js b/dist/node/languages/lua.js new file mode 100644 index 0000000..14060a8 --- /dev/null +++ b/dist/node/languages/lua.js @@ -0,0 +1 @@ +var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},u=(t,e,n,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of p(e))!c.call(t,a)&&a!==n&&o(t,a,{get:()=>e[a],enumerable:!(l=r(e,a))||l.enumerable});return t};var b=t=>u(o({},"__esModule",{value:!0}),t);var h={};d(h,{default:()=>f});module.exports=b(h);var f=[{match:/^#!.*|--(\[(=*)\[((?!--\]\2\])[^])*--\]\2\]|.*)/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:"bool",match:/\b(true|false|nil)\b/g},{type:"oper",match:/[+*/%^#=~<>:,.-]+/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*[({])/g}]; diff --git a/dist/node/languages/make.js b/dist/node/languages/make.js new file mode 100644 index 0000000..54ea1c6 --- /dev/null +++ b/dist/node/languages/make.js @@ -0,0 +1 @@ +var c=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(a,t)=>{for(var m in t)c(a,m,{get:t[m],enumerable:!0})},n=(a,t,m,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of h(t))!g.call(a,e)&&e!==m&&c(a,e,{get:()=>t[e],enumerable:!(p=s(t,e))||p.enumerable});return a};var b=a=>n(c({},"__esModule",{value:!0}),a);var y={};d(y,{default:()=>o});module.exports=b(y);var o=[{match:/^\s*#.*/gm,sub:"todo"},{expand:"str"},{type:"oper",match:/[${}()]+/g},{type:"class",match:/.PHONY:/gm},{type:"section",match:/^[\w.]+:/gm},{type:"kwd",match:/\b(ifneq|endif)\b/g},{expand:"num"},{type:"var",match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:"bash"}]; diff --git a/dist/node/languages/md.js b/dist/node/languages/md.js new file mode 100644 index 0000000..ecfe971 --- /dev/null +++ b/dist/node/languages/md.js @@ -0,0 +1,2 @@ +var g=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var o=(t,a)=>{for(var e in a)g(t,e,{get:a[e],enumerable:!0})},b=(t,a,e,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let m of r(a))!p.call(t,m)&&m!==e&&g(t,m,{get:()=>a[m],enumerable:!(s=l(a,m))||s.enumerable});return t};var u=t=>b(g({},"__esModule",{value:!0}),t);var d={};o(d,{default:()=>h});module.exports=u(d);var f=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],n=t=>{var a;return((a=f.map(([e,...s])=>[e,s.reduce((m,[i,c])=>m+[...t.matchAll(i)].length*c,0)]).filter(([e,s])=>s>20).sort((e,s)=>s[1]-e[1])[0])==null?void 0:a[0])||"plain"};var h=[{type:"cmnt",match:/^>.*|(=|-)\1+/gm},{type:"class",match:/\*\*((?!\*\*).)*\*\*/g},{match:/```((?!```)[^])*\n```/g,sub:t=>({type:"kwd",sub:[{match:/\n[^]*(?=```)/g,sub:t.split(` +`)[0].slice(3)||n(t)}]})},{type:"str",match:/`[^`]*`/g},{type:"var",match:/~~((?!~~).)*~~/g},{type:"kwd",match:/_[^_]*_|\*[^*]*\*/g},{type:"kwd",match:/^\s*(\*|\d+\.)\s/gm},{type:"oper",match:/\[[^\]]*]/g},{type:"func",match:/\([^)]*\)/g}]; diff --git a/dist/node/languages/pl.js b/dist/node/languages/pl.js new file mode 100644 index 0000000..984ecfc --- /dev/null +++ b/dist/node/languages/pl.js @@ -0,0 +1 @@ +var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},d=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of s(e))!l.call(t,a)&&a!==n&&o(t,a,{get:()=>e[a],enumerable:!(r=u(e,a))||r.enumerable});return t};var i=t=>d(o({},"__esModule",{value:!0}),t);var p={};c(p,{default:()=>h});module.exports=i(p);var h=[{match:/#.*/g,sub:"todo"},{type:"str",match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:"num"},{type:"kwd",match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:"oper",match:/[-+*/%~!&<>|=?,]+/g},{type:"func",match:/[a-z_]+(?=\s*\()/g}]; diff --git a/dist/node/languages/plain.js b/dist/node/languages/plain.js new file mode 100644 index 0000000..8f1cc3c --- /dev/null +++ b/dist/node/languages/plain.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var d in e)l(t,d,{get:e[d],enumerable:!0})},b=(t,e,d,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of r(e))!u.call(t,a)&&a!==d&&l(t,a,{get:()=>e[a],enumerable:!(o=p(e,a))||o.enumerable});return t};var f=t=>b(l({},"__esModule",{value:!0}),t);var s={};x(s,{default:()=>n});module.exports=f(s);var n=[{expand:"strDouble"}]; diff --git a/dist/node/languages/py.js b/dist/node/languages/py.js new file mode 100644 index 0000000..505cfab --- /dev/null +++ b/dist/node/languages/py.js @@ -0,0 +1 @@ +var o=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var p=(a,t)=>{for(var s in t)o(a,s,{get:t[s],enumerable:!0})},m=(a,t,s,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of r(t))!b.call(a,e)&&e!==s&&o(a,e,{get:()=>t[e],enumerable:!(l=c(t,e))||l.enumerable});return a};var n=a=>m(o({},"__esModule",{value:!0}),a);var i={};p(i,{default:()=>h});module.exports=n(i);var h=[{match:/#.*/g,sub:"todo"},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:"todo"},{type:"str",match:/f("|')(\\[^]|(?!\1).)*\1?|f((["'])\4\4)(\\[^]|(?!\3)[^])*\3?/gi,sub:[{type:"var",match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:"py"}]}]},{expand:"str"},{type:"kwd",match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:"bool",match:/\b(False|True|None)\b/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*\()/g},{type:"oper",match:/[-/*+<>,=!&|^%]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]; diff --git a/dist/node/languages/regex.js b/dist/node/languages/regex.js new file mode 100644 index 0000000..c3f90df --- /dev/null +++ b/dist/node/languages/regex.js @@ -0,0 +1 @@ +var m=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var a in t)m(e,a,{get:t[a],enumerable:!0})},h=(e,t,a,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of r(t))!c.call(e,p)&&p!==a&&m(e,p,{get:()=>t[p],enumerable:!(d=o(t,p))||d.enumerable});return e};var y=e=>h(m({},"__esModule",{value:!0}),e);var n={};g(n,{default:()=>u,type:()=>l});module.exports=y(n);var u=[{match:/^(?!\/).*/gm,sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match:/\*|\+|\{\d+,\d+\}/g}],l="oper";0&&(module.exports={type}); diff --git a/dist/node/languages/rs.js b/dist/node/languages/rs.js new file mode 100644 index 0000000..96f6324 --- /dev/null +++ b/dist/node/languages/rs.js @@ -0,0 +1 @@ +var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},i=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of o(e))!u.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(n=c(e,a))||n.enumerable});return t};var m=t=>i(s({},"__esModule",{value:!0}),t);var f={};p(f,{default:()=>l});module.exports=m(f);var l=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]; diff --git a/dist/node/languages/sql.js b/dist/node/languages/sql.js new file mode 100644 index 0000000..b80cb63 --- /dev/null +++ b/dist/node/languages/sql.js @@ -0,0 +1 @@ +var R=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var C=(T,E)=>{for(var N in E)R(T,N,{get:E[N],enumerable:!0})},D=(T,E,N,O)=>{if(E&&typeof E=="object"||typeof E=="function")for(let I of L(E))!S.call(T,I)&&I!==N&&R(T,I,{get:()=>E[I],enumerable:!(O=A(E,I))||O.enumerable});return T};var U=T=>D(R({},"__esModule",{value:!0}),T);var P={};C(P,{default:()=>M});module.exports=U(P);var M=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"func",match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:"kwd",match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:"num",match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:"bool",match:/\b(TRUE|FALSE)\b/g},{type:"oper",match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:"var",match:/@\S+/g}]; diff --git a/dist/node/languages/todo.js b/dist/node/languages/todo.js new file mode 100644 index 0000000..a920dd5 --- /dev/null +++ b/dist/node/languages/todo.js @@ -0,0 +1 @@ +var E=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var m=(e,t)=>{for(var p in t)E(e,p,{get:t[p],enumerable:!0})},y=(e,t,p,I)=>{if(t&&typeof t=="object"||typeof t=="function")for(let b of c(t))!r.call(e,b)&&b!==p&&E(e,b,{get:()=>t[b],enumerable:!(I=a(t,b))||I.enumerable});return e};var G=e=>y(E({},"__esModule",{value:!0}),e);var g={};m(g,{default:()=>N,type:()=>X});module.exports=G(g);var N=[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}],X="cmnt";0&&(module.exports={type}); diff --git a/dist/node/languages/toml.js b/dist/node/languages/toml.js new file mode 100644 index 0000000..75dceb8 --- /dev/null +++ b/dist/node/languages/toml.js @@ -0,0 +1 @@ +var p=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var o=(e,t)=>{for(var m in t)p(e,m,{get:t[m],enumerable:!0})},b=(e,t,m,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of g(t))!h.call(e,a)&&a!==m&&p(e,a,{get:()=>t[a],enumerable:!(c=n(t,a))||c.enumerable});return e};var d=e=>b(p({},"__esModule",{value:!0}),e);var s={};o(s,{default:()=>r});module.exports=d(s);var r=[{match:/#.*/g,sub:"todo"},{type:"str",match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:"str"},{type:"section",match:/^\[.+\]\s*$/gm},{type:"num",match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:"num"},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[+,.=-]/g},{type:"var",match:/\w+(?= \=)/g}]; diff --git a/dist/node/languages/ts.js b/dist/node/languages/ts.js new file mode 100644 index 0000000..415575f --- /dev/null +++ b/dist/node/languages/ts.js @@ -0,0 +1 @@ +var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var c in e)n(t,c,{get:e[c],enumerable:!0})},l=(t,e,c,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of p(e))!i.call(t,a)&&a!==c&&n(t,a,{get:()=>e[a],enumerable:!(s=o(e,a))||s.enumerable});return t};var u=t=>l(n({},"__esModule",{value:!0}),t);var d={};m(d,{default:()=>b});module.exports=u(d);var r=[{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,sub:"js_template_literals"},{type:"kwd",match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}];var b=[{type:"type",match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:"kwd",match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...r]; diff --git a/dist/node/languages/uri.js b/dist/node/languages/uri.js new file mode 100644 index 0000000..6750e02 --- /dev/null +++ b/dist/node/languages/uri.js @@ -0,0 +1 @@ +var e=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var y=(m,t)=>{for(var c in t)e(m,c,{get:t[c],enumerable:!0})},o=(m,t,c,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of g(t))!h.call(m,a)&&a!==c&&e(m,a,{get:()=>t[a],enumerable:!(p=w(t,a))||p.enumerable});return m};var u=m=>o(e({},"__esModule",{value:!0}),m);var r={};y(r,{default:()=>d});module.exports=u(r);var d=[{match:/^#.*/gm,sub:"todo"},{type:"class",match:/^\w+(?=:?)/gm},{type:"num",match:/:\d+/g},{type:"oper",match:/[:/&?]|\w+=/g},{type:"func",match:/[.\w]+@|#[\w]+$/gm},{type:"var",match:/\w+\.\w+(\.\w+)*/g}]; diff --git a/dist/node/languages/xml.js b/dist/node/languages/xml.js new file mode 100644 index 0000000..c74e9d3 --- /dev/null +++ b/dist/node/languages/xml.js @@ -0,0 +1 @@ +var s=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var l=(a,t)=>{for(var p in t)s(a,p,{get:t[p],enumerable:!0})},o=(a,t,p,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of r(t))!y.call(a,e)&&e!==p&&s(a,e,{get:()=>t[e],enumerable:!(c=h(t,e))||c.enumerable});return a};var x=a=>o(s({},"__esModule",{value:!0}),a);var b={};l(b,{default:()=>u,property:()=>m,xmlElement:()=>g});module.exports=x(b);var m=`\\s*(\\s+[a-z-]+\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,g={match:RegExp(``,"g"),sub:[{type:"var",match:/^<\/?[^\s>\/]+/g,sub:[{type:"oper",match:/^<\/?/g}]},{type:"str",match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/\/?>/g},{type:"class",match:/[a-z-]+/gi}]},u=[{match:/)[^])*-->/g,sub:"todo"},{type:"class",match:RegExp(`<\\?xml${m}\\?>`,"gi"),sub:[{type:"oper",match:/^<\?|\?>$/g},{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"var",match:/xml/gi}]},{type:"class",match://gi},g,{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];0&&(module.exports={property,xmlElement}); diff --git a/dist/node/languages/yaml.js b/dist/node/languages/yaml.js new file mode 100644 index 0000000..013b4e0 --- /dev/null +++ b/dist/node/languages/yaml.js @@ -0,0 +1 @@ +var m=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(a,t)=>{for(var p in t)m(a,p,{get:t[p],enumerable:!0})},n=(a,t,p,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of c(t))!g.call(a,e)&&e!==p&&m(a,e,{get:()=>t[e],enumerable:!(o=r(t,e))||o.enumerable});return a};var y=a=>n(m({},"__esModule",{value:!0}),a);var b={};h(b,{default:()=>s});module.exports=y(b);var s=[{match:/#.*/g,sub:"todo"},{expand:"str"},{type:"str",match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:"type",match:/!![a-z]+/g},{type:"bool",match:/\b(Yes|No)\b/g},{type:"oper",match:/[+:-]/g},{expand:"num"},{type:"var",match:/[a-zA-Z]\w*(?=:)/g}]; diff --git a/dist/node/terminal.d.ts b/dist/node/terminal.d.ts index b1c1066..48b835b 100644 --- a/dist/node/terminal.d.ts +++ b/dist/node/terminal.d.ts @@ -1,9 +1,9 @@ export function highlightText(src: string, lang: ShjLanguage): Promise; export function printHighlight(src: string, lang: ShjLanguage): Promise; export function setTheme(name: ShjTerminalTheme): Promise; -export type ShjLanguage = import('./index.js').ShjLanguage; +export type ShjLanguage = import("./index.js").ShjLanguage; /** * Languages supported */ -export type ShjTerminalTheme = ('default' | 'atom-dark'); +export type ShjTerminalTheme = ("default" | "atom-dark"); //# sourceMappingURL=terminal.d.ts.map \ No newline at end of file diff --git a/dist/node/terminal.d.ts.map b/dist/node/terminal.d.ts.map index f4c113c..a57abc6 100644 --- a/dist/node/terminal.d.ts.map +++ b/dist/node/terminal.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/terminal.js"],"names":[],"mappings":"AA2BO,mCAJI,MAAM,QACN,WAAW,GACT,QAAQ,MAAM,CAAC,CAQ3B;AAUM,oCAHI,MAAM,QACN,WAAW,gBAEwE;AAQvF,+BAFI,gBAAgB,gBAEgD;0BA7C9D,OAAO,YAAY,EAAE,WAAW;;;;+BAKhC,CAAC,SAAS,GAAC,WAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/terminal.js"],"names":[],"mappings":"AA2BO,mCAJI,MAAM,QACN,WAAW,GACT,OAAO,CAAC,MAAM,CAAC,CAQ3B;AAUM,oCAHI,MAAM,QACN,WAAW,gBAEwE;AAQvF,+BAFI,gBAAgB,gBAEgD;0BA7C9D,OAAO,YAAY,EAAE,WAAW;;;;+BAKhC,CAAC,SAAS,GAAC,WAAW,CAAC"} \ No newline at end of file diff --git a/dist/node/terminal.js b/dist/node/terminal.js new file mode 100644 index 0000000..6ed8179 --- /dev/null +++ b/dist/node/terminal.js @@ -0,0 +1,2 @@ +var I=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var se=Object.prototype.hasOwnProperty;var d=e=>t=>{var c=e[t];if(c)return c();throw new Error("Module not found in bundle: "+t)};var a=(e,t)=>()=>(e&&(t=e(e=0)),t);var s=(e,t)=>{for(var c in t)I(e,c,{get:t[c],enumerable:!0})},pe=(e,t,c,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ae(t))!se.call(e,n)&&n!==c&&I(e,n,{get:()=>t[n],enumerable:!(m=ee(t,n))||m.enumerable});return e};var ne=e=>pe(I({},"__esModule",{value:!0}),e);var F={};s(F,{default:()=>ce});var ce,k=a(()=>{ce=[{type:"cmnt",match:/(;|#).*/gm},{expand:"str"},{expand:"num"},{type:"num",match:/\$[\da-fA-F]*\b/g},{type:"kwd",match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:"func",match:/^[a-z]+/g}]},{type:"kwd",match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:"oper"}]});var z={};s(z,{default:()=>N});var H,N,A=a(()=>{H={type:"var",match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},N=[{sub:"todo",match:/#.*/g},{type:"str",match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[H]},{type:"oper",match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:"kwd",match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:"num"},{type:"func",match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi},{type:"bool",match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:"oper",match:/[=(){}<>!]+/g},{type:"var",match:/(?<=\s|^)[\w_]+(?=\s*=)/g},H]});var _={};s(_,{default:()=>re});var re,Y=a(()=>{re=[{match:/[^\[\->+.<\]\s].*/g,sub:"todo"},{type:"func",match:/\.+/g},{type:"kwd",match:/[<>]+/g},{type:"oper",match:/[+-]+/g}]});var Z={};s(Z,{default:()=>me});var me,X=a(()=>{me=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/#\s*include (<.*>|".*")/g,sub:[{type:"str",match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:"kwd",match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:"asm"}]},{type:"kwd",match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var W={};s(W,{default:()=>oe});var oe,j=a(()=>{oe=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:"var",match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:"func",match:/#[\w-]+(?=[^{}]*{)/g},{type:"num",match:/#[\da-f]{3,8}/g},{type:"num",match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:"var",match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:"func",match:/url(?=\()/g},{type:"str",match:/[^()]+/g}]},{type:"func",match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:"num",match:/\b[a-z-]+\b/g}]});var K={};s(K,{default:()=>le});var le,V=a(()=>{le=[{expand:"strDouble"},{type:"oper",match:/,/g}]});var q={};s(q,{default:()=>R});var R,O=a(()=>{R=[{type:"deleted",match:/^[-<].*/gm},{type:"insert",match:/^[+>].*/gm},{type:"kwd",match:/!.*/gm},{type:"section",match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]});var Q={};s(Q,{default:()=>Ee});var Ee,J=a(()=>{A();Ee=[{type:"kwd",match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gmi},...N]});var tt={};s(tt,{default:()=>ie});var ie,et=a(()=>{O();ie=[{match:/^#.*/gm,sub:"todo"},{expand:"str"},...R,{type:"func",match:/^(\$ )?git(\s.*)?$/gm},{type:"kwd",match:/^commit \w+$/gm}]});var at={};s(at,{default:()=>he});var he,st=a(()=>{he=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"oper",match:/[+\-*\/%&|^~=!<>.^-]+/g}]});var pt={};s(pt,{default:()=>x,property:()=>i,xmlElement:()=>E});var i,E,x,L=a(()=>{i=`\\s*(\\s+[a-z-]+\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,E={match:RegExp(``,"g"),sub:[{type:"var",match:/^<\/?[^\s>\/]+/g,sub:[{type:"oper",match:/^<\/?/g}]},{type:"str",match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/\/?>/g},{type:"class",match:/[a-z-]+/gi}]},x=[{match:/)[^])*-->/g,sub:"todo"},{type:"class",match:RegExp(`<\\?xml${i}\\?>`,"gi"),sub:[{type:"oper",match:/^<\?|\?>$/g},{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"var",match:/xml/gi}]},{type:"class",match://gi},E,{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}]});var nt={};s(nt,{default:()=>ge});var ge,ct=a(()=>{L();ge=[{type:"class",match:/])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:E.sub},{match:RegExp(`${E.match}|[^]*(?=$)`,"g"),sub:"css"},E]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:E.sub},{match:RegExp(`${E.match}|[^]*(?=$)`,"g"),sub:"js"},E]},...x]});var ue,h,b=a(()=>{ue=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],h=e=>{var t;return((t=ue.map(([c,...m])=>[c,m.reduce((n,[o,r])=>n+[...e.matchAll(o)].length*r,0)]).filter(([c,m])=>m>20).sort((c,m)=>m[1]-c[1])[0])==null?void 0:t[0])||"plain"}});var rt={};s(rt,{default:()=>de});var de,mt=a(()=>{b();de=[{type:"kwd",match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:"str"},{type:"section",match:/\bHTTP\/[\d.]+\b/g},{expand:"num"},{type:"oper",match:/[,;:=]/g},{type:"var",match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:h}]});var ot={};s(ot,{default:()=>be});var be,lt=a(()=>{be=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:"todo"},{type:"str",match:/.*/g},{type:"var",match:/.*(?==)/g},{type:"section",match:/^\s*\[.+\]\s*$/gm},{type:"oper",match:/=/g}]});var Et={};s(Et,{default:()=>ye});var ye,it=a(()=>{ye=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var ht={};s(ht,{default:()=>S});var S,C=a(()=>{S=[{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,sub:"js_template_literals"},{type:"kwd",match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]});var gt={};s(gt,{default:()=>Te,type:()=>fe});var Te,fe,ut=a(()=>{Te=[{match:new class{exec(e){let t=this.lastIndex,c,m=n=>{for(;++tw,type:()=>Ie});var w,Ie,D=a(()=>{w=[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}],Ie="cmnt"});var bt={};s(bt,{default:()=>Ne,type:()=>Ae});var Ne,Ae,yt=a(()=>{D();Ne=[{type:"kwd",match:/@\w+/g},{type:"class",match:/{[\w\s|<>,.@\[\]]+}/g},{type:"var",match:/\[[\w\s="']+\]/g},...w],Ae="cmnt"});var Tt={};s(Tt,{default:()=>Re});var Re,ft=a(()=>{Re=[{type:"var",match:/("|')?[a-zA-Z]\w*\1(?=\s*:)/g},{expand:"str"},{expand:"num"},{type:"num",match:/\bnull\b/g},{type:"bool",match:/\b(true|false)\b/g}]});var It={};s(It,{default:()=>U});var U,P=a(()=>{b();U=[{type:"cmnt",match:/^>.*|(=|-)\1+/gm},{type:"class",match:/\*\*((?!\*\*).)*\*\*/g},{match:/```((?!```)[^])*\n```/g,sub:e=>({type:"kwd",sub:[{match:/\n[^]*(?=```)/g,sub:e.split(` +`)[0].slice(3)||h(e)}]})},{type:"str",match:/`[^`]*`/g},{type:"var",match:/~~((?!~~).)*~~/g},{type:"kwd",match:/_[^_]*_|\*[^*]*\*/g},{type:"kwd",match:/^\s*(\*|\d+\.)\s/gm},{type:"oper",match:/\[[^\]]*]/g},{type:"func",match:/\([^)]*\)/g}]});var Nt={};s(Nt,{default:()=>Oe});var Oe,At=a(()=>{P();b();Oe=[{type:"insert",match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:"insert",match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:h}]},{type:"deleted",match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:"deleted",match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:h}]},...U]});var Rt={};s(Rt,{default:()=>xe});var xe,Ot=a(()=>{xe=[{type:"cmnt",match:/^#.*/gm},{expand:"strDouble"},{expand:"num"},{type:"err",match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:"num",match:/\b(null|undefined)\b/gi},{type:"bool",match:/\b(false|true|yes|no)\b/gi},{type:"oper",match:/\.|,/g}]});var xt={};s(xt,{default:()=>Le});var Le,Lt=a(()=>{Le=[{match:/^#!.*|--(\[(=*)\[((?!--\]\2\])[^])*--\]\2\]|.*)/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:"bool",match:/\b(true|false|nil)\b/g},{type:"oper",match:/[+*/%^#=~<>:,.-]+/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*[({])/g}]});var St={};s(St,{default:()=>Se});var Se,Ct=a(()=>{Se=[{match:/^\s*#.*/gm,sub:"todo"},{expand:"str"},{type:"oper",match:/[${}()]+/g},{type:"class",match:/.PHONY:/gm},{type:"section",match:/^[\w.]+:/gm},{type:"kwd",match:/\b(ifneq|endif)\b/g},{expand:"num"},{type:"var",match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:"bash"}]});var wt={};s(wt,{default:()=>Ce});var Ce,Dt=a(()=>{Ce=[{match:/#.*/g,sub:"todo"},{type:"str",match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:"num"},{type:"kwd",match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:"oper",match:/[-+*/%~!&<>|=?,]+/g},{type:"func",match:/[a-z_]+(?=\s*\()/g}]});var Ut={};s(Ut,{default:()=>we});var we,Pt=a(()=>{we=[{expand:"strDouble"}]});var Mt={};s(Mt,{default:()=>De});var De,vt=a(()=>{De=[{match:/#.*/g,sub:"todo"},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:"todo"},{type:"str",match:/f("|')(\\[^]|(?!\1).)*\1?|f((["'])\4\4)(\\[^]|(?!\3)[^])*\3?/gi,sub:[{type:"var",match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:"py"}]}]},{expand:"str"},{type:"kwd",match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:"bool",match:/\b(False|True|None)\b/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*\()/g},{type:"oper",match:/[-/*+<>,=!&|^%]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var $t={};s($t,{default:()=>Ue,type:()=>Pe});var Ue,Pe,Bt=a(()=>{Ue=[{match:/^(?!\/).*/gm,sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match:/\*|\+|\{\d+,\d+\}/g}],Pe="oper"});var Gt={};s(Gt,{default:()=>Me});var Me,Ft=a(()=>{Me=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]});var kt={};s(kt,{default:()=>ve});var ve,Ht=a(()=>{ve=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"func",match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:"kwd",match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:"num",match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:"bool",match:/\b(TRUE|FALSE)\b/g},{type:"oper",match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:"var",match:/@\S+/g}]});var zt={};s(zt,{default:()=>$e});var $e,_t=a(()=>{$e=[{match:/#.*/g,sub:"todo"},{type:"str",match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:"str"},{type:"section",match:/^\[.+\]\s*$/gm},{type:"num",match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:"num"},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[+,.=-]/g},{type:"var",match:/\w+(?= \=)/g}]});var Yt={};s(Yt,{default:()=>Be});var Be,Zt=a(()=>{C();Be=[{type:"type",match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:"kwd",match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...S]});var Xt={};s(Xt,{default:()=>Ge});var Ge,Wt=a(()=>{Ge=[{match:/^#.*/gm,sub:"todo"},{type:"class",match:/^\w+(?=:?)/gm},{type:"num",match:/:\d+/g},{type:"oper",match:/[:/&?]|\w+=/g},{type:"func",match:/[.\w]+@|#[\w]+$/gm},{type:"var",match:/\w+\.\w+(\.\w+)*/g}]});var jt={};s(jt,{default:()=>Fe});var Fe,Kt=a(()=>{Fe=[{match:/#.*/g,sub:"todo"},{expand:"str"},{type:"str",match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:"type",match:/!![a-z]+/g},{type:"bool",match:/\b(Yes|No)\b/g},{type:"oper",match:/[+:-]/g},{expand:"num"},{type:"var",match:/[a-zA-Z]\w*(?=:)/g}]});var Vt={};s(Vt,{default:()=>p});var p,y=a(()=>{p={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",gray:"\x1B[90m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"}});var qt={};s(qt,{default:()=>He});var He,Qt=a(()=>{y();He={deleted:p.red,var:p.red,err:p.red,kwd:p.magenta,num:p.yellow,class:p.yellow,cmnt:p.gray,insert:p.green,str:p.green,bool:p.cyan,type:p.blue,oper:p.blue,section:p.magenta,func:p.blue}});var $={};s($,{default:()=>ze});var ze,B=a(()=>{y();ze={deleted:p.red,var:p.red,err:p.red,kwd:p.red,num:p.yellow,class:p.yellow,cmnt:p.gray,insert:p.green,str:p.green,bool:p.cyan,type:p.blue,oper:p.blue,section:p.magenta,func:p.magenta}});var Xe={};s(Xe,{highlightText:()=>te,printHighlight:()=>Ye,setTheme:()=>Ze});module.exports=ne(Xe);var G={num:{type:"num",match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:"str",match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:"str",match:/"((?!")[^\r\n\\]|\\[^])*"?/g}};var ke=d({"./languages/asm.js":()=>Promise.resolve().then(()=>(k(),F)),"./languages/bash.js":()=>Promise.resolve().then(()=>(A(),z)),"./languages/bf.js":()=>Promise.resolve().then(()=>(Y(),_)),"./languages/c.js":()=>Promise.resolve().then(()=>(X(),Z)),"./languages/css.js":()=>Promise.resolve().then(()=>(j(),W)),"./languages/csv.js":()=>Promise.resolve().then(()=>(V(),K)),"./languages/diff.js":()=>Promise.resolve().then(()=>(O(),q)),"./languages/docker.js":()=>Promise.resolve().then(()=>(J(),Q)),"./languages/git.js":()=>Promise.resolve().then(()=>(et(),tt)),"./languages/go.js":()=>Promise.resolve().then(()=>(st(),at)),"./languages/html.js":()=>Promise.resolve().then(()=>(ct(),nt)),"./languages/http.js":()=>Promise.resolve().then(()=>(mt(),rt)),"./languages/ini.js":()=>Promise.resolve().then(()=>(lt(),ot)),"./languages/java.js":()=>Promise.resolve().then(()=>(it(),Et)),"./languages/js.js":()=>Promise.resolve().then(()=>(C(),ht)),"./languages/js_template_literals.js":()=>Promise.resolve().then(()=>(ut(),gt)),"./languages/jsdoc.js":()=>Promise.resolve().then(()=>(yt(),bt)),"./languages/json.js":()=>Promise.resolve().then(()=>(ft(),Tt)),"./languages/leanpub-md.js":()=>Promise.resolve().then(()=>(At(),Nt)),"./languages/log.js":()=>Promise.resolve().then(()=>(Ot(),Rt)),"./languages/lua.js":()=>Promise.resolve().then(()=>(Lt(),xt)),"./languages/make.js":()=>Promise.resolve().then(()=>(Ct(),St)),"./languages/md.js":()=>Promise.resolve().then(()=>(P(),It)),"./languages/pl.js":()=>Promise.resolve().then(()=>(Dt(),wt)),"./languages/plain.js":()=>Promise.resolve().then(()=>(Pt(),Ut)),"./languages/py.js":()=>Promise.resolve().then(()=>(vt(),Mt)),"./languages/regex.js":()=>Promise.resolve().then(()=>(Bt(),$t)),"./languages/rs.js":()=>Promise.resolve().then(()=>(Ft(),Gt)),"./languages/sql.js":()=>Promise.resolve().then(()=>(Ht(),kt)),"./languages/todo.js":()=>Promise.resolve().then(()=>(D(),dt)),"./languages/toml.js":()=>Promise.resolve().then(()=>(_t(),zt)),"./languages/ts.js":()=>Promise.resolve().then(()=>(Zt(),Yt)),"./languages/uri.js":()=>Promise.resolve().then(()=>(Wt(),Xt)),"./languages/xml.js":()=>Promise.resolve().then(()=>(L(),pt)),"./languages/yaml.js":()=>Promise.resolve().then(()=>(Kt(),jt))});var M={};async function v(e,t,c){var m;try{let n,o,r={},T,l=[],g=0,f=typeof t=="string"?await((m=M[t])!=null?m:M[t]=ke(`./languages/${t}.js`)):t,u=[...typeof t=="string"?f.default:t.sub];for(;g0;){if(o=u[n].expand?G[u[n].expand]:u[n],l[n]===void 0||l[n].match.indexPromise.resolve().then(()=>(Qt(),qt)),"./themes/default.js":()=>Promise.resolve().then(()=>(B(),$)),"./themes/termcolor.js":()=>Promise.resolve().then(()=>(y(),Vt))});var Jt=Promise.resolve().then(()=>(B(),$)),te=async(e,t)=>{let c="",m=(await Jt).default;return await v(e,t,(n,o)=>{var r;return c+=o?`${(r=m[o])!=null?r:""}${n}\x1B[0m`:n}),c},Ye=async(e,t)=>console.log(await te(e,t)),Ze=async e=>Jt=_e(`./themes/${e}.js`);0&&(module.exports={highlightText,printHighlight,setTheme}); diff --git a/dist/node/themes/atom-dark.js b/dist/node/themes/atom-dark.js new file mode 100644 index 0000000..286075e --- /dev/null +++ b/dist/node/themes/atom-dark.js @@ -0,0 +1 @@ +var b=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var d=(l,r)=>{for(var a in r)b(l,a,{get:r[a],enumerable:!0})},c=(l,r,a,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of o(r))!x.call(l,m)&&m!==a&&b(l,m,{get:()=>r[m],enumerable:!(t=n(r,m))||t.enumerable});return l};var g=l=>c(b({},"__esModule",{value:!0}),l);var y={};d(y,{default:()=>u});module.exports=g(y);var e={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",gray:"\x1B[90m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"};var u={deleted:e.red,var:e.red,err:e.red,kwd:e.magenta,num:e.yellow,class:e.yellow,cmnt:e.gray,insert:e.green,str:e.green,bool:e.cyan,type:e.blue,oper:e.blue,section:e.magenta,func:e.blue}; diff --git a/dist/node/themes/default.js b/dist/node/themes/default.js new file mode 100644 index 0000000..7ad95a4 --- /dev/null +++ b/dist/node/themes/default.js @@ -0,0 +1 @@ +var t=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var d=(l,r)=>{for(var a in r)t(l,a,{get:r[a],enumerable:!0})},c=(l,r,a,b)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of o(r))!x.call(l,m)&&m!==a&&t(l,m,{get:()=>r[m],enumerable:!(b=n(r,m))||b.enumerable});return l};var g=l=>c(t({},"__esModule",{value:!0}),l);var u={};d(u,{default:()=>y});module.exports=g(u);var e={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",gray:"\x1B[90m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"};var y={deleted:e.red,var:e.red,err:e.red,kwd:e.red,num:e.yellow,class:e.yellow,cmnt:e.gray,insert:e.green,str:e.green,bool:e.cyan,type:e.blue,oper:e.blue,section:e.magenta,func:e.magenta}; diff --git a/dist/node/themes/termcolor.js b/dist/node/themes/termcolor.js new file mode 100644 index 0000000..eff3df0 --- /dev/null +++ b/dist/node/themes/termcolor.js @@ -0,0 +1 @@ +var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var n=(m,b)=>{for(var e in b)a(m,e,{get:b[e],enumerable:!0})},y=(m,b,e,l)=>{if(b&&typeof b=="object"||typeof b=="function")for(let x of t(b))!g.call(m,x)&&x!==e&&a(m,x,{get:()=>b[x],enumerable:!(l=r(b,x))||l.enumerable});return m};var c=m=>y(a({},"__esModule",{value:!0}),m);var o={};n(o,{default:()=>d});module.exports=c(o);var d={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",gray:"\x1B[90m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"}; diff --git a/dist/terminal.d.ts b/dist/terminal.d.ts index b1c1066..48b835b 100644 --- a/dist/terminal.d.ts +++ b/dist/terminal.d.ts @@ -1,9 +1,9 @@ export function highlightText(src: string, lang: ShjLanguage): Promise; export function printHighlight(src: string, lang: ShjLanguage): Promise; export function setTheme(name: ShjTerminalTheme): Promise; -export type ShjLanguage = import('./index.js').ShjLanguage; +export type ShjLanguage = import("./index.js").ShjLanguage; /** * Languages supported */ -export type ShjTerminalTheme = ('default' | 'atom-dark'); +export type ShjTerminalTheme = ("default" | "atom-dark"); //# sourceMappingURL=terminal.d.ts.map \ No newline at end of file diff --git a/dist/terminal.d.ts.map b/dist/terminal.d.ts.map index f9bf793..e65a954 100644 --- a/dist/terminal.d.ts.map +++ b/dist/terminal.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../src/terminal.js"],"names":[],"mappings":"AA2BO,mCAJI,MAAM,QACN,WAAW,GACT,QAAQ,MAAM,CAAC,CAQ3B;AAUM,oCAHI,MAAM,QACN,WAAW,gBAEwE;AAQvF,+BAFI,gBAAgB,gBAEgD;0BA7C9D,OAAO,YAAY,EAAE,WAAW;;;;+BAKhC,CAAC,SAAS,GAAC,WAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../src/terminal.js"],"names":[],"mappings":"AA2BO,mCAJI,MAAM,QACN,WAAW,GACT,OAAO,CAAC,MAAM,CAAC,CAQ3B;AAUM,oCAHI,MAAM,QACN,WAAW,gBAEwE;AAQvF,+BAFI,gBAAgB,gBAEgD;0BA7C9D,OAAO,YAAY,EAAE,WAAW;;;;+BAKhC,CAAC,SAAS,GAAC,WAAW,CAAC"} \ No newline at end of file diff --git a/dist/terminal.js b/dist/terminal.js new file mode 100644 index 0000000..dc2d612 --- /dev/null +++ b/dist/terminal.js @@ -0,0 +1,2 @@ +var Qt=Object.defineProperty;var u=s=>t=>{var n=s[t];if(n)return n();throw new Error("Module not found in bundle: "+t)};var e=(s,t)=>()=>(s&&(t=s(s=0)),t);var a=(s,t)=>{for(var n in t)Qt(s,n,{get:t[n],enumerable:!0})};var B={};a(B,{default:()=>Jt});var Jt,G=e(()=>{Jt=[{type:"cmnt",match:/(;|#).*/gm},{expand:"str"},{expand:"num"},{type:"num",match:/\$[\da-fA-F]*\b/g},{type:"kwd",match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:"func",match:/^[a-z]+/g}]},{type:"kwd",match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:"oper"}]});var k={};a(k,{default:()=>f});var F,f,I=e(()=>{F={type:"var",match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},f=[{sub:"todo",match:/#.*/g},{type:"str",match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[F]},{type:"oper",match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:"kwd",match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:"num"},{type:"func",match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi},{type:"bool",match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:"oper",match:/[=(){}<>!]+/g},{type:"var",match:/(?<=\s|^)[\w_]+(?=\s*=)/g},F]});var H={};a(H,{default:()=>te});var te,z=e(()=>{te=[{match:/[^\[\->+.<\]\s].*/g,sub:"todo"},{type:"func",match:/\.+/g},{type:"kwd",match:/[<>]+/g},{type:"oper",match:/[+-]+/g}]});var _={};a(_,{default:()=>ee});var ee,Y=e(()=>{ee=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/#\s*include (<.*>|".*")/g,sub:[{type:"str",match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:"kwd",match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:"asm"}]},{type:"kwd",match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var Z={};a(Z,{default:()=>ae});var ae,X=e(()=>{ae=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:"var",match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:"func",match:/#[\w-]+(?=[^{}]*{)/g},{type:"num",match:/#[\da-f]{3,8}/g},{type:"num",match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:"var",match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:"func",match:/url(?=\()/g},{type:"str",match:/[^()]+/g}]},{type:"func",match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:"num",match:/\b[a-z-]+\b/g}]});var W={};a(W,{default:()=>se});var se,j=e(()=>{se=[{expand:"strDouble"},{type:"oper",match:/,/g}]});var K={};a(K,{default:()=>N});var N,A=e(()=>{N=[{type:"deleted",match:/^[-<].*/gm},{type:"insert",match:/^[+>].*/gm},{type:"kwd",match:/!.*/gm},{type:"section",match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]});var V={};a(V,{default:()=>pe});var pe,q=e(()=>{I();pe=[{type:"kwd",match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gmi},...f]});var Q={};a(Q,{default:()=>ne});var ne,J=e(()=>{A();ne=[{match:/^#.*/gm,sub:"todo"},{expand:"str"},...N,{type:"func",match:/^(\$ )?git(\s.*)?$/gm},{type:"kwd",match:/^commit \w+$/gm}]});var tt={};a(tt,{default:()=>ce});var ce,et=e(()=>{ce=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"oper",match:/[+\-*\/%&|^~=!<>.^-]+/g}]});var at={};a(at,{default:()=>R,property:()=>E,xmlElement:()=>l});var E,l,R,O=e(()=>{E=`\\s*(\\s+[a-z-]+\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,l={match:RegExp(``,"g"),sub:[{type:"var",match:/^<\/?[^\s>\/]+/g,sub:[{type:"oper",match:/^<\/?/g}]},{type:"str",match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/\/?>/g},{type:"class",match:/[a-z-]+/gi}]},R=[{match:/)[^])*-->/g,sub:"todo"},{type:"class",match:RegExp(`<\\?xml${E}\\?>`,"gi"),sub:[{type:"oper",match:/^<\?|\?>$/g},{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"var",match:/xml/gi}]},{type:"class",match://gi},l,{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}]});var st={};a(st,{default:()=>re});var re,pt=e(()=>{O();re=[{type:"class",match:/])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`((?!)[^])*`,"g"),sub:[{match:RegExp(`^`,"g"),sub:l.sub},{match:RegExp(`${l.match}|[^]*(?=$)`,"g"),sub:"css"},l]},{match:RegExp(`((?!<\/script>)[^])*<\/script\\s*>`,"g"),sub:[{match:RegExp(`^`,"g"),sub:l.sub},{match:RegExp(`${l.match}|[^]*(?=<\/script\\s*>$)`,"g"),sub:"js"},l]},...R]});var me,i,d=e(()=>{me=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gmi,10]]],i=s=>me.map(([t,...n])=>[t,n.reduce((c,[m,r])=>c+[...s.matchAll(m)].length*r,0)]).filter(([t,n])=>n>20).sort((t,n)=>n[1]-t[1])[0]?.[0]||"plain"});var nt={};a(nt,{default:()=>oe});var oe,ct=e(()=>{d();oe=[{type:"kwd",match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:"str"},{type:"section",match:/\bHTTP\/[\d.]+\b/g},{expand:"num"},{type:"oper",match:/[,;:=]/g},{type:"var",match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:i}]});var rt={};a(rt,{default:()=>le});var le,mt=e(()=>{le=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:"todo"},{type:"str",match:/.*/g},{type:"var",match:/.*(?==)/g},{type:"section",match:/^\s*\[.+\]\s*$/gm},{type:"oper",match:/=/g}]});var ot={};a(ot,{default:()=>Ee});var Ee,lt=e(()=>{Ee=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var Et={};a(Et,{default:()=>x});var x,L=e(()=>{x=[{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,sub:"js_template_literals"},{type:"kwd",match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]});var it={};a(it,{default:()=>ie,type:()=>he});var ie,he,ht=e(()=>{ie=[{match:new class{exec(s){let t=this.lastIndex,n,c=m=>{for(;++tS,type:()=>ge});var S,ge,C=e(()=>{S=[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}],ge="cmnt"});var ut={};a(ut,{default:()=>ue,type:()=>de});var ue,de,dt=e(()=>{C();ue=[{type:"kwd",match:/@\w+/g},{type:"class",match:/{[\w\s|<>,.@\[\]]+}/g},{type:"var",match:/\[[\w\s="']+\]/g},...S],de="cmnt"});var bt={};a(bt,{default:()=>be});var be,yt=e(()=>{be=[{type:"var",match:/("|')?[a-zA-Z]\w*\1(?=\s*:)/g},{expand:"str"},{expand:"num"},{type:"num",match:/\bnull\b/g},{type:"bool",match:/\b(true|false)\b/g}]});var Tt={};a(Tt,{default:()=>w});var w,D=e(()=>{d();w=[{type:"cmnt",match:/^>.*|(=|-)\1+/gm},{type:"class",match:/\*\*((?!\*\*).)*\*\*/g},{match:/```((?!```)[^])*\n```/g,sub:s=>({type:"kwd",sub:[{match:/\n[^]*(?=```)/g,sub:s.split(` +`)[0].slice(3)||i(s)}]})},{type:"str",match:/`[^`]*`/g},{type:"var",match:/~~((?!~~).)*~~/g},{type:"kwd",match:/_[^_]*_|\*[^*]*\*/g},{type:"kwd",match:/^\s*(\*|\d+\.)\s/gm},{type:"oper",match:/\[[^\]]*]/g},{type:"func",match:/\([^)]*\)/g}]});var ft={};a(ft,{default:()=>ye});var ye,It=e(()=>{D();d();ye=[{type:"insert",match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:"insert",match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:i}]},{type:"deleted",match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:"deleted",match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:i}]},...w]});var Nt={};a(Nt,{default:()=>Te});var Te,At=e(()=>{Te=[{type:"cmnt",match:/^#.*/gm},{expand:"strDouble"},{expand:"num"},{type:"err",match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:"num",match:/\b(null|undefined)\b/gi},{type:"bool",match:/\b(false|true|yes|no)\b/gi},{type:"oper",match:/\.|,/g}]});var Rt={};a(Rt,{default:()=>fe});var fe,Ot=e(()=>{fe=[{match:/^#!.*|--(\[(=*)\[((?!--\]\2\])[^])*--\]\2\]|.*)/g,sub:"todo"},{expand:"str"},{type:"kwd",match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:"bool",match:/\b(true|false|nil)\b/g},{type:"oper",match:/[+*/%^#=~<>:,.-]+/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*[({])/g}]});var xt={};a(xt,{default:()=>Ie});var Ie,Lt=e(()=>{Ie=[{match:/^\s*#.*/gm,sub:"todo"},{expand:"str"},{type:"oper",match:/[${}()]+/g},{type:"class",match:/.PHONY:/gm},{type:"section",match:/^[\w.]+:/gm},{type:"kwd",match:/\b(ifneq|endif)\b/g},{expand:"num"},{type:"var",match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:"bash"}]});var St={};a(St,{default:()=>Ne});var Ne,Ct=e(()=>{Ne=[{match:/#.*/g,sub:"todo"},{type:"str",match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:"num"},{type:"kwd",match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:"oper",match:/[-+*/%~!&<>|=?,]+/g},{type:"func",match:/[a-z_]+(?=\s*\()/g}]});var wt={};a(wt,{default:()=>Ae});var Ae,Dt=e(()=>{Ae=[{expand:"strDouble"}]});var Ut={};a(Ut,{default:()=>Re});var Re,Pt=e(()=>{Re=[{match:/#.*/g,sub:"todo"},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:"todo"},{type:"str",match:/f("|')(\\[^]|(?!\1).)*\1?|f((["'])\4\4)(\\[^]|(?!\3)[^])*\3?/gi,sub:[{type:"var",match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:"py"}]}]},{expand:"str"},{type:"kwd",match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:"bool",match:/\b(False|True|None)\b/g},{expand:"num"},{type:"func",match:/[a-z_]+(?=\s*\()/g},{type:"oper",match:/[-/*+<>,=!&|^%]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g}]});var Mt={};a(Mt,{default:()=>Oe,type:()=>xe});var Oe,xe,vt=e(()=>{Oe=[{match:/^(?!\/).*/gm,sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match:/\*|\+|\{\d+,\d+\}/g}],xe="oper"});var $t={};a($t,{default:()=>Le});var Le,Bt=e(()=>{Le=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{expand:"num"},{type:"kwd",match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]});var Gt={};a(Gt,{default:()=>Se});var Se,Ft=e(()=>{Se=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:"todo"},{expand:"str"},{type:"func",match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:"kwd",match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:"num",match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:"bool",match:/\b(TRUE|FALSE)\b/g},{type:"oper",match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:"var",match:/@\S+/g}]});var kt={};a(kt,{default:()=>Ce});var Ce,Ht=e(()=>{Ce=[{match:/#.*/g,sub:"todo"},{type:"str",match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:"str"},{type:"section",match:/^\[.+\]\s*$/gm},{type:"num",match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:"num"},{type:"bool",match:/\b(true|false)\b/g},{type:"oper",match:/[+,.=-]/g},{type:"var",match:/\w+(?= \=)/g}]});var zt={};a(zt,{default:()=>we});var we,_t=e(()=>{L();we=[{type:"type",match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:"kwd",match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...x]});var Yt={};a(Yt,{default:()=>De});var De,Zt=e(()=>{De=[{match:/^#.*/gm,sub:"todo"},{type:"class",match:/^\w+(?=:?)/gm},{type:"num",match:/:\d+/g},{type:"oper",match:/[:/&?]|\w+=/g},{type:"func",match:/[.\w]+@|#[\w]+$/gm},{type:"var",match:/\w+\.\w+(\.\w+)*/g}]});var Xt={};a(Xt,{default:()=>Ue});var Ue,Wt=e(()=>{Ue=[{match:/#.*/g,sub:"todo"},{expand:"str"},{type:"str",match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:"type",match:/!![a-z]+/g},{type:"bool",match:/\b(Yes|No)\b/g},{type:"oper",match:/[+:-]/g},{expand:"num"},{type:"var",match:/[a-zA-Z]\w*(?=:)/g}]});var jt={};a(jt,{default:()=>p});var p,b=e(()=>{p={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",gray:"\x1B[90m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"}});var Kt={};a(Kt,{default:()=>Me});var Me,Vt=e(()=>{b();Me={deleted:p.red,var:p.red,err:p.red,kwd:p.magenta,num:p.yellow,class:p.yellow,cmnt:p.gray,insert:p.green,str:p.green,bool:p.cyan,type:p.blue,oper:p.blue,section:p.magenta,func:p.blue}});var M={};a(M,{default:()=>ve});var ve,v=e(()=>{b();ve={deleted:p.red,var:p.red,err:p.red,kwd:p.red,num:p.yellow,class:p.yellow,cmnt:p.gray,insert:p.green,str:p.green,bool:p.cyan,type:p.blue,oper:p.blue,section:p.magenta,func:p.magenta}});var $={num:{type:"num",match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:"str",match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:"str",match:/"((?!")[^\r\n\\]|\\[^])*"?/g}};var Pe=u({"./languages/asm.js":()=>Promise.resolve().then(()=>(G(),B)),"./languages/bash.js":()=>Promise.resolve().then(()=>(I(),k)),"./languages/bf.js":()=>Promise.resolve().then(()=>(z(),H)),"./languages/c.js":()=>Promise.resolve().then(()=>(Y(),_)),"./languages/css.js":()=>Promise.resolve().then(()=>(X(),Z)),"./languages/csv.js":()=>Promise.resolve().then(()=>(j(),W)),"./languages/diff.js":()=>Promise.resolve().then(()=>(A(),K)),"./languages/docker.js":()=>Promise.resolve().then(()=>(q(),V)),"./languages/git.js":()=>Promise.resolve().then(()=>(J(),Q)),"./languages/go.js":()=>Promise.resolve().then(()=>(et(),tt)),"./languages/html.js":()=>Promise.resolve().then(()=>(pt(),st)),"./languages/http.js":()=>Promise.resolve().then(()=>(ct(),nt)),"./languages/ini.js":()=>Promise.resolve().then(()=>(mt(),rt)),"./languages/java.js":()=>Promise.resolve().then(()=>(lt(),ot)),"./languages/js.js":()=>Promise.resolve().then(()=>(L(),Et)),"./languages/js_template_literals.js":()=>Promise.resolve().then(()=>(ht(),it)),"./languages/jsdoc.js":()=>Promise.resolve().then(()=>(dt(),ut)),"./languages/json.js":()=>Promise.resolve().then(()=>(yt(),bt)),"./languages/leanpub-md.js":()=>Promise.resolve().then(()=>(It(),ft)),"./languages/log.js":()=>Promise.resolve().then(()=>(At(),Nt)),"./languages/lua.js":()=>Promise.resolve().then(()=>(Ot(),Rt)),"./languages/make.js":()=>Promise.resolve().then(()=>(Lt(),xt)),"./languages/md.js":()=>Promise.resolve().then(()=>(D(),Tt)),"./languages/pl.js":()=>Promise.resolve().then(()=>(Ct(),St)),"./languages/plain.js":()=>Promise.resolve().then(()=>(Dt(),wt)),"./languages/py.js":()=>Promise.resolve().then(()=>(Pt(),Ut)),"./languages/regex.js":()=>Promise.resolve().then(()=>(vt(),Mt)),"./languages/rs.js":()=>Promise.resolve().then(()=>(Bt(),$t)),"./languages/sql.js":()=>Promise.resolve().then(()=>(Ft(),Gt)),"./languages/todo.js":()=>Promise.resolve().then(()=>(C(),gt)),"./languages/toml.js":()=>Promise.resolve().then(()=>(Ht(),kt)),"./languages/ts.js":()=>Promise.resolve().then(()=>(_t(),zt)),"./languages/uri.js":()=>Promise.resolve().then(()=>(Zt(),Yt)),"./languages/xml.js":()=>Promise.resolve().then(()=>(O(),at)),"./languages/yaml.js":()=>Promise.resolve().then(()=>(Wt(),Xt))});var U={};async function P(s,t,n){try{let c,m,r={},y,o=[],h=0,T=typeof t=="string"?await(U[t]??(U[t]=Pe(`./languages/${t}.js`))):t,g=[...typeof t=="string"?T.default:t.sub];for(;h0;){if(m=g[c].expand?$[g[c].expand]:g[c],o[c]===void 0||o[c].match.indexPromise.resolve().then(()=>(Vt(),Kt)),"./themes/default.js":()=>Promise.resolve().then(()=>(v(),M)),"./themes/termcolor.js":()=>Promise.resolve().then(()=>(b(),jt))});var qt=Promise.resolve().then(()=>(v(),M)),Be=async(s,t)=>{let n="",c=(await qt).default;return await P(s,t,(m,r)=>n+=r?`${c[r]??""}${m}\x1B[0m`:m),n},ra=async(s,t)=>console.log(await Be(s,t)),ma=async s=>qt=$e(`./themes/${s}.js`);export{Be as highlightText,ra as printHighlight,ma as setTheme}; diff --git a/dist/themes/atom-dark.js b/dist/themes/atom-dark.js new file mode 100644 index 0000000..c3bdf53 --- /dev/null +++ b/dist/themes/atom-dark.js @@ -0,0 +1 @@ +var e={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",gray:"\x1B[90m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"};var m={deleted:e.red,var:e.red,err:e.red,kwd:e.magenta,num:e.yellow,class:e.yellow,cmnt:e.gray,insert:e.green,str:e.green,bool:e.cyan,type:e.blue,oper:e.blue,section:e.magenta,func:e.blue};export{m as default}; diff --git a/dist/themes/default.js b/dist/themes/default.js new file mode 100644 index 0000000..fa6aa8a --- /dev/null +++ b/dist/themes/default.js @@ -0,0 +1 @@ +var e={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",gray:"\x1B[90m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"};var m={deleted:e.red,var:e.red,err:e.red,kwd:e.red,num:e.yellow,class:e.yellow,cmnt:e.gray,insert:e.green,str:e.green,bool:e.cyan,type:e.blue,oper:e.blue,section:e.magenta,func:e.magenta};export{m as default}; diff --git a/dist/themes/termcolor.js b/dist/themes/termcolor.js new file mode 100644 index 0000000..5ffe926 --- /dev/null +++ b/dist/themes/termcolor.js @@ -0,0 +1 @@ +var b={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",gray:"\x1B[90m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"};export{b as default}; diff --git a/docs/functions/detect.detectLanguage.html b/docs/functions/detect.detectLanguage.html index 80ef3e7..7ca157f 100644 --- a/docs/functions/detect.detectLanguage.html +++ b/docs/functions/detect.detectLanguage.html @@ -2,4 +2,4 @@

detectLanguage

+
diff --git a/docs/functions/index.highlightAll.html b/docs/functions/index.highlightAll.html index 2f26033..99696de 100644 --- a/docs/functions/index.highlightAll.html +++ b/docs/functions/index.highlightAll.html @@ -1,4 +1,4 @@ highlightAll | @speed-highlight/core

Call highlightElement on element with a css class starting with shj-lang-

highlightAll

  • Parameters

    Returns Promise<void[]>

+

Returns Promise<void[]>

diff --git a/docs/functions/index.highlightElement.html b/docs/functions/index.highlightElement.html index 120f277..f709025 100644 --- a/docs/functions/index.highlightElement.html +++ b/docs/functions/index.highlightElement.html @@ -4,4 +4,4 @@
  • Optionalmode: ShjDisplayMode

    The display mode (guessed by default)

  • Optionalopt: ShjOptions

    Customization options

  • Returns Promise<void>

    highlightElement

    -
    +
    diff --git a/docs/functions/index.highlightText.html b/docs/functions/index.highlightText.html index d36fb11..0859942 100644 --- a/docs/functions/index.highlightText.html +++ b/docs/functions/index.highlightText.html @@ -8,4 +8,4 @@

    highlightText

    -
    +
    diff --git a/docs/functions/index.loadLanguage.html b/docs/functions/index.loadLanguage.html index 49f7bf4..c1e9349 100644 --- a/docs/functions/index.loadLanguage.html +++ b/docs/functions/index.loadLanguage.html @@ -2,4 +2,4 @@

    loadLanguage

    +

    Returns void

    diff --git a/docs/functions/index.tokenize.html b/docs/functions/index.tokenize.html index a46eead..07a497d 100644 --- a/docs/functions/index.tokenize.html +++ b/docs/functions/index.tokenize.html @@ -8,4 +8,4 @@
  • the type of the token
      • (arg0, arg1): void
      • Parameters

        Returns void

    Returns Promise<void>

    tokenize

    -
    +
    diff --git a/docs/functions/terminal.highlightText.html b/docs/functions/terminal.highlightText.html index cd55d2f..3eb5094 100644 --- a/docs/functions/terminal.highlightText.html +++ b/docs/functions/terminal.highlightText.html @@ -3,4 +3,4 @@
    • Parameters

      • src: string

        The code

      • lang: ShjLanguage

        The language of the code

      Returns Promise<string>

      The highlighted string

      -
    +
    diff --git a/docs/functions/terminal.printHighlight.html b/docs/functions/terminal.printHighlight.html index 50440e3..b0b98b4 100644 --- a/docs/functions/terminal.printHighlight.html +++ b/docs/functions/terminal.printHighlight.html @@ -2,4 +2,4 @@

    printHighlight

    • Parameters

      • src: string

        The code

      • lang: ShjLanguage

        The language of the code

        -

      Returns Promise<any>

    +

    Returns Promise<any>

    diff --git a/docs/functions/terminal.setTheme.html b/docs/functions/terminal.setTheme.html index 3705caf..7fd2da0 100644 --- a/docs/functions/terminal.setTheme.html +++ b/docs/functions/terminal.setTheme.html @@ -1,4 +1,4 @@ setTheme | @speed-highlight/core

    Change the current used theme for highlighting

    setTheme

    +

    Returns Promise<any>

    diff --git a/docs/interfaces/index.ShjOptions.html b/docs/interfaces/index.ShjOptions.html index e124cec..859f070 100644 --- a/docs/interfaces/index.ShjOptions.html +++ b/docs/interfaces/index.ShjOptions.html @@ -1,3 +1,3 @@ -ShjOptions | @speed-highlight/core
    interface ShjOptions {
        hideLineNumbers: boolean;
    }

    Properties

    hideLineNumbers +ShjOptions | @speed-highlight/core
    interface ShjOptions {
        hideLineNumbers: boolean;
    }

    Properties

    Properties

    hideLineNumbers: boolean

    Indicates whether to hide line numbers

    -
    +
    diff --git a/docs/modules/detect.html b/docs/modules/detect.html index 076615c..af7cb8b 100644 --- a/docs/modules/detect.html +++ b/docs/modules/detect.html @@ -1,3 +1,3 @@ -detect | @speed-highlight/core

    References

    ShjLanguage +detect | @speed-highlight/core

    References

    Functions

    References

    Re-exports ShjLanguage
    diff --git a/docs/modules/index.html b/docs/modules/index.html index e80bee4..5bb2793 100644 --- a/docs/modules/index.html +++ b/docs/modules/index.html @@ -1,4 +1,4 @@ -index | @speed-highlight/core

    Index

    Interfaces

    ShjOptions +index | @speed-highlight/core

    Index

    Interfaces

    Type Aliases

    ShjBrowserTheme ShjDisplayMode ShjLanguage diff --git a/docs/modules/terminal.html b/docs/modules/terminal.html index 6ea26b7..deebb5f 100644 --- a/docs/modules/terminal.html +++ b/docs/modules/terminal.html @@ -1,4 +1,4 @@ -terminal | @speed-highlight/core

    References

    ShjLanguage +terminal | @speed-highlight/core

    References

    Type Aliases

    Functions

    highlightText printHighlight diff --git a/docs/types/index.ShjBrowserTheme.html b/docs/types/index.ShjBrowserTheme.html index 5d61bbc..a502a0a 100644 --- a/docs/types/index.ShjBrowserTheme.html +++ b/docs/types/index.ShjBrowserTheme.html @@ -1 +1 @@ -ShjBrowserTheme | @speed-highlight/core
    ShjBrowserTheme:
        | "atom-dark"
        | "github-dark"
        | "github-dim"
        | "dark"
        | "default"
        | "github-light"
        | "visual-studio-dark"
    +ShjBrowserTheme | @speed-highlight/core
    ShjBrowserTheme:
        | "atom-dark"
        | "github-dark"
        | "github-dim"
        | "dark"
        | "default"
        | "github-light"
        | "visual-studio-dark"
    diff --git a/docs/types/index.ShjDisplayMode.html b/docs/types/index.ShjDisplayMode.html index dbef0f5..3a31a33 100644 --- a/docs/types/index.ShjDisplayMode.html +++ b/docs/types/index.ShjDisplayMode.html @@ -3,4 +3,4 @@
  • oneline inside div element and containing only one line
  • multiline inside div element
  • -
    +
    diff --git a/docs/types/index.ShjLanguage.html b/docs/types/index.ShjLanguage.html index de39dfe..7f5147b 100644 --- a/docs/types/index.ShjLanguage.html +++ b/docs/types/index.ShjLanguage.html @@ -1 +1 @@ -ShjLanguage | @speed-highlight/core
    ShjLanguage:
        | "asm"
        | "bash"
        | "bf"
        | "c"
        | "css"
        | "csv"
        | "diff"
        | "docker"
        | "git"
        | "go"
        | "html"
        | "http"
        | "ini"
        | "java"
        | "js"
        | "jsdoc"
        | "json"
        | "leanpub-md"
        | "log"
        | "lua"
        | "make"
        | "md"
        | "pl"
        | "plain"
        | "py"
        | "regex"
        | "rs"
        | "sql"
        | "todo"
        | "toml"
        | "ts"
        | "uri"
        | "xml"
        | "yaml"
    +ShjLanguage | @speed-highlight/core
    ShjLanguage:
        | "asm"
        | "bash"
        | "bf"
        | "c"
        | "css"
        | "csv"
        | "diff"
        | "docker"
        | "git"
        | "go"
        | "html"
        | "http"
        | "ini"
        | "java"
        | "js"
        | "jsdoc"
        | "json"
        | "leanpub-md"
        | "log"
        | "lua"
        | "make"
        | "md"
        | "pl"
        | "plain"
        | "py"
        | "regex"
        | "rs"
        | "sql"
        | "todo"
        | "toml"
        | "ts"
        | "uri"
        | "xml"
        | "yaml"
    diff --git a/docs/types/index.ShjLanguageComponent.html b/docs/types/index.ShjLanguageComponent.html index 14440bb..9e46fa6 100644 --- a/docs/types/index.ShjLanguageComponent.html +++ b/docs/types/index.ShjLanguageComponent.html @@ -1 +1 @@ -ShjLanguageComponent | @speed-highlight/core

    Type Alias ShjLanguageComponent

    ShjLanguageComponent: {
        match: RegExp;
        type: string;
    } | {
        match: RegExp;
        sub: string | ShjLanguageDefinition | ((code: string) => ShjLanguageComponent);
    } | {
        expand: string;
    }
    +ShjLanguageComponent | @speed-highlight/core

    Type Alias ShjLanguageComponent

    ShjLanguageComponent: {
        match: RegExp;
        type: string;
    } | {
        match: RegExp;
        sub: string | ShjLanguageDefinition | ((code: string) => ShjLanguageComponent);
    } | {
        expand: string;
    }
    diff --git a/docs/types/index.ShjLanguageDefinition.html b/docs/types/index.ShjLanguageDefinition.html index cdda4d0..6f14ed0 100644 --- a/docs/types/index.ShjLanguageDefinition.html +++ b/docs/types/index.ShjLanguageDefinition.html @@ -1 +1 @@ -ShjLanguageDefinition | @speed-highlight/core

    Type Alias ShjLanguageDefinition

    ShjLanguageDefinition: ShjLanguageComponent[]
    +ShjLanguageDefinition | @speed-highlight/core

    Type Alias ShjLanguageDefinition

    ShjLanguageDefinition: ShjLanguageComponent[]
    diff --git a/docs/types/index.ShjToken.html b/docs/types/index.ShjToken.html index 10bb539..296ea9d 100644 --- a/docs/types/index.ShjToken.html +++ b/docs/types/index.ShjToken.html @@ -1 +1 @@ -ShjToken | @speed-highlight/core
    ShjToken:
        | "deleted"
        | "err"
        | "var"
        | "section"
        | "kwd"
        | "class"
        | "cmnt"
        | "insert"
        | "type"
        | "func"
        | "bool"
        | "num"
        | "oper"
        | "str"
        | "esc"
    +ShjToken | @speed-highlight/core
    ShjToken:
        | "deleted"
        | "err"
        | "var"
        | "section"
        | "kwd"
        | "class"
        | "cmnt"
        | "insert"
        | "type"
        | "func"
        | "bool"
        | "num"
        | "oper"
        | "str"
        | "esc"
    diff --git a/docs/types/terminal.ShjTerminalTheme.html b/docs/types/terminal.ShjTerminalTheme.html index 8b6a325..3fd3a2c 100644 --- a/docs/types/terminal.ShjTerminalTheme.html +++ b/docs/types/terminal.ShjTerminalTheme.html @@ -1 +1 @@ -ShjTerminalTheme | @speed-highlight/core
    ShjTerminalTheme: "default" | "atom-dark"
    +ShjTerminalTheme | @speed-highlight/core
    ShjTerminalTheme: "default" | "atom-dark"