highlight.js
Advanced tools
Comparing version 11.8.0 to 11.9.0
@@ -575,2 +575,3 @@ /* | ||
/** @type LanguageFn */ | ||
@@ -577,0 +578,0 @@ function arduino(hljs) { |
@@ -35,2 +35,6 @@ /* | ||
'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 ' // standard registers | ||
+ 'w0 w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 ' // 32 bit ARMv8 registers | ||
+ 'w16 w17 w18 w19 w20 w21 w22 w23 w24 w25 w26 w27 w28 w29 w30 ' | ||
+ 'x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 ' // 64 bit ARMv8 registers | ||
+ 'x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 ' | ||
+ 'pc lr sp ip sl sb fp ' // typical regs plus backward compatibility | ||
@@ -37,0 +41,0 @@ + 'a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 ' // more regs and fp |
@@ -63,5 +63,3 @@ /* | ||
const ESCAPED_QUOTE = { | ||
className: '', | ||
begin: /\\"/ | ||
match: /\\"/ | ||
}; | ||
@@ -73,2 +71,5 @@ const APOS_STRING = { | ||
}; | ||
const ESCAPED_APOS = { | ||
match: /\\'/ | ||
}; | ||
const ARITHMETIC = { | ||
@@ -386,2 +387,3 @@ begin: /\$?\(\(/, | ||
APOS_STRING, | ||
ESCAPED_APOS, | ||
VAR | ||
@@ -388,0 +390,0 @@ ] |
@@ -154,2 +154,3 @@ const KEYWORDS = [ | ||
/** @type LanguageFn */ | ||
@@ -156,0 +157,0 @@ function coffeescript(hljs) { |
@@ -41,3 +41,3 @@ const MODES = (hljs) => { | ||
className: "attr", | ||
begin: /--[A-Za-z][A-Za-z0-9_-]*/ | ||
begin: /--[A-Za-z_][A-Za-z0-9_-]*/ | ||
} | ||
@@ -609,2 +609,3 @@ }; | ||
/** @type LanguageFn */ | ||
@@ -611,0 +612,0 @@ function css(hljs) { |
@@ -78,2 +78,3 @@ /** | ||
/** @type LanguageFn */ | ||
@@ -80,0 +81,0 @@ function fsharp(hljs) { |
@@ -69,3 +69,3 @@ /* | ||
match: [ | ||
/(class|interface|trait|enum|extends|implements)/, | ||
/(class|interface|trait|enum|record|extends|implements)/, | ||
/\s+/, | ||
@@ -130,3 +130,4 @@ hljs.UNDERSCORE_IDENT_RE | ||
"return", | ||
"instanceof" | ||
"instanceof", | ||
"var" | ||
]; | ||
@@ -133,0 +134,0 @@ |
@@ -10,4 +10,28 @@ /* | ||
function haskell(hljs) { | ||
/* See: | ||
- https://www.haskell.org/onlinereport/lexemes.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/binary_literals.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/numeric_underscores.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/hex_float_literals.html | ||
*/ | ||
const decimalDigits = '([0-9]_*)+'; | ||
const hexDigits = '([0-9a-fA-F]_*)+'; | ||
const binaryDigits = '([01]_*)+'; | ||
const octalDigits = '([0-7]_*)+'; | ||
const ascSymbol = '[!#$%&*+.\\/<=>?@\\\\^~-]'; | ||
const uniSymbol = '(\\p{S}|\\p{P})'; // Symbol or Punctuation | ||
const special = '[(),;\\[\\]`|{}]'; | ||
const symbol = `(${ascSymbol}|(?!(${special}|[_:"']))${uniSymbol})`; | ||
const COMMENT = { variants: [ | ||
hljs.COMMENT('--', '$'), | ||
// Double dash forms a valid comment only if it's not part of legal lexeme. | ||
// See: Haskell 98 report: https://www.haskell.org/onlinereport/lexemes.html | ||
// | ||
// The commented code does the job, but we can't use negative lookbehind, | ||
// due to poor support by Safari browser. | ||
// > hljs.COMMENT(`(?<!${symbol})--+(?!${symbol})`, '$'), | ||
// So instead, we'll add a no-markup rule before the COMMENT rule in the rules list | ||
// to match the problematic infix operators that contain double dash. | ||
hljs.COMMENT('--+', '$'), | ||
hljs.COMMENT( | ||
@@ -60,15 +84,2 @@ /\{-/, | ||
/* See: | ||
- https://www.haskell.org/onlinereport/lexemes.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/binary_literals.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/numeric_underscores.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/hex_float_literals.html | ||
*/ | ||
const decimalDigits = '([0-9]_*)+'; | ||
const hexDigits = '([0-9a-fA-F]_*)+'; | ||
const binaryDigits = '([01]_*)+'; | ||
const octalDigits = '([0-7]_*)+'; | ||
const NUMBER = { | ||
@@ -97,2 +108,3 @@ className: 'number', | ||
+ 'jvm dotnet safe unsafe family forall mdo proc rec', | ||
unicodeRegex: true, | ||
contains: [ | ||
@@ -199,2 +211,4 @@ // Top-level constructions. | ||
hljs.inherit(hljs.TITLE_MODE, { begin: '^[_a-z][\\w\']*' }), | ||
// No markup, prevents infix operators from being recognized as comments. | ||
{ begin: `(?!-)${symbol}--+|--+(?!-)${symbol}`}, | ||
COMMENT, | ||
@@ -201,0 +215,0 @@ { // No markup, relevance booster |
@@ -10,3 +10,7 @@ /* | ||
function haxe(hljs) { | ||
const IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*'; | ||
// C_NUMBER_RE with underscores and literal suffixes | ||
const HAXE_NUMBER_RE = /(-?)(\b0[xX][a-fA-F0-9_]+|(\b\d+(\.[\d_]*)?|\.[\d_]+)(([eE][-+]?\d+)|i32|u32|i64|f64)?)/; | ||
const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array '; | ||
@@ -18,4 +22,4 @@ | ||
keywords: { | ||
keyword: 'break case cast catch continue default do dynamic else enum extern ' | ||
+ 'for function here if import in inline never new override package private get set ' | ||
keyword: 'abstract break case cast catch continue default do dynamic else enum extern ' | ||
+ 'final for function here if import in inline is macro never new override package private get set ' | ||
+ 'public return static super switch this throw trace try typedef untyped using var while ' | ||
@@ -37,8 +41,8 @@ + HAXE_BASIC_TYPES, | ||
className: 'subst', // interpolation | ||
begin: '\\$\\{', | ||
end: '\\}' | ||
begin: /\$\{/, | ||
end: /\}/ | ||
}, | ||
{ | ||
className: 'subst', // interpolation | ||
begin: '\\$', | ||
begin: /\$/, | ||
end: /\W\}/ | ||
@@ -51,7 +55,16 @@ } | ||
hljs.C_BLOCK_COMMENT_MODE, | ||
hljs.C_NUMBER_MODE, | ||
{ | ||
className: 'number', | ||
begin: HAXE_NUMBER_RE, | ||
relevance: 0 | ||
}, | ||
{ | ||
className: 'variable', | ||
begin: "\\$" + IDENT_RE, | ||
}, | ||
{ | ||
className: 'meta', // compiler meta | ||
begin: '@:', | ||
end: '$' | ||
begin: /@:?/, | ||
end: /\(|$/, | ||
excludeEnd: true, | ||
}, | ||
@@ -66,4 +79,4 @@ { | ||
className: 'type', // function types | ||
begin: ':[ \t]*', | ||
end: '[^A-Za-z0-9_ \t\\->]', | ||
begin: /:[ \t]*/, | ||
end: /[^A-Za-z0-9_ \t\->]/, | ||
excludeBegin: true, | ||
@@ -75,4 +88,4 @@ excludeEnd: true, | ||
className: 'type', // types | ||
begin: ':[ \t]*', | ||
end: '\\W', | ||
begin: /:[ \t]*/, | ||
end: /\W/, | ||
excludeBegin: true, | ||
@@ -83,4 +96,4 @@ excludeEnd: true | ||
className: 'type', // instantiation | ||
begin: 'new *', | ||
end: '\\W', | ||
begin: /new */, | ||
end: /\W/, | ||
excludeBegin: true, | ||
@@ -90,16 +103,16 @@ excludeEnd: true | ||
{ | ||
className: 'class', // enums | ||
className: 'title.class', // enums | ||
beginKeywords: 'enum', | ||
end: '\\{', | ||
end: /\{/, | ||
contains: [ hljs.TITLE_MODE ] | ||
}, | ||
{ | ||
className: 'class', // abstracts | ||
beginKeywords: 'abstract', | ||
end: '[\\{$]', | ||
className: 'title.class', // abstracts | ||
begin: '\\babstract\\b(?=\\s*' + hljs.IDENT_RE + '\\s*\\()', | ||
end: /[\{$]/, | ||
contains: [ | ||
{ | ||
className: 'type', | ||
begin: '\\(', | ||
end: '\\)', | ||
begin: /\(/, | ||
end: /\)/, | ||
excludeBegin: true, | ||
@@ -110,4 +123,4 @@ excludeEnd: true | ||
className: 'type', | ||
begin: 'from +', | ||
end: '\\W', | ||
begin: /from +/, | ||
end: /\W/, | ||
excludeBegin: true, | ||
@@ -118,4 +131,4 @@ excludeEnd: true | ||
className: 'type', | ||
begin: 'to +', | ||
end: '\\W', | ||
begin: /to +/, | ||
end: /\W/, | ||
excludeBegin: true, | ||
@@ -129,5 +142,5 @@ excludeEnd: true | ||
{ | ||
className: 'class', // classes | ||
begin: '\\b(class|interface) +', | ||
end: '[\\{$]', | ||
className: 'title.class', // classes | ||
begin: /\b(class|interface) +/, | ||
end: /[\{$]/, | ||
excludeEnd: true, | ||
@@ -138,3 +151,3 @@ keywords: 'class interface', | ||
className: 'keyword', | ||
begin: '\\b(extends|implements) +', | ||
begin: /\b(extends|implements) +/, | ||
keywords: 'extends implements', | ||
@@ -153,7 +166,7 @@ contains: [ | ||
{ | ||
className: 'function', | ||
className: 'title.function', | ||
beginKeywords: 'function', | ||
end: '\\(', | ||
end: /\(/, | ||
excludeEnd: true, | ||
illegal: '\\S', | ||
illegal: /\S/, | ||
contains: [ hljs.TITLE_MODE ] | ||
@@ -160,0 +173,0 @@ } |
@@ -43,2 +43,3 @@ // https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.10 | ||
/** | ||
@@ -45,0 +46,0 @@ * Allows recursive regex expressions to a given depth |
@@ -166,2 +166,3 @@ const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; | ||
/** @type LanguageFn */ | ||
@@ -168,0 +169,0 @@ function javascript(hljs) { |
@@ -44,2 +44,3 @@ // https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.10 | ||
function kotlin(hljs) { | ||
@@ -46,0 +47,0 @@ const KEYWORDS = { |
/* | ||
Language: Leaf | ||
Author: Hale Chan <halechan@qq.com> | ||
Description: Based on the Leaf reference from https://vapor.github.io/documentation/guide/leaf.html. | ||
Description: A Swift-based templating language created for the Vapor project. | ||
Website: https://docs.vapor.codes/leaf/overview | ||
Category: template | ||
*/ | ||
function leaf(hljs) { | ||
const IDENT = /([A-Za-z_][A-Za-z_0-9]*)?/; | ||
const LITERALS = [ | ||
'true', | ||
'false', | ||
'in' | ||
]; | ||
const PARAMS = { | ||
scope: 'params', | ||
begin: /\(/, | ||
end: /\)(?=\:?)/, | ||
endsParent: true, | ||
relevance: 7, | ||
contains: [ | ||
{ | ||
scope: 'string', | ||
begin: '"', | ||
end: '"' | ||
}, | ||
{ | ||
scope: 'keyword', | ||
match: LITERALS.join("|"), | ||
}, | ||
{ | ||
scope: 'variable', | ||
match: /[A-Za-z_][A-Za-z_0-9]*/ | ||
}, | ||
{ | ||
scope: 'operator', | ||
match: /\+|\-|\*|\/|\%|\=\=|\=|\!|\>|\<|\&\&|\|\|/ | ||
} | ||
] | ||
}; | ||
const INSIDE_DISPATCH = { | ||
match: [ | ||
IDENT, | ||
/(?=\()/, | ||
], | ||
scope: { | ||
1: "keyword" | ||
}, | ||
contains: [ PARAMS ] | ||
}; | ||
PARAMS.contains.unshift(INSIDE_DISPATCH); | ||
return { | ||
name: 'Leaf', | ||
contains: [ | ||
// #ident(): | ||
{ | ||
className: 'function', | ||
begin: '#+' + '[A-Za-z_0-9]*' + '\\(', | ||
end: / \{/, | ||
returnBegin: true, | ||
excludeEnd: true, | ||
match: [ | ||
/#+/, | ||
IDENT, | ||
/(?=\()/, | ||
], | ||
scope: { | ||
1: "punctuation", | ||
2: "keyword" | ||
}, | ||
// will start up after the ending `)` match from line ~44 | ||
// just to grab the trailing `:` if we can match it | ||
starts: { | ||
contains: [ | ||
{ | ||
match: /\:/, | ||
scope: "punctuation" | ||
} | ||
] | ||
}, | ||
contains: [ | ||
{ | ||
className: 'keyword', | ||
begin: '#+' | ||
}, | ||
{ | ||
className: 'title', | ||
begin: '[A-Za-z_][A-Za-z_0-9]*' | ||
}, | ||
{ | ||
className: 'params', | ||
begin: '\\(', | ||
end: '\\)', | ||
endsParent: true, | ||
contains: [ | ||
{ | ||
className: 'string', | ||
begin: '"', | ||
end: '"' | ||
}, | ||
{ | ||
className: 'variable', | ||
begin: '[A-Za-z_][A-Za-z_0-9]*' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
PARAMS | ||
], | ||
}, | ||
// #ident or #ident: | ||
{ | ||
match: [ | ||
/#+/, | ||
IDENT, | ||
/:?/, | ||
], | ||
scope: { | ||
1: "punctuation", | ||
2: "keyword", | ||
3: "punctuation" | ||
} | ||
}, | ||
] | ||
@@ -46,0 +94,0 @@ }; |
@@ -41,3 +41,3 @@ const MODES = (hljs) => { | ||
className: "attr", | ||
begin: /--[A-Za-z][A-Za-z0-9_-]*/ | ||
begin: /--[A-Za-z_][A-Za-z0-9_-]*/ | ||
} | ||
@@ -614,2 +614,3 @@ }; | ||
/** @type LanguageFn */ | ||
@@ -616,0 +617,0 @@ function less(hljs) { |
@@ -155,2 +155,3 @@ const KEYWORDS = [ | ||
function livescript(hljs) { | ||
@@ -157,0 +158,0 @@ const LIVESCRIPT_BUILT_INS = [ |
@@ -8,2 +8,3 @@ /* | ||
function nsis(hljs) { | ||
@@ -116,2 +117,3 @@ const regex = hljs.regex; | ||
"appendfile", | ||
"assert", | ||
"cd", | ||
@@ -118,0 +120,0 @@ "define", |
@@ -9,297 +9,131 @@ /* | ||
function reasonml(hljs) { | ||
function orReValues(ops) { | ||
return ops | ||
.map(function(op) { | ||
return op | ||
.split('') | ||
.map(function(char) { | ||
return '\\' + char; | ||
}) | ||
.join(''); | ||
}) | ||
.join('|'); | ||
} | ||
const RE_IDENT = '~?[a-z$_][0-9a-zA-Z$_]*'; | ||
const RE_MODULE_IDENT = '`?[A-Z$_][0-9a-zA-Z$_]*'; | ||
const RE_PARAM_TYPEPARAM = '\'?[a-z$_][0-9a-z$_]*'; | ||
const RE_PARAM_TYPE = '\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*(' + RE_PARAM_TYPEPARAM + '\\s*(,' + RE_PARAM_TYPEPARAM + '\\s*)*)?\\))?'; | ||
const RE_PARAM = RE_IDENT + '(' + RE_PARAM_TYPE + '){0,2}'; | ||
const RE_OPERATOR = "(" + orReValues([ | ||
'||', | ||
'++', | ||
'**', | ||
'+.', | ||
'*', | ||
'/', | ||
'*.', | ||
'/.', | ||
'...' | ||
]) + "|\\|>|&&|==|===)"; | ||
const RE_OPERATOR_SPACED = "\\s+" + RE_OPERATOR + "\\s+"; | ||
const KEYWORDS = { | ||
keyword: | ||
'and as asr assert begin class constraint do done downto else end exception external ' | ||
+ 'for fun function functor if in include inherit initializer ' | ||
+ 'land lazy let lor lsl lsr lxor match method mod module mutable new nonrec ' | ||
+ 'object of open or private rec sig struct then to try type val virtual when while with', | ||
built_in: | ||
'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ', | ||
literal: | ||
'true false' | ||
}; | ||
const RE_NUMBER = '\\b(0[xX][a-fA-F0-9_]+[Lln]?|' | ||
+ '0[oO][0-7_]+[Lln]?|' | ||
+ '0[bB][01_]+[Lln]?|' | ||
+ '[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)'; | ||
const NUMBER_MODE = { | ||
className: 'number', | ||
relevance: 0, | ||
variants: [ | ||
{ begin: RE_NUMBER }, | ||
{ begin: '\\(-' + RE_NUMBER + '\\)' } | ||
] | ||
}; | ||
const OPERATOR_MODE = { | ||
className: 'operator', | ||
relevance: 0, | ||
begin: RE_OPERATOR | ||
}; | ||
const LIST_CONTENTS_MODES = [ | ||
{ | ||
className: 'identifier', | ||
relevance: 0, | ||
begin: RE_IDENT | ||
}, | ||
OPERATOR_MODE, | ||
NUMBER_MODE | ||
const BUILT_IN_TYPES = [ | ||
"array", | ||
"bool", | ||
"bytes", | ||
"char", | ||
"exn|5", | ||
"float", | ||
"int", | ||
"int32", | ||
"int64", | ||
"list", | ||
"lazy_t|5", | ||
"nativeint|5", | ||
"ref", | ||
"string", | ||
"unit", | ||
]; | ||
const MODULE_ACCESS_CONTENTS = [ | ||
hljs.QUOTE_STRING_MODE, | ||
OPERATOR_MODE, | ||
{ | ||
className: 'module', | ||
begin: "\\b" + RE_MODULE_IDENT, | ||
returnBegin: true, | ||
relevance: 0, | ||
end: "\.", | ||
contains: [ | ||
{ | ||
className: 'identifier', | ||
begin: RE_MODULE_IDENT, | ||
relevance: 0 | ||
} | ||
] | ||
} | ||
]; | ||
const PARAMS_CONTENTS = [ | ||
{ | ||
className: 'module', | ||
begin: "\\b" + RE_MODULE_IDENT, | ||
returnBegin: true, | ||
end: "\.", | ||
relevance: 0, | ||
contains: [ | ||
{ | ||
className: 'identifier', | ||
begin: RE_MODULE_IDENT, | ||
relevance: 0 | ||
} | ||
] | ||
} | ||
]; | ||
const PARAMS_MODE = { | ||
begin: RE_IDENT, | ||
end: '(,|\\n|\\))', | ||
relevance: 0, | ||
contains: [ | ||
OPERATOR_MODE, | ||
{ | ||
className: 'typing', | ||
begin: ':', | ||
end: '(,|\\n)', | ||
returnBegin: true, | ||
relevance: 0, | ||
contains: PARAMS_CONTENTS | ||
} | ||
] | ||
}; | ||
const FUNCTION_BLOCK_MODE = { | ||
className: 'function', | ||
relevance: 0, | ||
keywords: KEYWORDS, | ||
variants: [ | ||
{ | ||
begin: '\\s(\\(\\.?.*?\\)|' + RE_IDENT + ')\\s*=>', | ||
end: '\\s*=>', | ||
returnBegin: true, | ||
relevance: 0, | ||
contains: [ | ||
{ | ||
className: 'params', | ||
variants: [ | ||
{ begin: RE_IDENT }, | ||
{ begin: RE_PARAM }, | ||
{ begin: /\(\s*\)/ } | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
begin: '\\s\\(\\.?[^;\\|]*\\)\\s*=>', | ||
end: '\\s=>', | ||
returnBegin: true, | ||
relevance: 0, | ||
contains: [ | ||
{ | ||
className: 'params', | ||
relevance: 0, | ||
variants: [ PARAMS_MODE ] | ||
} | ||
] | ||
}, | ||
{ begin: '\\(\\.\\s' + RE_IDENT + '\\)\\s*=>' } | ||
] | ||
}; | ||
MODULE_ACCESS_CONTENTS.push(FUNCTION_BLOCK_MODE); | ||
const CONSTRUCTOR_MODE = { | ||
className: 'constructor', | ||
begin: RE_MODULE_IDENT + '\\(', | ||
end: '\\)', | ||
illegal: '\\n', | ||
keywords: KEYWORDS, | ||
contains: [ | ||
hljs.QUOTE_STRING_MODE, | ||
OPERATOR_MODE, | ||
{ | ||
className: 'params', | ||
begin: '\\b' + RE_IDENT | ||
} | ||
] | ||
}; | ||
const PATTERN_MATCH_BLOCK_MODE = { | ||
className: 'pattern-match', | ||
begin: '\\|', | ||
returnBegin: true, | ||
keywords: KEYWORDS, | ||
end: '=>', | ||
relevance: 0, | ||
contains: [ | ||
CONSTRUCTOR_MODE, | ||
OPERATOR_MODE, | ||
{ | ||
relevance: 0, | ||
className: 'constructor', | ||
begin: RE_MODULE_IDENT | ||
} | ||
] | ||
}; | ||
const MODULE_ACCESS_MODE = { | ||
className: 'module-access', | ||
keywords: KEYWORDS, | ||
returnBegin: true, | ||
variants: [ | ||
{ begin: "\\b(" + RE_MODULE_IDENT + "\\.)+" + RE_IDENT }, | ||
{ | ||
begin: "\\b(" + RE_MODULE_IDENT + "\\.)+\\(", | ||
end: "\\)", | ||
returnBegin: true, | ||
contains: [ | ||
FUNCTION_BLOCK_MODE, | ||
{ | ||
begin: '\\(', | ||
end: '\\)', | ||
relevance: 0, | ||
skip: true | ||
} | ||
].concat(MODULE_ACCESS_CONTENTS) | ||
}, | ||
{ | ||
begin: "\\b(" + RE_MODULE_IDENT + "\\.)+\\{", | ||
end: /\}/ | ||
} | ||
], | ||
contains: MODULE_ACCESS_CONTENTS | ||
}; | ||
PARAMS_CONTENTS.push(MODULE_ACCESS_MODE); | ||
return { | ||
name: 'ReasonML', | ||
aliases: [ 're' ], | ||
keywords: KEYWORDS, | ||
illegal: '(:-|:=|\\$\\{|\\+=)', | ||
keywords: { | ||
$pattern: /[a-z_]\w*!?/, | ||
keyword: [ | ||
"and", | ||
"as", | ||
"asr", | ||
"assert", | ||
"begin", | ||
"class", | ||
"constraint", | ||
"do", | ||
"done", | ||
"downto", | ||
"else", | ||
"end", | ||
"esfun", | ||
"exception", | ||
"external", | ||
"for", | ||
"fun", | ||
"function", | ||
"functor", | ||
"if", | ||
"in", | ||
"include", | ||
"inherit", | ||
"initializer", | ||
"land", | ||
"lazy", | ||
"let", | ||
"lor", | ||
"lsl", | ||
"lsr", | ||
"lxor", | ||
"mod", | ||
"module", | ||
"mutable", | ||
"new", | ||
"nonrec", | ||
"object", | ||
"of", | ||
"open", | ||
"or", | ||
"pri", | ||
"pub", | ||
"rec", | ||
"sig", | ||
"struct", | ||
"switch", | ||
"then", | ||
"to", | ||
"try", | ||
"type", | ||
"val", | ||
"virtual", | ||
"when", | ||
"while", | ||
"with", | ||
], | ||
built_in: BUILT_IN_TYPES, | ||
literal: ["true", "false"], | ||
}, | ||
illegal: /(:-|:=|\$\{|\+=)/, | ||
contains: [ | ||
hljs.COMMENT('/\\*', '\\*/', { illegal: '^(#,\\/\\/)' }), | ||
{ | ||
className: 'character', | ||
begin: '\'(\\\\[^\']+|[^\'])\'', | ||
illegal: '\\n', | ||
scope: 'literal', | ||
match: /\[(\|\|)?\]|\(\)/, | ||
relevance: 0 | ||
}, | ||
hljs.QUOTE_STRING_MODE, | ||
{ | ||
className: 'literal', | ||
begin: '\\(\\)', | ||
hljs.C_LINE_COMMENT_MODE, | ||
hljs.COMMENT(/\/\*/, /\*\//, { illegal: /^(#,\/\/)/ }), | ||
{ /* type variable */ | ||
scope: 'symbol', | ||
match: /\'[A-Za-z_](?!\')[\w\']*/ | ||
/* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */ | ||
}, | ||
{ /* polymorphic variant */ | ||
scope: 'type', | ||
match: /`[A-Z][\w\']*/ | ||
}, | ||
{ /* module or constructor */ | ||
scope: 'type', | ||
match: /\b[A-Z][\w\']*/, | ||
relevance: 0 | ||
}, | ||
{ | ||
className: 'literal', | ||
begin: '\\[\\|', | ||
end: '\\|\\]', | ||
relevance: 0, | ||
contains: LIST_CONTENTS_MODES | ||
{ /* don't color identifiers, but safely catch all identifiers with ' */ | ||
match: /[a-z_]\w*\'[\w\']*/, | ||
relevance: 0 | ||
}, | ||
{ | ||
className: 'literal', | ||
begin: '\\[', | ||
end: '\\]', | ||
relevance: 0, | ||
contains: LIST_CONTENTS_MODES | ||
}, | ||
CONSTRUCTOR_MODE, | ||
scope: 'operator', | ||
match: /\s+(\|\||\+[\+\.]?|\*[\*\/\.]?|\/[\.]?|\.\.\.|\|>|&&|===?)\s+/, | ||
relevance: 0 | ||
}, | ||
hljs.inherit(hljs.APOS_STRING_MODE, { | ||
scope: 'string', | ||
relevance: 0 | ||
}), | ||
hljs.inherit(hljs.QUOTE_STRING_MODE, { illegal: null }), | ||
{ | ||
className: 'operator', | ||
begin: RE_OPERATOR_SPACED, | ||
illegal: '-->', | ||
scope: 'number', | ||
variants: [ | ||
{ match: /\b0[xX][a-fA-F0-9_]+[Lln]?/ }, | ||
{ match: /\b0[oO][0-7_]+[Lln]?/ }, | ||
{ match: /\b0[bB][01_]+[Lln]?/ }, | ||
{ match: /\b[0-9][0-9_]*([Lln]|(\.[0-9_]*)?([eE][-+]?[0-9_]+)?)/ }, | ||
], | ||
relevance: 0 | ||
}, | ||
NUMBER_MODE, | ||
hljs.C_LINE_COMMENT_MODE, | ||
PATTERN_MATCH_BLOCK_MODE, | ||
FUNCTION_BLOCK_MODE, | ||
{ | ||
className: 'module-def', | ||
begin: "\\bmodule\\s+" + RE_IDENT + "\\s+" + RE_MODULE_IDENT + "\\s+=\\s+\\{", | ||
end: /\}/, | ||
returnBegin: true, | ||
keywords: KEYWORDS, | ||
relevance: 0, | ||
contains: [ | ||
{ | ||
className: 'module', | ||
relevance: 0, | ||
begin: RE_MODULE_IDENT | ||
}, | ||
{ | ||
begin: /\{/, | ||
end: /\}/, | ||
relevance: 0, | ||
skip: true | ||
} | ||
].concat(MODULE_ACCESS_CONTENTS) | ||
}, | ||
MODULE_ACCESS_MODE | ||
] | ||
@@ -306,0 +140,0 @@ }; |
@@ -17,3 +17,3 @@ /* | ||
/\b/, | ||
/(?!let\b)/, | ||
/(?!let|for|while|if|else|match\b)/, | ||
hljs.IDENT_RE, | ||
@@ -127,2 +127,3 @@ regex.lookahead(/\s*\(/)) | ||
"env!", | ||
"eprintln!", | ||
"panic!", | ||
@@ -129,0 +130,0 @@ "file!", |
@@ -91,3 +91,7 @@ /* | ||
relevance: 0, | ||
contains: [ TYPE ] | ||
contains: [ | ||
TYPE, | ||
hljs.C_LINE_COMMENT_MODE, | ||
hljs.C_BLOCK_COMMENT_MODE, | ||
] | ||
}, | ||
@@ -101,3 +105,7 @@ { | ||
relevance: 0, | ||
contains: [ TYPE ] | ||
contains: [ | ||
TYPE, | ||
hljs.C_LINE_COMMENT_MODE, | ||
hljs.C_BLOCK_COMMENT_MODE, | ||
] | ||
}, | ||
@@ -156,2 +164,30 @@ NAME | ||
// glob all non-whitespace characters as a "string" | ||
// sourced from https://github.com/scala/docs.scala-lang/pull/2845 | ||
const DIRECTIVE_VALUE = { | ||
className: 'string', | ||
begin: /\S+/, | ||
}; | ||
// directives | ||
// sourced from https://github.com/scala/docs.scala-lang/pull/2845 | ||
const USING_DIRECTIVE = { | ||
begin: [ | ||
'//>', | ||
/\s+/, | ||
/using/, | ||
/\s+/, | ||
/\S+/ | ||
], | ||
beginScope: { | ||
1: "comment", | ||
3: "keyword", | ||
5: "type" | ||
}, | ||
end: /$/, | ||
contains: [ | ||
DIRECTIVE_VALUE, | ||
] | ||
}; | ||
return { | ||
@@ -164,2 +200,3 @@ name: 'Scala', | ||
contains: [ | ||
USING_DIRECTIVE, | ||
hljs.C_LINE_COMMENT_MODE, | ||
@@ -166,0 +203,0 @@ hljs.C_BLOCK_COMMENT_MODE, |
@@ -41,3 +41,3 @@ const MODES = (hljs) => { | ||
className: "attr", | ||
begin: /--[A-Za-z][A-Za-z0-9_-]*/ | ||
begin: /--[A-Za-z_][A-Za-z0-9_-]*/ | ||
} | ||
@@ -611,2 +611,3 @@ }; | ||
/** @type LanguageFn */ | ||
@@ -613,0 +614,0 @@ function scss(hljs) { |
@@ -35,2 +35,3 @@ /* | ||
'array', | ||
'tuple', | ||
'complex', | ||
@@ -40,2 +41,3 @@ 'int', | ||
'vector', | ||
'complex_vector', | ||
'ordered', | ||
@@ -46,3 +48,5 @@ 'positive_ordered', | ||
'row_vector', | ||
'complex_row_vector', | ||
'matrix', | ||
'complex_matrix', | ||
'cholesky_factor_corr|10', | ||
@@ -64,4 +68,2 @@ 'cholesky_factor_cov|10', | ||
const FUNCTIONS = [ | ||
'Phi', | ||
'Phi_approx', | ||
'abs', | ||
@@ -84,3 +86,2 @@ 'acos', | ||
'binary_log_loss', | ||
'binomial_coefficient_log', | ||
'block', | ||
@@ -96,2 +97,5 @@ 'cbrt', | ||
'columns_dot_self', | ||
'complex_schur_decompose', | ||
'complex_schur_decompose_t', | ||
'complex_schur_decompose_u', | ||
'conj', | ||
@@ -102,2 +106,3 @@ 'cos', | ||
'crossprod', | ||
'csr_extract', | ||
'csr_extract_u', | ||
@@ -109,7 +114,9 @@ 'csr_extract_v', | ||
'cumulative_sum', | ||
'dae', | ||
'dae_tol', | ||
'determinant', | ||
'diag_matrix', | ||
'diagonal', | ||
'diag_post_multiply', | ||
'diag_pre_multiply', | ||
'diagonal', | ||
'digamma', | ||
@@ -120,3 +127,7 @@ 'dims', | ||
'dot_self', | ||
'eigendecompose', | ||
'eigendecompose_sym', | ||
'eigenvalues', | ||
'eigenvalues_sym', | ||
'eigenvectors', | ||
'eigenvectors_sym', | ||
@@ -128,5 +139,6 @@ 'erf', | ||
'expm1', | ||
'fabs', | ||
'falling_factorial', | ||
'fdim', | ||
'fft', | ||
'fft2', | ||
'floor', | ||
@@ -141,3 +153,2 @@ 'fma', | ||
'get_imag', | ||
'get_lp', | ||
'get_real', | ||
@@ -150,3 +161,2 @@ 'head', | ||
'inc_beta', | ||
'int_step', | ||
'integrate_1d', | ||
@@ -157,10 +167,15 @@ 'integrate_ode', | ||
'integrate_ode_rk45', | ||
'int_step', | ||
'inv', | ||
'inv_Phi', | ||
'inv_cloglog', | ||
'inv_erfc', | ||
'inverse', | ||
'inverse_spd', | ||
'inv_fft', | ||
'inv_fft2', | ||
'inv_inc_beta', | ||
'inv_logit', | ||
'inv_Phi', | ||
'inv_sqrt', | ||
'inv_square', | ||
'inverse', | ||
'inverse_spd', | ||
'is_inf', | ||
@@ -191,2 +206,3 @@ 'is_nan', | ||
'log_inv_logit_diff', | ||
'logit', | ||
'log_mix', | ||
@@ -197,3 +213,2 @@ 'log_modified_bessel_first_kind', | ||
'log_sum_exp', | ||
'logit', | ||
'machine_precision', | ||
@@ -213,6 +228,7 @@ 'map_rect', | ||
'modified_bessel_second_kind', | ||
'multiply_log', | ||
'multiply_lower_tri_self_transpose', | ||
'negative_infinity', | ||
'norm', | ||
'norm1', | ||
'norm2', | ||
'not_a_number', | ||
@@ -238,2 +254,4 @@ 'num_elements', | ||
'owens_t', | ||
'Phi', | ||
'Phi_approx', | ||
'polar', | ||
@@ -245,4 +263,6 @@ 'positive_infinity', | ||
'proj', | ||
'qr', | ||
'qr_Q', | ||
'qr_R', | ||
'qr_thin', | ||
'qr_thin_Q', | ||
@@ -287,2 +307,3 @@ 'qr_thin_R', | ||
'sum', | ||
'svd', | ||
'svd_U', | ||
@@ -300,2 +321,3 @@ 'svd_V', | ||
'to_complex', | ||
'to_int', | ||
'to_matrix', | ||
@@ -344,14 +366,18 @@ 'to_row_vector', | ||
'inv_wishart', | ||
'inv_wishart_cholesky', | ||
'lkj_corr', | ||
'lkj_corr_cholesky', | ||
'logistic', | ||
'loglogistic', | ||
'lognormal', | ||
'multi_gp', | ||
'multi_gp_cholesky', | ||
'multinomial', | ||
'multinomial_logit', | ||
'multi_normal', | ||
'multi_normal_cholesky', | ||
'multi_normal_prec', | ||
'multi_student_cholesky_t', | ||
'multi_student_t', | ||
'multinomial', | ||
'multinomial_logit', | ||
'multi_student_t_cholesky', | ||
'neg_binomial', | ||
@@ -376,2 +402,3 @@ 'neg_binomial_2', | ||
'std_normal', | ||
'std_normal_log', | ||
'student_t', | ||
@@ -382,3 +409,4 @@ 'uniform', | ||
'wiener', | ||
'wishart' | ||
'wishart', | ||
'wishart_cholesky' | ||
]; | ||
@@ -385,0 +413,0 @@ |
@@ -41,3 +41,3 @@ const MODES = (hljs) => { | ||
className: "attr", | ||
begin: /--[A-Za-z][A-Za-z0-9_-]*/ | ||
begin: /--[A-Za-z_][A-Za-z0-9_-]*/ | ||
} | ||
@@ -611,2 +611,3 @@ }; | ||
/** @type LanguageFn */ | ||
@@ -613,0 +614,0 @@ function stylus(hljs) { |
@@ -104,2 +104,3 @@ /** | ||
'as', // operator | ||
'borrowing', // contextual | ||
'break', | ||
@@ -109,4 +110,7 @@ 'case', | ||
'class', | ||
'consume', // contextual | ||
'consuming', // contextual | ||
'continue', | ||
'convenience', // contextual | ||
'copy', // contextual | ||
'default', | ||
@@ -119,2 +123,3 @@ 'defer', | ||
'dynamic', // contextual | ||
'each', | ||
'else', | ||
@@ -146,2 +151,3 @@ 'enum', | ||
'let', | ||
'macro', | ||
'mutating', // contextual | ||
@@ -231,3 +237,2 @@ 'nonmutating', // contextual | ||
'#sourceLocation', | ||
'#warn_unqualified_access', | ||
'#warning' | ||
@@ -346,3 +351,5 @@ ]; | ||
// @available is handled separately. | ||
// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes | ||
const keywordAttributes = [ | ||
'attached', | ||
'autoclosure', | ||
@@ -354,2 +361,3 @@ concat(/convention\(/, either('swift', 'block', 'c'), /\)/), | ||
'escaping', | ||
'freestanding', | ||
'frozen', | ||
@@ -374,6 +382,9 @@ 'GKInspectable', | ||
'resultBuilder', | ||
'Sendable', | ||
'testable', | ||
'UIApplicationMain', | ||
'unchecked', | ||
'unknown', | ||
'usableFromInline' | ||
'usableFromInline', | ||
'warn_unqualified_access' | ||
]; | ||
@@ -405,2 +416,3 @@ | ||
/** @type LanguageFn */ | ||
@@ -572,2 +584,46 @@ function swift(hljs) { | ||
const REGEXP_CONTENTS = [ | ||
hljs.BACKSLASH_ESCAPE, | ||
{ | ||
begin: /\[/, | ||
end: /\]/, | ||
relevance: 0, | ||
contains: [ hljs.BACKSLASH_ESCAPE ] | ||
} | ||
]; | ||
const BARE_REGEXP_LITERAL = { | ||
begin: /\/[^\s](?=[^/\n]*\/)/, | ||
end: /\//, | ||
contains: REGEXP_CONTENTS | ||
}; | ||
const EXTENDED_REGEXP_LITERAL = (rawDelimiter) => { | ||
const begin = concat(rawDelimiter, /\//); | ||
const end = concat(/\//, rawDelimiter); | ||
return { | ||
begin, | ||
end, | ||
contains: [ | ||
...REGEXP_CONTENTS, | ||
{ | ||
scope: "comment", | ||
begin: `#(?!.*${end})`, | ||
end: /$/, | ||
}, | ||
], | ||
}; | ||
}; | ||
// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/lexicalstructure/#Regular-Expression-Literals | ||
const REGEXP = { | ||
scope: "regexp", | ||
variants: [ | ||
EXTENDED_REGEXP_LITERAL('###'), | ||
EXTENDED_REGEXP_LITERAL('##'), | ||
EXTENDED_REGEXP_LITERAL('#'), | ||
BARE_REGEXP_LITERAL | ||
] | ||
}; | ||
// https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID412 | ||
@@ -592,3 +648,3 @@ const QUOTED_IDENTIFIER = { match: concat(/`/, identifier, /`/) }; | ||
match: /(@|#(un)?)available/, | ||
className: "keyword", | ||
scope: 'keyword', | ||
starts: { contains: [ | ||
@@ -608,7 +664,7 @@ { | ||
const KEYWORD_ATTRIBUTE = { | ||
className: 'keyword', | ||
scope: 'keyword', | ||
match: concat(/@/, either(...keywordAttributes)) | ||
}; | ||
const USER_DEFINED_ATTRIBUTE = { | ||
className: 'meta', | ||
scope: 'meta', | ||
match: concat(/@/, identifier) | ||
@@ -681,2 +737,3 @@ }; | ||
...COMMENTS, | ||
REGEXP, | ||
...KEYWORD_MODES, | ||
@@ -696,2 +753,3 @@ ...BUILT_INS, | ||
end: />/, | ||
keywords: 'repeat each', | ||
contains: [ | ||
@@ -739,5 +797,6 @@ ...COMMENTS, | ||
// https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID362 | ||
const FUNCTION = { | ||
// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/declarations/#Macro-Declaration | ||
const FUNCTION_OR_MACRO = { | ||
match: [ | ||
/func/, | ||
/(func|macro)/, | ||
/\s+/, | ||
@@ -839,3 +898,3 @@ either(QUOTED_IDENTIFIER.match, identifier, operator) | ||
...COMMENTS, | ||
FUNCTION, | ||
FUNCTION_OR_MACRO, | ||
INIT_SUBSCRIPT, | ||
@@ -863,2 +922,3 @@ { | ||
}, | ||
REGEXP, | ||
...KEYWORD_MODES, | ||
@@ -865,0 +925,0 @@ ...BUILT_INS, |
@@ -166,2 +166,3 @@ const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; | ||
/** @type LanguageFn */ | ||
@@ -775,2 +776,3 @@ function javascript(hljs) { | ||
/** @type LanguageFn */ | ||
@@ -777,0 +779,0 @@ function typescript(hljs) { |
@@ -345,3 +345,4 @@ /* | ||
'xpath', | ||
'xq' | ||
'xq', | ||
'xqm' | ||
], | ||
@@ -348,0 +349,0 @@ case_insensitive: false, |
@@ -575,2 +575,3 @@ /* | ||
/** @type LanguageFn */ | ||
@@ -577,0 +578,0 @@ function arduino(hljs) { |
@@ -35,2 +35,6 @@ /* | ||
'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 ' // standard registers | ||
+ 'w0 w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 ' // 32 bit ARMv8 registers | ||
+ 'w16 w17 w18 w19 w20 w21 w22 w23 w24 w25 w26 w27 w28 w29 w30 ' | ||
+ 'x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 ' // 64 bit ARMv8 registers | ||
+ 'x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 ' | ||
+ 'pc lr sp ip sl sb fp ' // typical regs plus backward compatibility | ||
@@ -37,0 +41,0 @@ + 'a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 ' // more regs and fp |
@@ -63,5 +63,3 @@ /* | ||
const ESCAPED_QUOTE = { | ||
className: '', | ||
begin: /\\"/ | ||
match: /\\"/ | ||
}; | ||
@@ -73,2 +71,5 @@ const APOS_STRING = { | ||
}; | ||
const ESCAPED_APOS = { | ||
match: /\\'/ | ||
}; | ||
const ARITHMETIC = { | ||
@@ -386,2 +387,3 @@ begin: /\$?\(\(/, | ||
APOS_STRING, | ||
ESCAPED_APOS, | ||
VAR | ||
@@ -388,0 +390,0 @@ ] |
@@ -154,2 +154,3 @@ const KEYWORDS = [ | ||
/** @type LanguageFn */ | ||
@@ -156,0 +157,0 @@ function coffeescript(hljs) { |
@@ -41,3 +41,3 @@ const MODES = (hljs) => { | ||
className: "attr", | ||
begin: /--[A-Za-z][A-Za-z0-9_-]*/ | ||
begin: /--[A-Za-z_][A-Za-z0-9_-]*/ | ||
} | ||
@@ -609,2 +609,3 @@ }; | ||
/** @type LanguageFn */ | ||
@@ -611,0 +612,0 @@ function css(hljs) { |
@@ -78,2 +78,3 @@ /** | ||
/** @type LanguageFn */ | ||
@@ -80,0 +81,0 @@ function fsharp(hljs) { |
@@ -69,3 +69,3 @@ /* | ||
match: [ | ||
/(class|interface|trait|enum|extends|implements)/, | ||
/(class|interface|trait|enum|record|extends|implements)/, | ||
/\s+/, | ||
@@ -130,3 +130,4 @@ hljs.UNDERSCORE_IDENT_RE | ||
"return", | ||
"instanceof" | ||
"instanceof", | ||
"var" | ||
]; | ||
@@ -133,0 +134,0 @@ |
@@ -10,4 +10,28 @@ /* | ||
function haskell(hljs) { | ||
/* See: | ||
- https://www.haskell.org/onlinereport/lexemes.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/binary_literals.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/numeric_underscores.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/hex_float_literals.html | ||
*/ | ||
const decimalDigits = '([0-9]_*)+'; | ||
const hexDigits = '([0-9a-fA-F]_*)+'; | ||
const binaryDigits = '([01]_*)+'; | ||
const octalDigits = '([0-7]_*)+'; | ||
const ascSymbol = '[!#$%&*+.\\/<=>?@\\\\^~-]'; | ||
const uniSymbol = '(\\p{S}|\\p{P})'; // Symbol or Punctuation | ||
const special = '[(),;\\[\\]`|{}]'; | ||
const symbol = `(${ascSymbol}|(?!(${special}|[_:"']))${uniSymbol})`; | ||
const COMMENT = { variants: [ | ||
hljs.COMMENT('--', '$'), | ||
// Double dash forms a valid comment only if it's not part of legal lexeme. | ||
// See: Haskell 98 report: https://www.haskell.org/onlinereport/lexemes.html | ||
// | ||
// The commented code does the job, but we can't use negative lookbehind, | ||
// due to poor support by Safari browser. | ||
// > hljs.COMMENT(`(?<!${symbol})--+(?!${symbol})`, '$'), | ||
// So instead, we'll add a no-markup rule before the COMMENT rule in the rules list | ||
// to match the problematic infix operators that contain double dash. | ||
hljs.COMMENT('--+', '$'), | ||
hljs.COMMENT( | ||
@@ -60,15 +84,2 @@ /\{-/, | ||
/* See: | ||
- https://www.haskell.org/onlinereport/lexemes.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/binary_literals.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/numeric_underscores.html | ||
- https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/hex_float_literals.html | ||
*/ | ||
const decimalDigits = '([0-9]_*)+'; | ||
const hexDigits = '([0-9a-fA-F]_*)+'; | ||
const binaryDigits = '([01]_*)+'; | ||
const octalDigits = '([0-7]_*)+'; | ||
const NUMBER = { | ||
@@ -97,2 +108,3 @@ className: 'number', | ||
+ 'jvm dotnet safe unsafe family forall mdo proc rec', | ||
unicodeRegex: true, | ||
contains: [ | ||
@@ -199,2 +211,4 @@ // Top-level constructions. | ||
hljs.inherit(hljs.TITLE_MODE, { begin: '^[_a-z][\\w\']*' }), | ||
// No markup, prevents infix operators from being recognized as comments. | ||
{ begin: `(?!-)${symbol}--+|--+(?!-)${symbol}`}, | ||
COMMENT, | ||
@@ -201,0 +215,0 @@ { // No markup, relevance booster |
@@ -10,3 +10,7 @@ /* | ||
function haxe(hljs) { | ||
const IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*'; | ||
// C_NUMBER_RE with underscores and literal suffixes | ||
const HAXE_NUMBER_RE = /(-?)(\b0[xX][a-fA-F0-9_]+|(\b\d+(\.[\d_]*)?|\.[\d_]+)(([eE][-+]?\d+)|i32|u32|i64|f64)?)/; | ||
const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array '; | ||
@@ -18,4 +22,4 @@ | ||
keywords: { | ||
keyword: 'break case cast catch continue default do dynamic else enum extern ' | ||
+ 'for function here if import in inline never new override package private get set ' | ||
keyword: 'abstract break case cast catch continue default do dynamic else enum extern ' | ||
+ 'final for function here if import in inline is macro never new override package private get set ' | ||
+ 'public return static super switch this throw trace try typedef untyped using var while ' | ||
@@ -37,8 +41,8 @@ + HAXE_BASIC_TYPES, | ||
className: 'subst', // interpolation | ||
begin: '\\$\\{', | ||
end: '\\}' | ||
begin: /\$\{/, | ||
end: /\}/ | ||
}, | ||
{ | ||
className: 'subst', // interpolation | ||
begin: '\\$', | ||
begin: /\$/, | ||
end: /\W\}/ | ||
@@ -51,7 +55,16 @@ } | ||
hljs.C_BLOCK_COMMENT_MODE, | ||
hljs.C_NUMBER_MODE, | ||
{ | ||
className: 'number', | ||
begin: HAXE_NUMBER_RE, | ||
relevance: 0 | ||
}, | ||
{ | ||
className: 'variable', | ||
begin: "\\$" + IDENT_RE, | ||
}, | ||
{ | ||
className: 'meta', // compiler meta | ||
begin: '@:', | ||
end: '$' | ||
begin: /@:?/, | ||
end: /\(|$/, | ||
excludeEnd: true, | ||
}, | ||
@@ -66,4 +79,4 @@ { | ||
className: 'type', // function types | ||
begin: ':[ \t]*', | ||
end: '[^A-Za-z0-9_ \t\\->]', | ||
begin: /:[ \t]*/, | ||
end: /[^A-Za-z0-9_ \t\->]/, | ||
excludeBegin: true, | ||
@@ -75,4 +88,4 @@ excludeEnd: true, | ||
className: 'type', // types | ||
begin: ':[ \t]*', | ||
end: '\\W', | ||
begin: /:[ \t]*/, | ||
end: /\W/, | ||
excludeBegin: true, | ||
@@ -83,4 +96,4 @@ excludeEnd: true | ||
className: 'type', // instantiation | ||
begin: 'new *', | ||
end: '\\W', | ||
begin: /new */, | ||
end: /\W/, | ||
excludeBegin: true, | ||
@@ -90,16 +103,16 @@ excludeEnd: true | ||
{ | ||
className: 'class', // enums | ||
className: 'title.class', // enums | ||
beginKeywords: 'enum', | ||
end: '\\{', | ||
end: /\{/, | ||
contains: [ hljs.TITLE_MODE ] | ||
}, | ||
{ | ||
className: 'class', // abstracts | ||
beginKeywords: 'abstract', | ||
end: '[\\{$]', | ||
className: 'title.class', // abstracts | ||
begin: '\\babstract\\b(?=\\s*' + hljs.IDENT_RE + '\\s*\\()', | ||
end: /[\{$]/, | ||
contains: [ | ||
{ | ||
className: 'type', | ||
begin: '\\(', | ||
end: '\\)', | ||
begin: /\(/, | ||
end: /\)/, | ||
excludeBegin: true, | ||
@@ -110,4 +123,4 @@ excludeEnd: true | ||
className: 'type', | ||
begin: 'from +', | ||
end: '\\W', | ||
begin: /from +/, | ||
end: /\W/, | ||
excludeBegin: true, | ||
@@ -118,4 +131,4 @@ excludeEnd: true | ||
className: 'type', | ||
begin: 'to +', | ||
end: '\\W', | ||
begin: /to +/, | ||
end: /\W/, | ||
excludeBegin: true, | ||
@@ -129,5 +142,5 @@ excludeEnd: true | ||
{ | ||
className: 'class', // classes | ||
begin: '\\b(class|interface) +', | ||
end: '[\\{$]', | ||
className: 'title.class', // classes | ||
begin: /\b(class|interface) +/, | ||
end: /[\{$]/, | ||
excludeEnd: true, | ||
@@ -138,3 +151,3 @@ keywords: 'class interface', | ||
className: 'keyword', | ||
begin: '\\b(extends|implements) +', | ||
begin: /\b(extends|implements) +/, | ||
keywords: 'extends implements', | ||
@@ -153,7 +166,7 @@ contains: [ | ||
{ | ||
className: 'function', | ||
className: 'title.function', | ||
beginKeywords: 'function', | ||
end: '\\(', | ||
end: /\(/, | ||
excludeEnd: true, | ||
illegal: '\\S', | ||
illegal: /\S/, | ||
contains: [ hljs.TITLE_MODE ] | ||
@@ -160,0 +173,0 @@ } |
@@ -43,2 +43,3 @@ // https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.10 | ||
/** | ||
@@ -45,0 +46,0 @@ * Allows recursive regex expressions to a given depth |
@@ -166,2 +166,3 @@ const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; | ||
/** @type LanguageFn */ | ||
@@ -168,0 +169,0 @@ function javascript(hljs) { |
@@ -44,2 +44,3 @@ // https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.10 | ||
function kotlin(hljs) { | ||
@@ -46,0 +47,0 @@ const KEYWORDS = { |
/* | ||
Language: Leaf | ||
Author: Hale Chan <halechan@qq.com> | ||
Description: Based on the Leaf reference from https://vapor.github.io/documentation/guide/leaf.html. | ||
Description: A Swift-based templating language created for the Vapor project. | ||
Website: https://docs.vapor.codes/leaf/overview | ||
Category: template | ||
*/ | ||
function leaf(hljs) { | ||
const IDENT = /([A-Za-z_][A-Za-z_0-9]*)?/; | ||
const LITERALS = [ | ||
'true', | ||
'false', | ||
'in' | ||
]; | ||
const PARAMS = { | ||
scope: 'params', | ||
begin: /\(/, | ||
end: /\)(?=\:?)/, | ||
endsParent: true, | ||
relevance: 7, | ||
contains: [ | ||
{ | ||
scope: 'string', | ||
begin: '"', | ||
end: '"' | ||
}, | ||
{ | ||
scope: 'keyword', | ||
match: LITERALS.join("|"), | ||
}, | ||
{ | ||
scope: 'variable', | ||
match: /[A-Za-z_][A-Za-z_0-9]*/ | ||
}, | ||
{ | ||
scope: 'operator', | ||
match: /\+|\-|\*|\/|\%|\=\=|\=|\!|\>|\<|\&\&|\|\|/ | ||
} | ||
] | ||
}; | ||
const INSIDE_DISPATCH = { | ||
match: [ | ||
IDENT, | ||
/(?=\()/, | ||
], | ||
scope: { | ||
1: "keyword" | ||
}, | ||
contains: [ PARAMS ] | ||
}; | ||
PARAMS.contains.unshift(INSIDE_DISPATCH); | ||
return { | ||
name: 'Leaf', | ||
contains: [ | ||
// #ident(): | ||
{ | ||
className: 'function', | ||
begin: '#+' + '[A-Za-z_0-9]*' + '\\(', | ||
end: / \{/, | ||
returnBegin: true, | ||
excludeEnd: true, | ||
match: [ | ||
/#+/, | ||
IDENT, | ||
/(?=\()/, | ||
], | ||
scope: { | ||
1: "punctuation", | ||
2: "keyword" | ||
}, | ||
// will start up after the ending `)` match from line ~44 | ||
// just to grab the trailing `:` if we can match it | ||
starts: { | ||
contains: [ | ||
{ | ||
match: /\:/, | ||
scope: "punctuation" | ||
} | ||
] | ||
}, | ||
contains: [ | ||
{ | ||
className: 'keyword', | ||
begin: '#+' | ||
}, | ||
{ | ||
className: 'title', | ||
begin: '[A-Za-z_][A-Za-z_0-9]*' | ||
}, | ||
{ | ||
className: 'params', | ||
begin: '\\(', | ||
end: '\\)', | ||
endsParent: true, | ||
contains: [ | ||
{ | ||
className: 'string', | ||
begin: '"', | ||
end: '"' | ||
}, | ||
{ | ||
className: 'variable', | ||
begin: '[A-Za-z_][A-Za-z_0-9]*' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
PARAMS | ||
], | ||
}, | ||
// #ident or #ident: | ||
{ | ||
match: [ | ||
/#+/, | ||
IDENT, | ||
/:?/, | ||
], | ||
scope: { | ||
1: "punctuation", | ||
2: "keyword", | ||
3: "punctuation" | ||
} | ||
}, | ||
] | ||
@@ -46,0 +94,0 @@ }; |
@@ -41,3 +41,3 @@ const MODES = (hljs) => { | ||
className: "attr", | ||
begin: /--[A-Za-z][A-Za-z0-9_-]*/ | ||
begin: /--[A-Za-z_][A-Za-z0-9_-]*/ | ||
} | ||
@@ -614,2 +614,3 @@ }; | ||
/** @type LanguageFn */ | ||
@@ -616,0 +617,0 @@ function less(hljs) { |
@@ -155,2 +155,3 @@ const KEYWORDS = [ | ||
function livescript(hljs) { | ||
@@ -157,0 +158,0 @@ const LIVESCRIPT_BUILT_INS = [ |
@@ -8,2 +8,3 @@ /* | ||
function nsis(hljs) { | ||
@@ -116,2 +117,3 @@ const regex = hljs.regex; | ||
"appendfile", | ||
"assert", | ||
"cd", | ||
@@ -118,0 +120,0 @@ "define", |
@@ -9,297 +9,131 @@ /* | ||
function reasonml(hljs) { | ||
function orReValues(ops) { | ||
return ops | ||
.map(function(op) { | ||
return op | ||
.split('') | ||
.map(function(char) { | ||
return '\\' + char; | ||
}) | ||
.join(''); | ||
}) | ||
.join('|'); | ||
} | ||
const RE_IDENT = '~?[a-z$_][0-9a-zA-Z$_]*'; | ||
const RE_MODULE_IDENT = '`?[A-Z$_][0-9a-zA-Z$_]*'; | ||
const RE_PARAM_TYPEPARAM = '\'?[a-z$_][0-9a-z$_]*'; | ||
const RE_PARAM_TYPE = '\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*(' + RE_PARAM_TYPEPARAM + '\\s*(,' + RE_PARAM_TYPEPARAM + '\\s*)*)?\\))?'; | ||
const RE_PARAM = RE_IDENT + '(' + RE_PARAM_TYPE + '){0,2}'; | ||
const RE_OPERATOR = "(" + orReValues([ | ||
'||', | ||
'++', | ||
'**', | ||
'+.', | ||
'*', | ||
'/', | ||
'*.', | ||
'/.', | ||
'...' | ||
]) + "|\\|>|&&|==|===)"; | ||
const RE_OPERATOR_SPACED = "\\s+" + RE_OPERATOR + "\\s+"; | ||
const KEYWORDS = { | ||
keyword: | ||
'and as asr assert begin class constraint do done downto else end exception external ' | ||
+ 'for fun function functor if in include inherit initializer ' | ||
+ 'land lazy let lor lsl lsr lxor match method mod module mutable new nonrec ' | ||
+ 'object of open or private rec sig struct then to try type val virtual when while with', | ||
built_in: | ||
'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ', | ||
literal: | ||
'true false' | ||
}; | ||
const RE_NUMBER = '\\b(0[xX][a-fA-F0-9_]+[Lln]?|' | ||
+ '0[oO][0-7_]+[Lln]?|' | ||
+ '0[bB][01_]+[Lln]?|' | ||
+ '[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)'; | ||
const NUMBER_MODE = { | ||
className: 'number', | ||
relevance: 0, | ||
variants: [ | ||
{ begin: RE_NUMBER }, | ||
{ begin: '\\(-' + RE_NUMBER + '\\)' } | ||
] | ||
}; | ||
const OPERATOR_MODE = { | ||
className: 'operator', | ||
relevance: 0, | ||
begin: RE_OPERATOR | ||
}; | ||
const LIST_CONTENTS_MODES = [ | ||
{ | ||
className: 'identifier', | ||
relevance: 0, | ||
begin: RE_IDENT | ||
}, | ||
OPERATOR_MODE, | ||
NUMBER_MODE | ||
const BUILT_IN_TYPES = [ | ||
"array", | ||
"bool", | ||
"bytes", | ||
"char", | ||
"exn|5", | ||
"float", | ||
"int", | ||
"int32", | ||
"int64", | ||
"list", | ||
"lazy_t|5", | ||
"nativeint|5", | ||
"ref", | ||
"string", | ||
"unit", | ||
]; | ||
const MODULE_ACCESS_CONTENTS = [ | ||
hljs.QUOTE_STRING_MODE, | ||
OPERATOR_MODE, | ||
{ | ||
className: 'module', | ||
begin: "\\b" + RE_MODULE_IDENT, | ||
returnBegin: true, | ||
relevance: 0, | ||
end: "\.", | ||
contains: [ | ||
{ | ||
className: 'identifier', | ||
begin: RE_MODULE_IDENT, | ||
relevance: 0 | ||
} | ||
] | ||
} | ||
]; | ||
const PARAMS_CONTENTS = [ | ||
{ | ||
className: 'module', | ||
begin: "\\b" + RE_MODULE_IDENT, | ||
returnBegin: true, | ||
end: "\.", | ||
relevance: 0, | ||
contains: [ | ||
{ | ||
className: 'identifier', | ||
begin: RE_MODULE_IDENT, | ||
relevance: 0 | ||
} | ||
] | ||
} | ||
]; | ||
const PARAMS_MODE = { | ||
begin: RE_IDENT, | ||
end: '(,|\\n|\\))', | ||
relevance: 0, | ||
contains: [ | ||
OPERATOR_MODE, | ||
{ | ||
className: 'typing', | ||
begin: ':', | ||
end: '(,|\\n)', | ||
returnBegin: true, | ||
relevance: 0, | ||
contains: PARAMS_CONTENTS | ||
} | ||
] | ||
}; | ||
const FUNCTION_BLOCK_MODE = { | ||
className: 'function', | ||
relevance: 0, | ||
keywords: KEYWORDS, | ||
variants: [ | ||
{ | ||
begin: '\\s(\\(\\.?.*?\\)|' + RE_IDENT + ')\\s*=>', | ||
end: '\\s*=>', | ||
returnBegin: true, | ||
relevance: 0, | ||
contains: [ | ||
{ | ||
className: 'params', | ||
variants: [ | ||
{ begin: RE_IDENT }, | ||
{ begin: RE_PARAM }, | ||
{ begin: /\(\s*\)/ } | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
begin: '\\s\\(\\.?[^;\\|]*\\)\\s*=>', | ||
end: '\\s=>', | ||
returnBegin: true, | ||
relevance: 0, | ||
contains: [ | ||
{ | ||
className: 'params', | ||
relevance: 0, | ||
variants: [ PARAMS_MODE ] | ||
} | ||
] | ||
}, | ||
{ begin: '\\(\\.\\s' + RE_IDENT + '\\)\\s*=>' } | ||
] | ||
}; | ||
MODULE_ACCESS_CONTENTS.push(FUNCTION_BLOCK_MODE); | ||
const CONSTRUCTOR_MODE = { | ||
className: 'constructor', | ||
begin: RE_MODULE_IDENT + '\\(', | ||
end: '\\)', | ||
illegal: '\\n', | ||
keywords: KEYWORDS, | ||
contains: [ | ||
hljs.QUOTE_STRING_MODE, | ||
OPERATOR_MODE, | ||
{ | ||
className: 'params', | ||
begin: '\\b' + RE_IDENT | ||
} | ||
] | ||
}; | ||
const PATTERN_MATCH_BLOCK_MODE = { | ||
className: 'pattern-match', | ||
begin: '\\|', | ||
returnBegin: true, | ||
keywords: KEYWORDS, | ||
end: '=>', | ||
relevance: 0, | ||
contains: [ | ||
CONSTRUCTOR_MODE, | ||
OPERATOR_MODE, | ||
{ | ||
relevance: 0, | ||
className: 'constructor', | ||
begin: RE_MODULE_IDENT | ||
} | ||
] | ||
}; | ||
const MODULE_ACCESS_MODE = { | ||
className: 'module-access', | ||
keywords: KEYWORDS, | ||
returnBegin: true, | ||
variants: [ | ||
{ begin: "\\b(" + RE_MODULE_IDENT + "\\.)+" + RE_IDENT }, | ||
{ | ||
begin: "\\b(" + RE_MODULE_IDENT + "\\.)+\\(", | ||
end: "\\)", | ||
returnBegin: true, | ||
contains: [ | ||
FUNCTION_BLOCK_MODE, | ||
{ | ||
begin: '\\(', | ||
end: '\\)', | ||
relevance: 0, | ||
skip: true | ||
} | ||
].concat(MODULE_ACCESS_CONTENTS) | ||
}, | ||
{ | ||
begin: "\\b(" + RE_MODULE_IDENT + "\\.)+\\{", | ||
end: /\}/ | ||
} | ||
], | ||
contains: MODULE_ACCESS_CONTENTS | ||
}; | ||
PARAMS_CONTENTS.push(MODULE_ACCESS_MODE); | ||
return { | ||
name: 'ReasonML', | ||
aliases: [ 're' ], | ||
keywords: KEYWORDS, | ||
illegal: '(:-|:=|\\$\\{|\\+=)', | ||
keywords: { | ||
$pattern: /[a-z_]\w*!?/, | ||
keyword: [ | ||
"and", | ||
"as", | ||
"asr", | ||
"assert", | ||
"begin", | ||
"class", | ||
"constraint", | ||
"do", | ||
"done", | ||
"downto", | ||
"else", | ||
"end", | ||
"esfun", | ||
"exception", | ||
"external", | ||
"for", | ||
"fun", | ||
"function", | ||
"functor", | ||
"if", | ||
"in", | ||
"include", | ||
"inherit", | ||
"initializer", | ||
"land", | ||
"lazy", | ||
"let", | ||
"lor", | ||
"lsl", | ||
"lsr", | ||
"lxor", | ||
"mod", | ||
"module", | ||
"mutable", | ||
"new", | ||
"nonrec", | ||
"object", | ||
"of", | ||
"open", | ||
"or", | ||
"pri", | ||
"pub", | ||
"rec", | ||
"sig", | ||
"struct", | ||
"switch", | ||
"then", | ||
"to", | ||
"try", | ||
"type", | ||
"val", | ||
"virtual", | ||
"when", | ||
"while", | ||
"with", | ||
], | ||
built_in: BUILT_IN_TYPES, | ||
literal: ["true", "false"], | ||
}, | ||
illegal: /(:-|:=|\$\{|\+=)/, | ||
contains: [ | ||
hljs.COMMENT('/\\*', '\\*/', { illegal: '^(#,\\/\\/)' }), | ||
{ | ||
className: 'character', | ||
begin: '\'(\\\\[^\']+|[^\'])\'', | ||
illegal: '\\n', | ||
scope: 'literal', | ||
match: /\[(\|\|)?\]|\(\)/, | ||
relevance: 0 | ||
}, | ||
hljs.QUOTE_STRING_MODE, | ||
{ | ||
className: 'literal', | ||
begin: '\\(\\)', | ||
hljs.C_LINE_COMMENT_MODE, | ||
hljs.COMMENT(/\/\*/, /\*\//, { illegal: /^(#,\/\/)/ }), | ||
{ /* type variable */ | ||
scope: 'symbol', | ||
match: /\'[A-Za-z_](?!\')[\w\']*/ | ||
/* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */ | ||
}, | ||
{ /* polymorphic variant */ | ||
scope: 'type', | ||
match: /`[A-Z][\w\']*/ | ||
}, | ||
{ /* module or constructor */ | ||
scope: 'type', | ||
match: /\b[A-Z][\w\']*/, | ||
relevance: 0 | ||
}, | ||
{ | ||
className: 'literal', | ||
begin: '\\[\\|', | ||
end: '\\|\\]', | ||
relevance: 0, | ||
contains: LIST_CONTENTS_MODES | ||
{ /* don't color identifiers, but safely catch all identifiers with ' */ | ||
match: /[a-z_]\w*\'[\w\']*/, | ||
relevance: 0 | ||
}, | ||
{ | ||
className: 'literal', | ||
begin: '\\[', | ||
end: '\\]', | ||
relevance: 0, | ||
contains: LIST_CONTENTS_MODES | ||
}, | ||
CONSTRUCTOR_MODE, | ||
scope: 'operator', | ||
match: /\s+(\|\||\+[\+\.]?|\*[\*\/\.]?|\/[\.]?|\.\.\.|\|>|&&|===?)\s+/, | ||
relevance: 0 | ||
}, | ||
hljs.inherit(hljs.APOS_STRING_MODE, { | ||
scope: 'string', | ||
relevance: 0 | ||
}), | ||
hljs.inherit(hljs.QUOTE_STRING_MODE, { illegal: null }), | ||
{ | ||
className: 'operator', | ||
begin: RE_OPERATOR_SPACED, | ||
illegal: '-->', | ||
scope: 'number', | ||
variants: [ | ||
{ match: /\b0[xX][a-fA-F0-9_]+[Lln]?/ }, | ||
{ match: /\b0[oO][0-7_]+[Lln]?/ }, | ||
{ match: /\b0[bB][01_]+[Lln]?/ }, | ||
{ match: /\b[0-9][0-9_]*([Lln]|(\.[0-9_]*)?([eE][-+]?[0-9_]+)?)/ }, | ||
], | ||
relevance: 0 | ||
}, | ||
NUMBER_MODE, | ||
hljs.C_LINE_COMMENT_MODE, | ||
PATTERN_MATCH_BLOCK_MODE, | ||
FUNCTION_BLOCK_MODE, | ||
{ | ||
className: 'module-def', | ||
begin: "\\bmodule\\s+" + RE_IDENT + "\\s+" + RE_MODULE_IDENT + "\\s+=\\s+\\{", | ||
end: /\}/, | ||
returnBegin: true, | ||
keywords: KEYWORDS, | ||
relevance: 0, | ||
contains: [ | ||
{ | ||
className: 'module', | ||
relevance: 0, | ||
begin: RE_MODULE_IDENT | ||
}, | ||
{ | ||
begin: /\{/, | ||
end: /\}/, | ||
relevance: 0, | ||
skip: true | ||
} | ||
].concat(MODULE_ACCESS_CONTENTS) | ||
}, | ||
MODULE_ACCESS_MODE | ||
] | ||
@@ -306,0 +140,0 @@ }; |
@@ -17,3 +17,3 @@ /* | ||
/\b/, | ||
/(?!let\b)/, | ||
/(?!let|for|while|if|else|match\b)/, | ||
hljs.IDENT_RE, | ||
@@ -127,2 +127,3 @@ regex.lookahead(/\s*\(/)) | ||
"env!", | ||
"eprintln!", | ||
"panic!", | ||
@@ -129,0 +130,0 @@ "file!", |
@@ -91,3 +91,7 @@ /* | ||
relevance: 0, | ||
contains: [ TYPE ] | ||
contains: [ | ||
TYPE, | ||
hljs.C_LINE_COMMENT_MODE, | ||
hljs.C_BLOCK_COMMENT_MODE, | ||
] | ||
}, | ||
@@ -101,3 +105,7 @@ { | ||
relevance: 0, | ||
contains: [ TYPE ] | ||
contains: [ | ||
TYPE, | ||
hljs.C_LINE_COMMENT_MODE, | ||
hljs.C_BLOCK_COMMENT_MODE, | ||
] | ||
}, | ||
@@ -156,2 +164,30 @@ NAME | ||
// glob all non-whitespace characters as a "string" | ||
// sourced from https://github.com/scala/docs.scala-lang/pull/2845 | ||
const DIRECTIVE_VALUE = { | ||
className: 'string', | ||
begin: /\S+/, | ||
}; | ||
// directives | ||
// sourced from https://github.com/scala/docs.scala-lang/pull/2845 | ||
const USING_DIRECTIVE = { | ||
begin: [ | ||
'//>', | ||
/\s+/, | ||
/using/, | ||
/\s+/, | ||
/\S+/ | ||
], | ||
beginScope: { | ||
1: "comment", | ||
3: "keyword", | ||
5: "type" | ||
}, | ||
end: /$/, | ||
contains: [ | ||
DIRECTIVE_VALUE, | ||
] | ||
}; | ||
return { | ||
@@ -164,2 +200,3 @@ name: 'Scala', | ||
contains: [ | ||
USING_DIRECTIVE, | ||
hljs.C_LINE_COMMENT_MODE, | ||
@@ -166,0 +203,0 @@ hljs.C_BLOCK_COMMENT_MODE, |
@@ -41,3 +41,3 @@ const MODES = (hljs) => { | ||
className: "attr", | ||
begin: /--[A-Za-z][A-Za-z0-9_-]*/ | ||
begin: /--[A-Za-z_][A-Za-z0-9_-]*/ | ||
} | ||
@@ -611,2 +611,3 @@ }; | ||
/** @type LanguageFn */ | ||
@@ -613,0 +614,0 @@ function scss(hljs) { |
@@ -35,2 +35,3 @@ /* | ||
'array', | ||
'tuple', | ||
'complex', | ||
@@ -40,2 +41,3 @@ 'int', | ||
'vector', | ||
'complex_vector', | ||
'ordered', | ||
@@ -46,3 +48,5 @@ 'positive_ordered', | ||
'row_vector', | ||
'complex_row_vector', | ||
'matrix', | ||
'complex_matrix', | ||
'cholesky_factor_corr|10', | ||
@@ -64,4 +68,2 @@ 'cholesky_factor_cov|10', | ||
const FUNCTIONS = [ | ||
'Phi', | ||
'Phi_approx', | ||
'abs', | ||
@@ -84,3 +86,2 @@ 'acos', | ||
'binary_log_loss', | ||
'binomial_coefficient_log', | ||
'block', | ||
@@ -96,2 +97,5 @@ 'cbrt', | ||
'columns_dot_self', | ||
'complex_schur_decompose', | ||
'complex_schur_decompose_t', | ||
'complex_schur_decompose_u', | ||
'conj', | ||
@@ -102,2 +106,3 @@ 'cos', | ||
'crossprod', | ||
'csr_extract', | ||
'csr_extract_u', | ||
@@ -109,7 +114,9 @@ 'csr_extract_v', | ||
'cumulative_sum', | ||
'dae', | ||
'dae_tol', | ||
'determinant', | ||
'diag_matrix', | ||
'diagonal', | ||
'diag_post_multiply', | ||
'diag_pre_multiply', | ||
'diagonal', | ||
'digamma', | ||
@@ -120,3 +127,7 @@ 'dims', | ||
'dot_self', | ||
'eigendecompose', | ||
'eigendecompose_sym', | ||
'eigenvalues', | ||
'eigenvalues_sym', | ||
'eigenvectors', | ||
'eigenvectors_sym', | ||
@@ -128,5 +139,6 @@ 'erf', | ||
'expm1', | ||
'fabs', | ||
'falling_factorial', | ||
'fdim', | ||
'fft', | ||
'fft2', | ||
'floor', | ||
@@ -141,3 +153,2 @@ 'fma', | ||
'get_imag', | ||
'get_lp', | ||
'get_real', | ||
@@ -150,3 +161,2 @@ 'head', | ||
'inc_beta', | ||
'int_step', | ||
'integrate_1d', | ||
@@ -157,10 +167,15 @@ 'integrate_ode', | ||
'integrate_ode_rk45', | ||
'int_step', | ||
'inv', | ||
'inv_Phi', | ||
'inv_cloglog', | ||
'inv_erfc', | ||
'inverse', | ||
'inverse_spd', | ||
'inv_fft', | ||
'inv_fft2', | ||
'inv_inc_beta', | ||
'inv_logit', | ||
'inv_Phi', | ||
'inv_sqrt', | ||
'inv_square', | ||
'inverse', | ||
'inverse_spd', | ||
'is_inf', | ||
@@ -191,2 +206,3 @@ 'is_nan', | ||
'log_inv_logit_diff', | ||
'logit', | ||
'log_mix', | ||
@@ -197,3 +213,2 @@ 'log_modified_bessel_first_kind', | ||
'log_sum_exp', | ||
'logit', | ||
'machine_precision', | ||
@@ -213,6 +228,7 @@ 'map_rect', | ||
'modified_bessel_second_kind', | ||
'multiply_log', | ||
'multiply_lower_tri_self_transpose', | ||
'negative_infinity', | ||
'norm', | ||
'norm1', | ||
'norm2', | ||
'not_a_number', | ||
@@ -238,2 +254,4 @@ 'num_elements', | ||
'owens_t', | ||
'Phi', | ||
'Phi_approx', | ||
'polar', | ||
@@ -245,4 +263,6 @@ 'positive_infinity', | ||
'proj', | ||
'qr', | ||
'qr_Q', | ||
'qr_R', | ||
'qr_thin', | ||
'qr_thin_Q', | ||
@@ -287,2 +307,3 @@ 'qr_thin_R', | ||
'sum', | ||
'svd', | ||
'svd_U', | ||
@@ -300,2 +321,3 @@ 'svd_V', | ||
'to_complex', | ||
'to_int', | ||
'to_matrix', | ||
@@ -344,14 +366,18 @@ 'to_row_vector', | ||
'inv_wishart', | ||
'inv_wishart_cholesky', | ||
'lkj_corr', | ||
'lkj_corr_cholesky', | ||
'logistic', | ||
'loglogistic', | ||
'lognormal', | ||
'multi_gp', | ||
'multi_gp_cholesky', | ||
'multinomial', | ||
'multinomial_logit', | ||
'multi_normal', | ||
'multi_normal_cholesky', | ||
'multi_normal_prec', | ||
'multi_student_cholesky_t', | ||
'multi_student_t', | ||
'multinomial', | ||
'multinomial_logit', | ||
'multi_student_t_cholesky', | ||
'neg_binomial', | ||
@@ -376,2 +402,3 @@ 'neg_binomial_2', | ||
'std_normal', | ||
'std_normal_log', | ||
'student_t', | ||
@@ -382,3 +409,4 @@ 'uniform', | ||
'wiener', | ||
'wishart' | ||
'wishart', | ||
'wishart_cholesky' | ||
]; | ||
@@ -385,0 +413,0 @@ |
@@ -41,3 +41,3 @@ const MODES = (hljs) => { | ||
className: "attr", | ||
begin: /--[A-Za-z][A-Za-z0-9_-]*/ | ||
begin: /--[A-Za-z_][A-Za-z0-9_-]*/ | ||
} | ||
@@ -611,2 +611,3 @@ }; | ||
/** @type LanguageFn */ | ||
@@ -613,0 +614,0 @@ function stylus(hljs) { |
@@ -104,2 +104,3 @@ /** | ||
'as', // operator | ||
'borrowing', // contextual | ||
'break', | ||
@@ -109,4 +110,7 @@ 'case', | ||
'class', | ||
'consume', // contextual | ||
'consuming', // contextual | ||
'continue', | ||
'convenience', // contextual | ||
'copy', // contextual | ||
'default', | ||
@@ -119,2 +123,3 @@ 'defer', | ||
'dynamic', // contextual | ||
'each', | ||
'else', | ||
@@ -146,2 +151,3 @@ 'enum', | ||
'let', | ||
'macro', | ||
'mutating', // contextual | ||
@@ -231,3 +237,2 @@ 'nonmutating', // contextual | ||
'#sourceLocation', | ||
'#warn_unqualified_access', | ||
'#warning' | ||
@@ -346,3 +351,5 @@ ]; | ||
// @available is handled separately. | ||
// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes | ||
const keywordAttributes = [ | ||
'attached', | ||
'autoclosure', | ||
@@ -354,2 +361,3 @@ concat(/convention\(/, either('swift', 'block', 'c'), /\)/), | ||
'escaping', | ||
'freestanding', | ||
'frozen', | ||
@@ -374,6 +382,9 @@ 'GKInspectable', | ||
'resultBuilder', | ||
'Sendable', | ||
'testable', | ||
'UIApplicationMain', | ||
'unchecked', | ||
'unknown', | ||
'usableFromInline' | ||
'usableFromInline', | ||
'warn_unqualified_access' | ||
]; | ||
@@ -405,2 +416,3 @@ | ||
/** @type LanguageFn */ | ||
@@ -572,2 +584,46 @@ function swift(hljs) { | ||
const REGEXP_CONTENTS = [ | ||
hljs.BACKSLASH_ESCAPE, | ||
{ | ||
begin: /\[/, | ||
end: /\]/, | ||
relevance: 0, | ||
contains: [ hljs.BACKSLASH_ESCAPE ] | ||
} | ||
]; | ||
const BARE_REGEXP_LITERAL = { | ||
begin: /\/[^\s](?=[^/\n]*\/)/, | ||
end: /\//, | ||
contains: REGEXP_CONTENTS | ||
}; | ||
const EXTENDED_REGEXP_LITERAL = (rawDelimiter) => { | ||
const begin = concat(rawDelimiter, /\//); | ||
const end = concat(/\//, rawDelimiter); | ||
return { | ||
begin, | ||
end, | ||
contains: [ | ||
...REGEXP_CONTENTS, | ||
{ | ||
scope: "comment", | ||
begin: `#(?!.*${end})`, | ||
end: /$/, | ||
}, | ||
], | ||
}; | ||
}; | ||
// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/lexicalstructure/#Regular-Expression-Literals | ||
const REGEXP = { | ||
scope: "regexp", | ||
variants: [ | ||
EXTENDED_REGEXP_LITERAL('###'), | ||
EXTENDED_REGEXP_LITERAL('##'), | ||
EXTENDED_REGEXP_LITERAL('#'), | ||
BARE_REGEXP_LITERAL | ||
] | ||
}; | ||
// https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID412 | ||
@@ -592,3 +648,3 @@ const QUOTED_IDENTIFIER = { match: concat(/`/, identifier, /`/) }; | ||
match: /(@|#(un)?)available/, | ||
className: "keyword", | ||
scope: 'keyword', | ||
starts: { contains: [ | ||
@@ -608,7 +664,7 @@ { | ||
const KEYWORD_ATTRIBUTE = { | ||
className: 'keyword', | ||
scope: 'keyword', | ||
match: concat(/@/, either(...keywordAttributes)) | ||
}; | ||
const USER_DEFINED_ATTRIBUTE = { | ||
className: 'meta', | ||
scope: 'meta', | ||
match: concat(/@/, identifier) | ||
@@ -681,2 +737,3 @@ }; | ||
...COMMENTS, | ||
REGEXP, | ||
...KEYWORD_MODES, | ||
@@ -696,2 +753,3 @@ ...BUILT_INS, | ||
end: />/, | ||
keywords: 'repeat each', | ||
contains: [ | ||
@@ -739,5 +797,6 @@ ...COMMENTS, | ||
// https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID362 | ||
const FUNCTION = { | ||
// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/declarations/#Macro-Declaration | ||
const FUNCTION_OR_MACRO = { | ||
match: [ | ||
/func/, | ||
/(func|macro)/, | ||
/\s+/, | ||
@@ -839,3 +898,3 @@ either(QUOTED_IDENTIFIER.match, identifier, operator) | ||
...COMMENTS, | ||
FUNCTION, | ||
FUNCTION_OR_MACRO, | ||
INIT_SUBSCRIPT, | ||
@@ -863,2 +922,3 @@ { | ||
}, | ||
REGEXP, | ||
...KEYWORD_MODES, | ||
@@ -865,0 +925,0 @@ ...BUILT_INS, |
@@ -166,2 +166,3 @@ const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; | ||
/** @type LanguageFn */ | ||
@@ -775,2 +776,3 @@ function javascript(hljs) { | ||
/** @type LanguageFn */ | ||
@@ -777,0 +779,0 @@ function typescript(hljs) { |
@@ -345,3 +345,4 @@ /* | ||
'xpath', | ||
'xq' | ||
'xq', | ||
'xqm' | ||
], | ||
@@ -348,0 +349,0 @@ case_insensitive: false, |
@@ -9,3 +9,3 @@ { | ||
"homepage": "https://highlightjs.org/", | ||
"version": "11.8.0", | ||
"version": "11.9.0", | ||
"author": "Josh Goebel <hello@joshgoebel.com>", | ||
@@ -37,2 +37,4 @@ "contributors": [ | ||
"sideEffects": [ | ||
"./es/common.js", | ||
"./lib/common.js", | ||
"*.css", | ||
@@ -61,35 +63,35 @@ "*.scss" | ||
"devDependencies": { | ||
"@colors/colors": "^1.5.0", | ||
"@rollup/plugin-commonjs": "^24.1.0", | ||
"@rollup/plugin-json": "^6.0.0", | ||
"@rollup/plugin-node-resolve": "^15.0.2", | ||
"@types/mocha": "^10.0.1", | ||
"@typescript-eslint/eslint-plugin": "^5.59.1", | ||
"@typescript-eslint/parser": "^5.59.1", | ||
"@colors/colors": "^1.6.0", | ||
"@rollup/plugin-commonjs": "^25.0.5", | ||
"@rollup/plugin-json": "^6.0.1", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@types/mocha": "^10.0.2", | ||
"@typescript-eslint/eslint-plugin": "^6.7.4", | ||
"@typescript-eslint/parser": "^6.7.4", | ||
"clean-css": "^5.3.2", | ||
"cli-table": "^0.3.1", | ||
"commander": "^10.0.1", | ||
"commander": "^11.0.0", | ||
"css": "^3.0.0", | ||
"css-color-names": "^1.0.1", | ||
"deep-freeze-es6": "^2.0.0", | ||
"del": "^6.1.1", | ||
"deep-freeze-es6": "^3.0.2", | ||
"del": "^7.1.0", | ||
"dependency-resolver": "^2.0.1", | ||
"eslint": "^8.39.0", | ||
"eslint-config-standard": "^17.0.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint": "^8.51.0", | ||
"eslint-config-standard": "^17.1.0", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"glob": "^8.0.3", | ||
"glob-promise": "^6.0.2", | ||
"handlebars": "^4.7.6", | ||
"glob": "^8.1.0", | ||
"glob-promise": "^6.0.5", | ||
"handlebars": "^4.7.8", | ||
"http-server": "^14.1.1", | ||
"jsdom": "^21.1.1", | ||
"jsdom": "^22.1.0", | ||
"lodash": "^4.17.20", | ||
"mocha": "^10.2.0", | ||
"refa": "^0.4.1", | ||
"rollup": "^2.47.0", | ||
"rollup": "^4.0.2", | ||
"should": "^13.2.3", | ||
"terser": "^5.17.1", | ||
"terser": "^5.21.0", | ||
"tiny-worker": "^2.3.0", | ||
"typescript": "^5.0.4", | ||
"typescript": "^5.2.2", | ||
"wcag-contrast": "^3.0.0" | ||
@@ -99,5 +101,5 @@ }, | ||
".": { | ||
"types": "./types/index.d.ts", | ||
"require": "./lib/index.js", | ||
"import": "./es/index.js", | ||
"types": "./types/index.d.ts" | ||
"import": "./es/index.js" | ||
}, | ||
@@ -104,0 +106,0 @@ "./package.json": "./package.json", |
@@ -11,7 +11,5 @@ # Highlight.js | ||
[![ci status](https://badgen.net/github/checks/highlightjs/highlight.js/main?label=build)](https://github.com/highlightjs/highlight.js/actions/workflows/tests.js.yml) | ||
[![code quality](https://badgen.net/lgtm/grade/g/highlightjs/highlight.js/js?label=code+quality)](https://lgtm.com/projects/g/highlightjs/highlight.js/?mode=list) | ||
[![CodeQL](https://github.com/highlightjs/highlight.js/workflows/CodeQL/badge.svg)](https://github.com/highlightjs/highlight.js/actions/workflows/github-code-scanning/codeql) | ||
[![vulnerabilities](https://badgen.net/snyk/highlightjs/highlight.js)](https://snyk.io/test/github/highlightjs/highlight.js?targetFile=package.json) | ||
![dev deps](https://badgen.net/david/dev/highlightjs/highlight.js?label=dev+deps) | ||
[![discord](https://badgen.net/badge/icon/discord?icon=discord&label&color=pink)](https://discord.gg/M24EbU7ja9) | ||
@@ -89,3 +87,3 @@ [![open issues](https://badgen.net/github/open-issues/highlightjs/highlight.js?label=issues)](https://github.com/highlightjs/highlight.js/issues) | ||
to detect the language automatically. If automatic detection doesn’t | ||
work for you, or you simply prefer to be explicit, you can specify the language manually in the using the `class` attribute: | ||
work for you, or you simply prefer to be explicit, you can specify the language manually by using the `class` attribute: | ||
@@ -332,6 +330,6 @@ | ||
```html | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> | ||
<!-- and it's easy to individually load additional languages --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/go.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/go.min.js"></script> | ||
``` | ||
@@ -342,7 +340,7 @@ | ||
````html | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/dark.min.css"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/dark.min.css"> | ||
<script type="module"> | ||
import hljs from 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/es/highlight.min.js'; | ||
import hljs from 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/es/highlight.min.js'; | ||
// and it's easy to individually load additional languages | ||
import go from 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/es/languages/go.min.js'; | ||
import go from 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/es/languages/go.min.js'; | ||
hljs.registerLanguage('go', go); | ||
@@ -359,6 +357,6 @@ </script> | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/styles/default.min.css"> | ||
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/highlight.min.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/default.min.css"> | ||
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script> | ||
<!-- and it's easy to individually load additional languages --> | ||
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/languages/go.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/languages/go.min.js"></script> | ||
``` | ||
@@ -369,7 +367,7 @@ | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/styles/default.min.css"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/default.min.css"> | ||
<script type="module"> | ||
import hljs from 'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/es/highlight.min.js'; | ||
import hljs from 'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/es/highlight.min.js'; | ||
// and it's easy to individually load additional languages | ||
import go from 'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/es/languages/go.min.js'; | ||
import go from 'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/es/languages/go.min.js'; | ||
hljs.registerLanguage('go', go); | ||
@@ -384,6 +382,6 @@ </script> | ||
```html | ||
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.8.0/styles/default.min.css"> | ||
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.8.0/highlight.min.js"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/default.min.css"> | ||
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script> | ||
<!-- and it's easy to individually load additional languages --> | ||
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.8.0/languages/go.min.js"></script> | ||
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/languages/go.min.js"></script> | ||
``` | ||
@@ -394,7 +392,7 @@ | ||
```html | ||
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.8.0/styles/default.min.css"> | ||
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/default.min.css"> | ||
<script type="module"> | ||
import hljs from 'https://unpkg.com/@highlightjs/cdn-assets@11.8.0/es/highlight.min.js'; | ||
import hljs from 'https://unpkg.com/@highlightjs/cdn-assets@11.9.0/es/highlight.min.js'; | ||
// and it's easy to individually load & register additional languages | ||
import go from 'https://unpkg.com/@highlightjs/cdn-assets@11.8.0/es/languages/go.min.js'; | ||
import go from 'https://unpkg.com/@highlightjs/cdn-assets@11.9.0/es/languages/go.min.js'; | ||
hljs.registerLanguage('go', go); | ||
@@ -401,0 +399,0 @@ </script> |
@@ -32,2 +32,3 @@ # Supported Languages | ||
| Awk | awk, mawk, nawk, gawk | | | ||
| Ballerina | ballerina, bal | [highlightjs-ballerina](https://github.com/highlightjs/highlightjs-ballerina) | | ||
| Bash | bash, sh, zsh | | | ||
@@ -112,2 +113,3 @@ | Basic | basic | | | ||
| IRPF90 | irpf90 | | | ||
| Iptables | iptables | [highlightjs-iptables](https://github.com/highlightjs/highlightjs-iptables) | | ||
| JSON | json | | | ||
@@ -191,2 +193,3 @@ | Java | java, jsp | | | ||
| RiScript | risc, riscript | [highlightjs-riscript](https://github.com/highlightjs/highlightjs-riscript) | | ||
| RISC-V Assembly | riscv, riscvasm | [highlightjs-riscvasm](https://github.com/highlightjs/highlightjs-riscvasm) | | ||
| Roboconf | graph, instances | | | ||
@@ -241,4 +244,5 @@ | Robot Framework | robot, rf | [highlightjs-robot](https://github.com/highlightjs/highlightjs-robot) | | ||
| x86 Assembly | x86asm | | | ||
| x86 Assembly (AT&T) | x86asmatt | [highlightjs-x86asmatt](https://github.com/gondow/highlightjs-x86asmatt) | | ||
| XL | xl, tao | | | ||
| XQuery | xquery, xpath, xq | | | ||
| XQuery | xquery, xpath, xq, xqm | | | ||
| YAML | yml, yaml | | | ||
@@ -245,0 +249,0 @@ | ZenScript | zenscript, zs |[highlightjs-zenscript](https://github.com/highlightjs/highlightjs-zenscript) | |
@@ -172,3 +172,3 @@ /* eslint-disable no-unused-vars */ | ||
case_insensitive?: boolean | ||
keywords?: Record<string, any> | string | ||
keywords?: string | string[] | Record<string, string | string[]> | ||
isCompiled?: boolean, | ||
@@ -184,10 +184,8 @@ exports?: any, | ||
export interface Emitter { | ||
addKeyword(text: string, kind: string): void | ||
startScope(name: string): void | ||
endScope(): void | ||
addText(text: string): void | ||
toHTML(): string | ||
finalize(): void | ||
closeAllNodes(): void | ||
openNode(kind: string): void | ||
closeNode(): void | ||
addSublanguage(emitter: Emitter, subLanguageName: string): void | ||
__addSublanguage(emitter: Emitter, subLanguageName: string): void | ||
} | ||
@@ -255,3 +253,3 @@ | ||
lexemes?: string | RegExp | ||
keywords?: Record<string, any> | string | ||
keywords?: string | string[] | Record<string, string | string[]> | ||
beginKeywords?: string | ||
@@ -278,3 +276,1 @@ relevance?: number | ||
} | ||
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5287767
1535
149779
469