codelight.js 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +15 -0
- package/README.CDN.md +7 -7
- package/README.md +20 -6
- package/SUPPORTED_LANGUAGES.md +35 -8
- package/build/codelight.js +479 -5
- package/build/codelight.min.js +12 -12
- package/es/{chunk-F46VGBFI.js → chunk-KW6EHF3K.js} +479 -5
- package/es/codelight.js +2 -2
- package/es/react.js +2 -2
- package/lib/{chunk-HSSBKI63.cjs → chunk-MX3F3T5L.cjs} +479 -5
- package/lib/codelight.cjs +17 -17
- package/lib/react.cjs +5 -5
- package/package.json +8 -3
package/build/codelight.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! codelight.js 1.
|
|
1
|
+
/*! codelight.js 1.4.0 | MIT License | https://github.com/codelightjs/codelight.js */
|
|
2
2
|
"use strict";
|
|
3
3
|
var codelight = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -836,6 +836,413 @@ var codelight = (() => {
|
|
|
836
836
|
calls: false
|
|
837
837
|
});
|
|
838
838
|
|
|
839
|
+
// src/languages/shellsession.ts
|
|
840
|
+
var PROMPT = /^(?:\([\w.-]+\)\s+)?(?:[\w.-]+@[\w.-]+(?::[^\s$#%>]*)?\s?)?[$#%❯>]\s|^PS [^>]*>\s/;
|
|
841
|
+
var shellsession = {
|
|
842
|
+
tokenizeLine(line, state) {
|
|
843
|
+
const s = state;
|
|
844
|
+
const prompt = s?.continues ? "" : PROMPT.exec(line)?.[0];
|
|
845
|
+
if (prompt === void 0) return { tokens: line ? [{ text: line }] : [], state: null };
|
|
846
|
+
const out = new LineBuilder();
|
|
847
|
+
out.add("meta", prompt);
|
|
848
|
+
const r = bash_default.tokenizeLine(line.slice(prompt.length), s?.bash ?? null);
|
|
849
|
+
for (const t of r.tokens) out.add(t.type, t.text);
|
|
850
|
+
const continues = /\\$/.test(line) || r.state !== null;
|
|
851
|
+
return { tokens: out.tokens, state: continues ? { bash: r.state, continues: true } : null };
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
var shellsession_default = shellsession;
|
|
855
|
+
|
|
856
|
+
// src/languages/http.ts
|
|
857
|
+
var METHOD = /^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|CONNECT|TRACE)(\s+)(\S+)(?:(\s+)(HTTP\/[\d.]+))?\s*$/;
|
|
858
|
+
var STATUS = /^(HTTP\/[\d.]+)(\s+)(\d{3})(.*)$/;
|
|
859
|
+
var HEADER = /^([!#$%&'*+.^_`|~\w-]+)(:)(\s*)(.*)$/;
|
|
860
|
+
var http = {
|
|
861
|
+
tokenizeLine(line, state) {
|
|
862
|
+
const s = state ?? { body: false, inner: null };
|
|
863
|
+
const out = new LineBuilder();
|
|
864
|
+
if (/^###/.test(line)) {
|
|
865
|
+
out.add("comment", line);
|
|
866
|
+
return { tokens: out.tokens, state: null };
|
|
867
|
+
}
|
|
868
|
+
if (s.body) {
|
|
869
|
+
const r = json_default.tokenizeLine(line, s.inner);
|
|
870
|
+
return { tokens: r.tokens, state: { body: true, inner: r.state } };
|
|
871
|
+
}
|
|
872
|
+
if (!line.trim()) return { tokens: [], state: { body: true, inner: null } };
|
|
873
|
+
let m;
|
|
874
|
+
if (m = METHOD.exec(line)) {
|
|
875
|
+
out.add("keyword", m[1]);
|
|
876
|
+
out.add(void 0, m[2]);
|
|
877
|
+
out.add("string", m[3]);
|
|
878
|
+
if (m[5]) {
|
|
879
|
+
out.add(void 0, m[4]);
|
|
880
|
+
out.add("meta", m[5]);
|
|
881
|
+
}
|
|
882
|
+
} else if (m = STATUS.exec(line)) {
|
|
883
|
+
out.add("meta", m[1]);
|
|
884
|
+
out.add(void 0, m[2]);
|
|
885
|
+
out.add("number", m[3]);
|
|
886
|
+
out.add("string", m[4]);
|
|
887
|
+
} else if (m = HEADER.exec(line)) {
|
|
888
|
+
out.add("property", m[1]);
|
|
889
|
+
out.add("punctuation", m[2]);
|
|
890
|
+
out.add(void 0, m[3]);
|
|
891
|
+
out.add("string", m[4]);
|
|
892
|
+
} else if (/^\s*#/.test(line)) {
|
|
893
|
+
out.add("comment", line);
|
|
894
|
+
} else {
|
|
895
|
+
out.add(void 0, line);
|
|
896
|
+
}
|
|
897
|
+
return { tokens: out.tokens, state: s.inner === null && !s.body ? null : s };
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
var http_default = http;
|
|
901
|
+
|
|
902
|
+
// src/languages/scss.ts
|
|
903
|
+
var scss_default = defineLanguage({
|
|
904
|
+
lineComment: ["//"],
|
|
905
|
+
blockComment: [["/*", "*/"]],
|
|
906
|
+
strings: QUOTES,
|
|
907
|
+
rules: [
|
|
908
|
+
// A URL is text, so the `//` in `url(https://…)` isn't a comment.
|
|
909
|
+
{ match: /(?<=url\()[^)'"]*(?=\))/, type: "string" },
|
|
910
|
+
{ match: /\$[\w-]+|#\{[^}]*\}/, type: "variable" },
|
|
911
|
+
{ match: /@[\w-]+/, type: "keyword" },
|
|
912
|
+
{ match: /#[\da-fA-F]{3,8}(?![\w-])/, type: "number" },
|
|
913
|
+
{ match: /(?:--|-?[A-Za-z])[\w-]*(?=\s*:(?!:)(?:[^{};#]|#\{[^}]*\}|#(?!\{))*(?:[;})]|$))/, type: "property" },
|
|
914
|
+
{ match: /[.#%][A-Za-z_-][\w-]*/, type: "type" },
|
|
915
|
+
{ match: /&/, type: "operator" },
|
|
916
|
+
{ match: /::?[A-Za-z-]+/, type: "attr" },
|
|
917
|
+
{ match: /!\s*(?:important|default|global)/, type: "keyword" }
|
|
918
|
+
],
|
|
919
|
+
identifier: /-?[A-Za-z_][\w-]*/
|
|
920
|
+
});
|
|
921
|
+
|
|
922
|
+
// src/languages/mermaid.ts
|
|
923
|
+
var mermaid_default = defineLanguage({
|
|
924
|
+
lineComment: ["%%"],
|
|
925
|
+
strings: [{ open: '"' }],
|
|
926
|
+
keywords: "graph flowchart sequenceDiagram classDiagram stateDiagram erDiagram gantt pie journey gitGraph mindmap timeline quadrantChart requirementDiagram C4Context participant actor note Note over loop alt else opt par and critical break end activate deactivate rect autonumber title section class subgraph direction style classDef linkStyle click accTitle accDescr dateFormat axisFormat commit branch checkout merge state",
|
|
927
|
+
constants: "TD TB BT RL LR",
|
|
928
|
+
rules: [
|
|
929
|
+
{ match: /\b(?:stateDiagram-v2|sankey-beta|xychart-beta|block-beta|packet-beta)\b/, type: "keyword" },
|
|
930
|
+
// Arrows and links: -->, ---, -.->, ==>, ->>, -->>, --x, --o, <-->
|
|
931
|
+
{ match: /<?(?:-{2,}|={2,}|-\.+-?|-)(?:>>?|x|o|\))?(?![\w-])|<<-+/, type: "operator" },
|
|
932
|
+
// Node text: A[Box], B{Decision}, C((Circle)), D>Flag], E[[Sub]]
|
|
933
|
+
{ match: /(?<=\w)(?:\[\[|\[\(|\(\(|\[|\(|\{\{|\{|>)[^\]\)\}\n]*?(?:\]\]|\)\]|\)\)|\]|\)|\}\}|\})/, type: "string" },
|
|
934
|
+
// Edge labels: -->|yes|
|
|
935
|
+
{ match: /\|[^|\n]*\|/, type: "string" },
|
|
936
|
+
// Message text after a colon in sequence diagrams and notes
|
|
937
|
+
{ match: /(?<=:\s*)[^:;\n]+$/, type: "string" }
|
|
938
|
+
],
|
|
939
|
+
calls: false
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
// src/languages/latex.ts
|
|
943
|
+
var latex_default = defineLanguage({
|
|
944
|
+
lineComment: ["%"],
|
|
945
|
+
strings: [
|
|
946
|
+
// Maths: $$…$$ and \[…\] can span lines; $…$ and \(…\) are inline.
|
|
947
|
+
{ open: "$$", multiline: true, escape: false },
|
|
948
|
+
{ open: "\\[", close: "\\]", multiline: true, escape: false },
|
|
949
|
+
{ open: "\\(", close: "\\)", escape: false },
|
|
950
|
+
{ open: "$", escape: false }
|
|
951
|
+
],
|
|
952
|
+
rules: [
|
|
953
|
+
// Escaped characters first, so \$ and \% aren't maths or a comment.
|
|
954
|
+
{ match: /\\[$%&#_{}]/, type: "constant" },
|
|
955
|
+
{ match: /(?<=\\(?:begin|end)\{)[^}]*/, type: "type" },
|
|
956
|
+
{ match: /\\[A-Za-z@]+\*?/, type: "keyword" },
|
|
957
|
+
{ match: /\\\\/, type: "operator" },
|
|
958
|
+
{ match: /&/, type: "operator" }
|
|
959
|
+
],
|
|
960
|
+
calls: false,
|
|
961
|
+
numbers: false,
|
|
962
|
+
operators: false
|
|
963
|
+
});
|
|
964
|
+
|
|
965
|
+
// src/languages/vba.ts
|
|
966
|
+
var vba_default = defineLanguage({
|
|
967
|
+
lineComment: ["'"],
|
|
968
|
+
// "" inside a string is a quote; two adjacent strings merge into one token, so it reads right.
|
|
969
|
+
strings: [{ open: '"', escape: false }],
|
|
970
|
+
keywords: "sub function end if then else elseif for each next do loop while wend until dim as set let private public const option explicit with select case exit call byval byref optional new is not and or xor mod to step resume on error goto property get class module type enum imports namespace inherits implements return try catch finally throw using redim preserve static friend shared overrides overridable handles of in andalso orelse like debug",
|
|
971
|
+
types: "integer long longlong string boolean double single date variant object byte currency decimal char short range worksheet workbook collection dictionary",
|
|
972
|
+
constants: "true false nothing null empty vbnullstring vbcrlf vblf vbtab vbnewline vbyes vbno vbokonly",
|
|
973
|
+
builtins: "msgbox inputbox format len left right mid trim ltrim rtrim ucase lcase replace split join instr cstr cint clng cdbl cbool cdate val isempty isnumeric isnull isarray isobject now date time dateadd datediff year month day ubound lbound array createobject",
|
|
974
|
+
caseInsensitive: true,
|
|
975
|
+
rules: [
|
|
976
|
+
{ match: /(?<=^\s*|:\s*)Rem\b.*/i, type: "comment" },
|
|
977
|
+
{ match: /#\d{1,2}\/\d{1,2}\/\d{2,4}#/, type: "number" },
|
|
978
|
+
{ match: /(?<=^\s*)#(?:If|Else|ElseIf|End If|Const)\b.*/i, type: "meta" },
|
|
979
|
+
{ match: /(?<=^\s*)Attribute\b.*/i, type: "meta" },
|
|
980
|
+
{ match: /\s_$/, type: "operator" }
|
|
981
|
+
]
|
|
982
|
+
// VBA capitalises everything (Rows, Value, Range), so capitals don't mean "type" here.
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
// src/languages/lua.ts
|
|
986
|
+
var lua_default = defineLanguage({
|
|
987
|
+
lineComment: ["--"],
|
|
988
|
+
blockComment: [["--[[", "]]"]],
|
|
989
|
+
strings: [{ open: "[[", close: "]]", escape: false, multiline: true }, { open: '"' }, { open: "'" }],
|
|
990
|
+
keywords: "and break do else elseif end for function goto if in local not or repeat return then until while",
|
|
991
|
+
constants: "true false nil",
|
|
992
|
+
builtins: "print pairs ipairs require type tostring tonumber assert error pcall setmetatable getmetatable select next"
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
// src/languages/dart.ts
|
|
996
|
+
var INTERPOLATE4 = ["${", "}"];
|
|
997
|
+
var dart_default = defineLanguage({
|
|
998
|
+
...C_COMMENTS,
|
|
999
|
+
strings: [
|
|
1000
|
+
{ open: "r'''", close: "'''", escape: false, multiline: true },
|
|
1001
|
+
{ open: 'r"""', close: '"""', escape: false, multiline: true },
|
|
1002
|
+
{ open: "'''", multiline: true, interpolate: INTERPOLATE4 },
|
|
1003
|
+
{ open: '"""', multiline: true, interpolate: INTERPOLATE4 },
|
|
1004
|
+
{ open: "r'", close: "'", escape: false },
|
|
1005
|
+
{ open: 'r"', close: '"', escape: false },
|
|
1006
|
+
{ open: "'", interpolate: INTERPOLATE4 },
|
|
1007
|
+
{ open: '"', interpolate: INTERPOLATE4 }
|
|
1008
|
+
],
|
|
1009
|
+
keywords: "abstract as assert async await base break case catch class const continue covariant default deferred do dynamic else enum export extends extension external factory final finally for get hide if implements import in interface is late library mixin new on operator part required rethrow return sealed set show static super switch sync this throw try typedef var when while with yield",
|
|
1010
|
+
constants: "true false null",
|
|
1011
|
+
types: "int double num bool String List Map Set Future Stream void Object Never Iterable Function",
|
|
1012
|
+
rules: [{ match: /@[A-Za-z_]\w*/, type: "meta" }],
|
|
1013
|
+
classNames: true
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
// src/languages/elixir.ts
|
|
1017
|
+
var INTERPOLATE5 = ["#{", "}"];
|
|
1018
|
+
var elixir_default = defineLanguage({
|
|
1019
|
+
lineComment: ["#"],
|
|
1020
|
+
strings: [
|
|
1021
|
+
{ open: '"""', multiline: true, interpolate: INTERPOLATE5 },
|
|
1022
|
+
{ open: '"', interpolate: INTERPOLATE5 },
|
|
1023
|
+
{ open: "'" }
|
|
1024
|
+
],
|
|
1025
|
+
keywords: "def defp defmodule defmacro defmacrop defstruct defprotocol defimpl defdelegate defguard do end fn case cond with when if else unless import alias use require quote unquote receive after try catch rescue raise and or not in for",
|
|
1026
|
+
constants: "true false nil",
|
|
1027
|
+
rules: [
|
|
1028
|
+
{ match: /@[a-z_]\w*/, type: "meta" },
|
|
1029
|
+
{ match: /(?<![:\w]):[A-Za-z_]\w*[?!]?/, type: "constant" },
|
|
1030
|
+
{ match: /\b[a-z_]\w*[?!]?:(?=\s)/, type: "constant" },
|
|
1031
|
+
{ match: /~[a-zA-Z](?:"[^"]*"|\/[^/]*\/|\([^)]*\)|\[[^\]]*\]|\{[^}]*\})[a-z]*/, type: "regex" }
|
|
1032
|
+
],
|
|
1033
|
+
identifier: /[A-Za-z_]\w*[?!]?/,
|
|
1034
|
+
classNames: true
|
|
1035
|
+
});
|
|
1036
|
+
|
|
1037
|
+
// src/languages/r.ts
|
|
1038
|
+
var r_default = defineLanguage({
|
|
1039
|
+
lineComment: ["#"],
|
|
1040
|
+
strings: [...QUOTES, { open: "`", escape: false, type: "variable" }],
|
|
1041
|
+
keywords: "function if else for while repeat in next break return",
|
|
1042
|
+
constants: "TRUE FALSE NULL NA NA_integer_ NA_real_ NA_character_ Inf NaN T F",
|
|
1043
|
+
rules: [{ match: /<<-|->>|<-|->|%[^%\s]*%|\|>/, type: "operator" }],
|
|
1044
|
+
identifier: /[A-Za-z_.][\w.]*/
|
|
1045
|
+
});
|
|
1046
|
+
|
|
1047
|
+
// src/languages/zig.ts
|
|
1048
|
+
var zig_default = defineLanguage({
|
|
1049
|
+
lineComment: ["//"],
|
|
1050
|
+
strings: [{ open: '"' }, { open: "'" }],
|
|
1051
|
+
keywords: "const var fn pub return if else while for switch struct enum union opaque error try catch defer errdefer comptime inline export extern test and or orelse unreachable break continue noreturn align packed threadlocal usingnamespace async await suspend resume nosuspend asm volatile allowzero callconv linksection noalias",
|
|
1052
|
+
constants: "true false null undefined",
|
|
1053
|
+
types: "i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f16 f32 f64 f128 bool void anyerror anytype anyopaque type comptime_int comptime_float c_int c_uint",
|
|
1054
|
+
rules: [
|
|
1055
|
+
{ match: /\\\\.*/, type: "string" },
|
|
1056
|
+
{ match: /@[A-Za-z_]\w*/, type: "function" }
|
|
1057
|
+
],
|
|
1058
|
+
classNames: true
|
|
1059
|
+
});
|
|
1060
|
+
|
|
1061
|
+
// src/languages/scala.ts
|
|
1062
|
+
var INTERPOLATE6 = ["${", "}"];
|
|
1063
|
+
var INTERPOLATED = ["s", "f", "raw"].flatMap((p) => [
|
|
1064
|
+
{ open: `${p}"""`, close: '"""', multiline: true, escape: false, interpolate: INTERPOLATE6 },
|
|
1065
|
+
{ open: `${p}"`, close: '"', escape: p !== "raw", interpolate: INTERPOLATE6 }
|
|
1066
|
+
]);
|
|
1067
|
+
var scala_default = defineLanguage({
|
|
1068
|
+
...C_COMMENTS,
|
|
1069
|
+
strings: [...INTERPOLATED, { open: '"""', multiline: true, escape: false }, { open: '"' }, { open: "'" }],
|
|
1070
|
+
keywords: "abstract case catch class def do else enum export extends final finally for forSome given if implicit import lazy match new object override package private protected return sealed super then this throw trait try type using val var while with yield end",
|
|
1071
|
+
constants: "true false null",
|
|
1072
|
+
types: "Int Long Double Float Boolean String Unit Any AnyRef Nothing Option Some None List Map Seq Vector Future",
|
|
1073
|
+
rules: [{ match: /@[A-Za-z_]\w*/, type: "meta" }],
|
|
1074
|
+
classNames: true
|
|
1075
|
+
});
|
|
1076
|
+
|
|
1077
|
+
// src/languages/haskell.ts
|
|
1078
|
+
var haskell_default = defineLanguage({
|
|
1079
|
+
lineComment: ["--"],
|
|
1080
|
+
blockComment: [["{-", "-}"]],
|
|
1081
|
+
strings: [{ open: '"' }],
|
|
1082
|
+
keywords: "module where import qualified as hiding data type newtype class instance deriving let in case of if then else do forall infixl infixr infix family default",
|
|
1083
|
+
constants: "True False Nothing Just Left Right",
|
|
1084
|
+
rules: [
|
|
1085
|
+
{ match: /'(?:[^'\\]|\\.)'/, type: "string" },
|
|
1086
|
+
{ match: /(?<=^)[a-z_][\w']*(?=\s*::)/, type: "function" }
|
|
1087
|
+
],
|
|
1088
|
+
identifier: /[A-Za-z_][\w']*/,
|
|
1089
|
+
calls: false,
|
|
1090
|
+
classNames: true
|
|
1091
|
+
});
|
|
1092
|
+
|
|
1093
|
+
// src/languages/julia.ts
|
|
1094
|
+
var INTERPOLATE7 = ["$(", ")"];
|
|
1095
|
+
var julia_default = defineLanguage({
|
|
1096
|
+
lineComment: ["#"],
|
|
1097
|
+
blockComment: [["#=", "=#"]],
|
|
1098
|
+
strings: [
|
|
1099
|
+
{ open: '"""', multiline: true, interpolate: INTERPOLATE7 },
|
|
1100
|
+
{ open: '"', interpolate: INTERPOLATE7 },
|
|
1101
|
+
{ open: "`", type: "string" }
|
|
1102
|
+
],
|
|
1103
|
+
keywords: "function end if elseif else for while return module baremodule using import export struct mutable abstract primitive type begin let do try catch finally macro quote local global const where in isa break continue",
|
|
1104
|
+
constants: "true false nothing missing NaN Inf pi",
|
|
1105
|
+
types: "Int Int8 Int16 Int32 Int64 UInt8 Float32 Float64 Bool String Char Vector Matrix Array Dict Tuple Any Nothing",
|
|
1106
|
+
rules: [
|
|
1107
|
+
{ match: /@[A-Za-z_]\w*/, type: "meta" },
|
|
1108
|
+
{ match: /'(?:[^'\\]|\\.)'/, type: "string" }
|
|
1109
|
+
],
|
|
1110
|
+
identifier: /[A-Za-z_]\w*!?/,
|
|
1111
|
+
classNames: true
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1114
|
+
// src/languages/nginx.ts
|
|
1115
|
+
var nginx_default = defineLanguage({
|
|
1116
|
+
lineComment: ["#"],
|
|
1117
|
+
strings: [{ open: '"' }, { open: "'" }],
|
|
1118
|
+
constants: "on off",
|
|
1119
|
+
rules: [
|
|
1120
|
+
// Block names are keywords only where a statement starts, so `proxy_pass http://…` stays plain.
|
|
1121
|
+
{ match: /(?<=^\s*)(?:http|server|location|upstream|events|stream|map|if|include|types|geo|split_clients|limit_except)\b/, type: "keyword" },
|
|
1122
|
+
{ match: /\$[A-Za-z_]\w*/, type: "variable" },
|
|
1123
|
+
{ match: /(?<=^\s*)(?!(?:http|server|location|upstream|events|stream|map|if|include|types|geo|split_clients|limit_except)\b)[a-z_]\w*(?=\s)(?!\s*\{)/, type: "property" },
|
|
1124
|
+
{ match: /(?<=location\s+)(?:[=~^*]+\s*)?[^\s{]+/, type: "string" }
|
|
1125
|
+
],
|
|
1126
|
+
identifier: /[A-Za-z_][\w.-]*/,
|
|
1127
|
+
calls: false
|
|
1128
|
+
});
|
|
1129
|
+
|
|
1130
|
+
// src/languages/makefile.ts
|
|
1131
|
+
var makefile_default = defineLanguage({
|
|
1132
|
+
strings: [{ open: '"' }, { open: "'", escape: false }],
|
|
1133
|
+
keywords: "include ifeq ifneq ifdef ifndef else endif define endef export unexport override vpath",
|
|
1134
|
+
rules: [
|
|
1135
|
+
{ match: /(?<=^|\s)#.*/, type: "comment" },
|
|
1136
|
+
{ match: /\$[({][^)}]*[)}]|\$[@<^?*%+]/, type: "variable" },
|
|
1137
|
+
{ match: /^(?:\.PHONY|[\w./%${}()-]+(?:\s+[\w./%${}()-]+)*)(?=\s*::?(?!=))/, type: "function" },
|
|
1138
|
+
{ match: /^[A-Za-z_][\w.-]*(?=\s*(?:[:?+!]?=))/, type: "property" }
|
|
1139
|
+
],
|
|
1140
|
+
identifier: /[A-Za-z_][\w-]*/,
|
|
1141
|
+
calls: false
|
|
1142
|
+
});
|
|
1143
|
+
|
|
1144
|
+
// src/languages/ini.ts
|
|
1145
|
+
var ini_default = defineLanguage({
|
|
1146
|
+
strings: [{ open: '"' }, { open: "'", escape: false }],
|
|
1147
|
+
constants: "true false yes no on off",
|
|
1148
|
+
caseInsensitive: true,
|
|
1149
|
+
rules: [
|
|
1150
|
+
{ match: /(?<=^\s*)[;#].*/, type: "comment" },
|
|
1151
|
+
{ match: /(?<=^\s*)\[[^\]]*\]/, type: "tag" },
|
|
1152
|
+
{ match: /(?<=^\s*)(?:export\s+)?[^\s=:;#[][^=:]*?(?=\s*[=:])/, type: "property" },
|
|
1153
|
+
{ match: /\$\{[^}]*\}|\$[A-Za-z_]\w*/, type: "variable" }
|
|
1154
|
+
],
|
|
1155
|
+
identifier: /[A-Za-z_][\w.-]*/,
|
|
1156
|
+
calls: false
|
|
1157
|
+
});
|
|
1158
|
+
|
|
1159
|
+
// src/languages/protobuf.ts
|
|
1160
|
+
var protobuf_default = defineLanguage({
|
|
1161
|
+
...C_COMMENTS,
|
|
1162
|
+
strings: QUOTES,
|
|
1163
|
+
keywords: "syntax edition package import public weak message enum service rpc returns option repeated optional required oneof map reserved extensions extend stream to max",
|
|
1164
|
+
types: "double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes",
|
|
1165
|
+
constants: "true false",
|
|
1166
|
+
calls: false,
|
|
1167
|
+
classNames: true
|
|
1168
|
+
});
|
|
1169
|
+
|
|
1170
|
+
// src/languages/solidity.ts
|
|
1171
|
+
var solidity_default = defineLanguage({
|
|
1172
|
+
...C_COMMENTS,
|
|
1173
|
+
strings: QUOTES,
|
|
1174
|
+
keywords: "pragma solidity contract interface library abstract function modifier event emit error returns return if else for while do break continue public private internal external view pure payable memory storage calldata constant immutable override virtual mapping struct enum require revert assert using import is new delete try catch unchecked constructor fallback receive anonymous indexed",
|
|
1175
|
+
types: "address bool string bytes byte int uint uint8 uint16 uint32 uint64 uint128 uint256 int8 int16 int32 int64 int128 int256 bytes1 bytes4 bytes8 bytes16 bytes32",
|
|
1176
|
+
constants: "true false wei gwei ether seconds minutes hours days weeks",
|
|
1177
|
+
rules: [{ match: /\b(?:msg|block|tx|abi)\.\w+/, type: "variable" }],
|
|
1178
|
+
classNames: true
|
|
1179
|
+
});
|
|
1180
|
+
|
|
1181
|
+
// src/languages/groovy.ts
|
|
1182
|
+
var INTERPOLATE8 = ["${", "}"];
|
|
1183
|
+
var groovy_default = defineLanguage({
|
|
1184
|
+
...C_COMMENTS,
|
|
1185
|
+
strings: [
|
|
1186
|
+
{ open: '"""', multiline: true, interpolate: INTERPOLATE8 },
|
|
1187
|
+
{ open: "'''", multiline: true },
|
|
1188
|
+
{ open: '"', interpolate: INTERPOLATE8 },
|
|
1189
|
+
{ open: "'" }
|
|
1190
|
+
],
|
|
1191
|
+
keywords: "def var class interface enum trait import package return if else for while do switch case default break continue new in as instanceof try catch finally throw throws static final abstract private protected public assert extends implements this super",
|
|
1192
|
+
constants: "true false null",
|
|
1193
|
+
types: "int long double float boolean char byte short void String Object List Map",
|
|
1194
|
+
rules: [{ match: /@[A-Za-z_]\w*/, type: "meta" }],
|
|
1195
|
+
classNames: true
|
|
1196
|
+
});
|
|
1197
|
+
|
|
1198
|
+
// src/languages/nix.ts
|
|
1199
|
+
var INTERPOLATE9 = ["${", "}"];
|
|
1200
|
+
var nix_default = defineLanguage({
|
|
1201
|
+
lineComment: ["#"],
|
|
1202
|
+
blockComment: [["/*", "*/"]],
|
|
1203
|
+
strings: [
|
|
1204
|
+
{ open: "''", multiline: true, escape: false, interpolate: INTERPOLATE9 },
|
|
1205
|
+
{ open: '"', multiline: true, interpolate: INTERPOLATE9 }
|
|
1206
|
+
],
|
|
1207
|
+
keywords: "let in with rec inherit if then else assert or",
|
|
1208
|
+
constants: "true false null",
|
|
1209
|
+
builtins: "import builtins derivation fetchurl fetchTarball fetchGit toString map throw abort",
|
|
1210
|
+
rules: [
|
|
1211
|
+
{ match: /[A-Za-z_][\w'-]*(?:\.[A-Za-z_][\w'-]*)*(?=\s*=(?!=))/, type: "property" },
|
|
1212
|
+
{ match: /(?:\.{0,2}\/|~\/)[\w./-]+|<[\w./-]+>/, type: "string" }
|
|
1213
|
+
],
|
|
1214
|
+
identifier: /[A-Za-z_][\w'-]*/,
|
|
1215
|
+
calls: false
|
|
1216
|
+
});
|
|
1217
|
+
|
|
1218
|
+
// src/languages/cmake.ts
|
|
1219
|
+
var cmake_default = defineLanguage({
|
|
1220
|
+
lineComment: ["#"],
|
|
1221
|
+
blockComment: [["#[[", "]]"]],
|
|
1222
|
+
strings: [{ open: '"', multiline: true }],
|
|
1223
|
+
keywords: "if elseif else endif foreach endforeach while endwhile function endfunction macro endmacro return break continue",
|
|
1224
|
+
caseInsensitive: true,
|
|
1225
|
+
rules: [
|
|
1226
|
+
{ match: /\$\{[^}]*\}|\$ENV\{[^}]*\}/, type: "variable" },
|
|
1227
|
+
{ match: /\b[A-Z][A-Z0-9_]{1,}\b/, type: "constant" }
|
|
1228
|
+
]
|
|
1229
|
+
});
|
|
1230
|
+
|
|
1231
|
+
// src/languages/prisma.ts
|
|
1232
|
+
var prisma_default = defineLanguage({
|
|
1233
|
+
lineComment: ["//"],
|
|
1234
|
+
strings: [{ open: '"' }],
|
|
1235
|
+
keywords: "model enum datasource generator type view",
|
|
1236
|
+
types: "String Int BigInt Float Decimal Boolean DateTime Json Bytes Unsupported",
|
|
1237
|
+
constants: "true false null",
|
|
1238
|
+
rules: [
|
|
1239
|
+
{ match: /@@?[A-Za-z_][\w.]*/, type: "meta" },
|
|
1240
|
+
{ match: /(?<=^\s*)(?!(?:model|enum|datasource|generator|type|view)\b)[a-z_]\w*(?=\s+[A-Za-z])/, type: "property" },
|
|
1241
|
+
{ match: /(?<=^\s*)[a-z_]\w*(?=\s*=)/, type: "property" }
|
|
1242
|
+
],
|
|
1243
|
+
classNames: true
|
|
1244
|
+
});
|
|
1245
|
+
|
|
839
1246
|
// src/languages/index.ts
|
|
840
1247
|
var LANGUAGES = {
|
|
841
1248
|
javascript: javascript_default,
|
|
@@ -865,6 +1272,29 @@ var codelight = (() => {
|
|
|
865
1272
|
graphql: graphql_default,
|
|
866
1273
|
powershell: powershell_default,
|
|
867
1274
|
hcl: hcl_default,
|
|
1275
|
+
lua: lua_default,
|
|
1276
|
+
dart: dart_default,
|
|
1277
|
+
elixir: elixir_default,
|
|
1278
|
+
r: r_default,
|
|
1279
|
+
zig: zig_default,
|
|
1280
|
+
scala: scala_default,
|
|
1281
|
+
haskell: haskell_default,
|
|
1282
|
+
julia: julia_default,
|
|
1283
|
+
nginx: nginx_default,
|
|
1284
|
+
makefile: makefile_default,
|
|
1285
|
+
ini: ini_default,
|
|
1286
|
+
protobuf: protobuf_default,
|
|
1287
|
+
solidity: solidity_default,
|
|
1288
|
+
groovy: groovy_default,
|
|
1289
|
+
nix: nix_default,
|
|
1290
|
+
cmake: cmake_default,
|
|
1291
|
+
prisma: prisma_default,
|
|
1292
|
+
shellsession: shellsession_default,
|
|
1293
|
+
http: http_default,
|
|
1294
|
+
scss: scss_default,
|
|
1295
|
+
mermaid: mermaid_default,
|
|
1296
|
+
latex: latex_default,
|
|
1297
|
+
vba: vba_default,
|
|
868
1298
|
plaintext: plain
|
|
869
1299
|
};
|
|
870
1300
|
|
|
@@ -888,8 +1318,6 @@ var codelight = (() => {
|
|
|
888
1318
|
shell: "bash",
|
|
889
1319
|
zsh: "bash",
|
|
890
1320
|
shellscript: "bash",
|
|
891
|
-
console: "bash",
|
|
892
|
-
terminal: "bash",
|
|
893
1321
|
rb: "ruby",
|
|
894
1322
|
golang: "go",
|
|
895
1323
|
rs: "rust",
|
|
@@ -905,8 +1333,6 @@ var codelight = (() => {
|
|
|
905
1333
|
mysql: "sql",
|
|
906
1334
|
sqlite: "sql",
|
|
907
1335
|
plsql: "sql",
|
|
908
|
-
scss: "css",
|
|
909
|
-
less: "css",
|
|
910
1336
|
yml: "yaml",
|
|
911
1337
|
html: "xml",
|
|
912
1338
|
xhtml: "xml",
|
|
@@ -928,6 +1354,54 @@ var codelight = (() => {
|
|
|
928
1354
|
tf: "hcl",
|
|
929
1355
|
tfvars: "hcl",
|
|
930
1356
|
opentofu: "hcl",
|
|
1357
|
+
luau: "lua",
|
|
1358
|
+
ex: "elixir",
|
|
1359
|
+
exs: "elixir",
|
|
1360
|
+
heex: "elixir",
|
|
1361
|
+
rscript: "r",
|
|
1362
|
+
jl: "julia",
|
|
1363
|
+
sc: "scala",
|
|
1364
|
+
hs: "haskell",
|
|
1365
|
+
lhs: "haskell",
|
|
1366
|
+
"nginx.conf": "nginx",
|
|
1367
|
+
make: "makefile",
|
|
1368
|
+
mk: "makefile",
|
|
1369
|
+
mak: "makefile",
|
|
1370
|
+
gnumakefile: "makefile",
|
|
1371
|
+
cfg: "ini",
|
|
1372
|
+
properties: "ini",
|
|
1373
|
+
env: "ini",
|
|
1374
|
+
dotenv: "ini",
|
|
1375
|
+
editorconfig: "ini",
|
|
1376
|
+
gitconfig: "ini",
|
|
1377
|
+
proto: "protobuf",
|
|
1378
|
+
proto3: "protobuf",
|
|
1379
|
+
sol: "solidity",
|
|
1380
|
+
gradle: "groovy",
|
|
1381
|
+
gvy: "groovy",
|
|
1382
|
+
jenkinsfile: "groovy",
|
|
1383
|
+
cmakelists: "cmake",
|
|
1384
|
+
"cmakelists.txt": "cmake",
|
|
1385
|
+
console: "shellsession",
|
|
1386
|
+
terminal: "shellsession",
|
|
1387
|
+
"shell-session": "shellsession",
|
|
1388
|
+
"sh-session": "shellsession",
|
|
1389
|
+
pwshsession: "shellsession",
|
|
1390
|
+
https: "http",
|
|
1391
|
+
rest: "http",
|
|
1392
|
+
"rest-client": "http",
|
|
1393
|
+
sass: "scss",
|
|
1394
|
+
less: "scss",
|
|
1395
|
+
mmd: "mermaid",
|
|
1396
|
+
tex: "latex",
|
|
1397
|
+
context: "latex",
|
|
1398
|
+
vb: "vba",
|
|
1399
|
+
vbnet: "vba",
|
|
1400
|
+
"vb.net": "vba",
|
|
1401
|
+
vbscript: "vba",
|
|
1402
|
+
vbs: "vba",
|
|
1403
|
+
"visual-basic": "vba",
|
|
1404
|
+
visualbasic: "vba",
|
|
931
1405
|
text: "plaintext",
|
|
932
1406
|
txt: "plaintext",
|
|
933
1407
|
plain: "plaintext",
|