From 2aa387dccf8ae20ede43ca98f6db6df3acbf20e4 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 2 Aug 2021 04:50:18 +0200 Subject: [PATCH 001/227] (docs) Added 3rd party MKB Support (#3297) --- CHANGES.md | 3 ++- SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index f96676fa3b..b5ef1add32 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,11 +15,12 @@ Grammars: New Languages: - Added 3rd party X# grammar to SUPPORTED_LANGUAGES [Patrick Kruselburger][] +- Added 3rd party MKB grammar to SUPPORTED_LANGUAGES (#3297) [Dereavy][] [Josh Goebel]: https://github.com/joshgoebel [Patrick Kruselburger]: https://github.com/PatrickKru [Bradley Mackey]: https://github.com/bradleymackey - +[Dereavy]: https://github.com/dereavy ## Version 11.1.0 diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index c4fca1e05e..876cba772a 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -121,6 +121,7 @@ The table below shows the full list of languages (and corresponding classes/alia | Mercury | mercury | | | mIRC Scripting Language | mirc, mrc | [highlightjs-mirc](https://github.com/highlightjs/highlightjs-mirc) | | Mizar | mizar | | +| MKB | mkb | [highlightjs-mkb](https://github.com/Dereavy/highlightjs-mkb) | | Mojolicious | mojolicious | | | Monkey | monkey | | | Moonscript | moonscript, moon | | From 67525ee4c008f833c0e9edc863fce4fd38c80303 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 17 Aug 2021 23:59:07 -0400 Subject: [PATCH 002/227] fix(verilog) Fix directive handling (#3287) * fix(verilog) Fix directive handling * enh(verilog) tighten keyword regex * enh(verilog) __FILE__ and __LINE__ constants * fix(verilog) Fix binary number false positives on __ * (chore) modernize verilog grammar a bit Co-authored-by: Vladimir Jimenez --- CHANGES.md | 5 + src/languages/verilog.js | 581 +++++++++++++++++++--- test/markup/verilog/directives.expect.txt | 2 + test/markup/verilog/directives.txt | 2 + 4 files changed, 512 insertions(+), 78 deletions(-) create mode 100644 test/markup/verilog/directives.expect.txt create mode 100644 test/markup/verilog/directives.txt diff --git a/CHANGES.md b/CHANGES.md index b5ef1add32..4fadeff441 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,11 @@ Build: Parser: - fix(types) Fix some type definition issues (#3274) [Josh Goebel][] +- fix(verilog) Fix directive handling (#3283) [Josh Goebel][] +- fix(verilog) Fix binary number false positives on `_` (#3283) [Josh Goebel][] +- enh(verilog) `__FILE__` and __`LINE__` constants (#3283) [Josh Goebel][] +- enh(verilog) tighten keyword regex (#3283) [Josh Goebel][] + Grammars: diff --git a/src/languages/verilog.js b/src/languages/verilog.js index 9333f5a4df..8d91bf1614 100644 --- a/src/languages/verilog.js +++ b/src/languages/verilog.js @@ -6,67 +6,495 @@ Description: Verilog is a hardware description language used in electronic desig Website: http://www.verilog.com */ +import * as regex from '../lib/regex.js'; + export default function(hljs) { - const SV_KEYWORDS = { - $pattern: /[\w\$]+/, - keyword: - 'accept_on alias always always_comb always_ff always_latch and assert assign ' + - 'assume automatic before begin bind bins binsof bit break buf|0 bufif0 bufif1 ' + - 'byte case casex casez cell chandle checker class clocking cmos config const ' + - 'constraint context continue cover covergroup coverpoint cross deassign default ' + - 'defparam design disable dist do edge else end endcase endchecker endclass ' + - 'endclocking endconfig endfunction endgenerate endgroup endinterface endmodule ' + - 'endpackage endprimitive endprogram endproperty endspecify endsequence endtable ' + - 'endtask enum event eventually expect export extends extern final first_match for ' + - 'force foreach forever fork forkjoin function generate|5 genvar global highz0 highz1 ' + - 'if iff ifnone ignore_bins illegal_bins implements implies import incdir include ' + - 'initial inout input inside instance int integer interconnect interface intersect ' + - 'join join_any join_none large let liblist library local localparam logic longint ' + - 'macromodule matches medium modport module nand negedge nettype new nexttime nmos ' + - 'nor noshowcancelled not notif0 notif1 or output package packed parameter pmos ' + - 'posedge primitive priority program property protected pull0 pull1 pulldown pullup ' + - 'pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos ' + - 'real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran ' + - 'rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared ' + - 'sequence shortint shortreal showcancelled signed small soft solve specify specparam ' + - 'static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on ' + - 'sync_reject_on table tagged task this throughout time timeprecision timeunit tran ' + - 'tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 ' + - 'unsigned until until_with untyped use uwire var vectored virtual void wait wait_order ' + - 'wand weak weak0 weak1 while wildcard wire with within wor xnor xor', - literal: - 'null', - built_in: - '$finish $stop $exit $fatal $error $warning $info $realtime $time $printtimescale ' + - '$bitstoreal $bitstoshortreal $itor $signed $cast $bits $stime $timeformat ' + - '$realtobits $shortrealtobits $rtoi $unsigned $asserton $assertkill $assertpasson ' + - '$assertfailon $assertnonvacuouson $assertoff $assertcontrol $assertpassoff ' + - '$assertfailoff $assertvacuousoff $isunbounded $sampled $fell $changed $past_gclk ' + - '$fell_gclk $changed_gclk $rising_gclk $steady_gclk $coverage_control ' + - '$coverage_get $coverage_save $set_coverage_db_name $rose $stable $past ' + - '$rose_gclk $stable_gclk $future_gclk $falling_gclk $changing_gclk $display ' + - '$coverage_get_max $coverage_merge $get_coverage $load_coverage_db $typename ' + - '$unpacked_dimensions $left $low $increment $clog2 $ln $log10 $exp $sqrt $pow ' + - '$floor $ceil $sin $cos $tan $countbits $onehot $isunknown $fatal $warning ' + - '$dimensions $right $high $size $asin $acos $atan $atan2 $hypot $sinh $cosh ' + - '$tanh $asinh $acosh $atanh $countones $onehot0 $error $info $random ' + - '$dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson ' + - '$dist_t $dist_uniform $q_initialize $q_remove $q_exam $async$and$array ' + - '$async$nand$array $async$or$array $async$nor$array $sync$and$array ' + - '$sync$nand$array $sync$or$array $sync$nor$array $q_add $q_full $psprintf ' + - '$async$and$plane $async$nand$plane $async$or$plane $async$nor$plane ' + - '$sync$and$plane $sync$nand$plane $sync$or$plane $sync$nor$plane $system ' + - '$display $displayb $displayh $displayo $strobe $strobeb $strobeh $strobeo ' + - '$write $readmemb $readmemh $writememh $value$plusargs ' + - '$dumpvars $dumpon $dumplimit $dumpports $dumpportson $dumpportslimit ' + - '$writeb $writeh $writeo $monitor $monitorb $monitorh $monitoro $writememb ' + - '$dumpfile $dumpoff $dumpall $dumpflush $dumpportsoff $dumpportsall ' + - '$dumpportsflush $fclose $fdisplay $fdisplayb $fdisplayh $fdisplayo ' + - '$fstrobe $fstrobeb $fstrobeh $fstrobeo $swrite $swriteb $swriteh ' + - '$swriteo $fscanf $fread $fseek $fflush $feof $fopen $fwrite $fwriteb ' + - '$fwriteh $fwriteo $fmonitor $fmonitorb $fmonitorh $fmonitoro $sformat ' + - '$sformatf $fgetc $ungetc $fgets $sscanf $rewind $ftell $ferror' + const KEYWORDS = { + $pattern: /\$?[\w]+(\$[\w]+)*/, + keyword: [ + "accept_on", + "alias", + "always", + "always_comb", + "always_ff", + "always_latch", + "and", + "assert", + "assign", + "assume", + "automatic", + "before", + "begin", + "bind", + "bins", + "binsof", + "bit", + "break", + "buf|0", + "bufif0", + "bufif1", + "byte", + "case", + "casex", + "casez", + "cell", + "chandle", + "checker", + "class", + "clocking", + "cmos", + "config", + "const", + "constraint", + "context", + "continue", + "cover", + "covergroup", + "coverpoint", + "cross", + "deassign", + "default", + "defparam", + "design", + "disable", + "dist", + "do", + "edge", + "else", + "end", + "endcase", + "endchecker", + "endclass", + "endclocking", + "endconfig", + "endfunction", + "endgenerate", + "endgroup", + "endinterface", + "endmodule", + "endpackage", + "endprimitive", + "endprogram", + "endproperty", + "endspecify", + "endsequence", + "endtable", + "endtask", + "enum", + "event", + "eventually", + "expect", + "export", + "extends", + "extern", + "final", + "first_match", + "for", + "force", + "foreach", + "forever", + "fork", + "forkjoin", + "function", + "generate|5", + "genvar", + "global", + "highz0", + "highz1", + "if", + "iff", + "ifnone", + "ignore_bins", + "illegal_bins", + "implements", + "implies", + "import", + "incdir", + "include", + "initial", + "inout", + "input", + "inside", + "instance", + "int", + "integer", + "interconnect", + "interface", + "intersect", + "join", + "join_any", + "join_none", + "large", + "let", + "liblist", + "library", + "local", + "localparam", + "logic", + "longint", + "macromodule", + "matches", + "medium", + "modport", + "module", + "nand", + "negedge", + "nettype", + "new", + "nexttime", + "nmos", + "nor", + "noshowcancelled", + "not", + "notif0", + "notif1", + "or", + "output", + "package", + "packed", + "parameter", + "pmos", + "posedge", + "primitive", + "priority", + "program", + "property", + "protected", + "pull0", + "pull1", + "pulldown", + "pullup", + "pulsestyle_ondetect", + "pulsestyle_onevent", + "pure", + "rand", + "randc", + "randcase", + "randsequence", + "rcmos", + "real", + "realtime", + "ref", + "reg", + "reject_on", + "release", + "repeat", + "restrict", + "return", + "rnmos", + "rpmos", + "rtran", + "rtranif0", + "rtranif1", + "s_always", + "s_eventually", + "s_nexttime", + "s_until", + "s_until_with", + "scalared", + "sequence", + "shortint", + "shortreal", + "showcancelled", + "signed", + "small", + "soft", + "solve", + "specify", + "specparam", + "static", + "string", + "strong", + "strong0", + "strong1", + "struct", + "super", + "supply0", + "supply1", + "sync_accept_on", + "sync_reject_on", + "table", + "tagged", + "task", + "this", + "throughout", + "time", + "timeprecision", + "timeunit", + "tran", + "tranif0", + "tranif1", + "tri", + "tri0", + "tri1", + "triand", + "trior", + "trireg", + "type", + "typedef", + "union", + "unique", + "unique0", + "unsigned", + "until", + "until_with", + "untyped", + "use", + "uwire", + "var", + "vectored", + "virtual", + "void", + "wait", + "wait_order", + "wand", + "weak", + "weak0", + "weak1", + "while", + "wildcard", + "wire", + "with", + "within", + "wor", + "xnor", + "xor" + ], + literal: [ 'null' ], + built_in: [ + "$finish", + "$stop", + "$exit", + "$fatal", + "$error", + "$warning", + "$info", + "$realtime", + "$time", + "$printtimescale", + "$bitstoreal", + "$bitstoshortreal", + "$itor", + "$signed", + "$cast", + "$bits", + "$stime", + "$timeformat", + "$realtobits", + "$shortrealtobits", + "$rtoi", + "$unsigned", + "$asserton", + "$assertkill", + "$assertpasson", + "$assertfailon", + "$assertnonvacuouson", + "$assertoff", + "$assertcontrol", + "$assertpassoff", + "$assertfailoff", + "$assertvacuousoff", + "$isunbounded", + "$sampled", + "$fell", + "$changed", + "$past_gclk", + "$fell_gclk", + "$changed_gclk", + "$rising_gclk", + "$steady_gclk", + "$coverage_control", + "$coverage_get", + "$coverage_save", + "$set_coverage_db_name", + "$rose", + "$stable", + "$past", + "$rose_gclk", + "$stable_gclk", + "$future_gclk", + "$falling_gclk", + "$changing_gclk", + "$display", + "$coverage_get_max", + "$coverage_merge", + "$get_coverage", + "$load_coverage_db", + "$typename", + "$unpacked_dimensions", + "$left", + "$low", + "$increment", + "$clog2", + "$ln", + "$log10", + "$exp", + "$sqrt", + "$pow", + "$floor", + "$ceil", + "$sin", + "$cos", + "$tan", + "$countbits", + "$onehot", + "$isunknown", + "$fatal", + "$warning", + "$dimensions", + "$right", + "$high", + "$size", + "$asin", + "$acos", + "$atan", + "$atan2", + "$hypot", + "$sinh", + "$cosh", + "$tanh", + "$asinh", + "$acosh", + "$atanh", + "$countones", + "$onehot0", + "$error", + "$info", + "$random", + "$dist_chi_square", + "$dist_erlang", + "$dist_exponential", + "$dist_normal", + "$dist_poisson", + "$dist_t", + "$dist_uniform", + "$q_initialize", + "$q_remove", + "$q_exam", + "$async$and$array", + "$async$nand$array", + "$async$or$array", + "$async$nor$array", + "$sync$and$array", + "$sync$nand$array", + "$sync$or$array", + "$sync$nor$array", + "$q_add", + "$q_full", + "$psprintf", + "$async$and$plane", + "$async$nand$plane", + "$async$or$plane", + "$async$nor$plane", + "$sync$and$plane", + "$sync$nand$plane", + "$sync$or$plane", + "$sync$nor$plane", + "$system", + "$display", + "$displayb", + "$displayh", + "$displayo", + "$strobe", + "$strobeb", + "$strobeh", + "$strobeo", + "$write", + "$readmemb", + "$readmemh", + "$writememh", + "$value$plusargs", + "$dumpvars", + "$dumpon", + "$dumplimit", + "$dumpports", + "$dumpportson", + "$dumpportslimit", + "$writeb", + "$writeh", + "$writeo", + "$monitor", + "$monitorb", + "$monitorh", + "$monitoro", + "$writememb", + "$dumpfile", + "$dumpoff", + "$dumpall", + "$dumpflush", + "$dumpportsoff", + "$dumpportsall", + "$dumpportsflush", + "$fclose", + "$fdisplay", + "$fdisplayb", + "$fdisplayh", + "$fdisplayo", + "$fstrobe", + "$fstrobeb", + "$fstrobeh", + "$fstrobeo", + "$swrite", + "$swriteb", + "$swriteh", + "$swriteo", + "$fscanf", + "$fread", + "$fseek", + "$fflush", + "$feof", + "$fopen", + "$fwrite", + "$fwriteb", + "$fwriteh", + "$fwriteo", + "$fmonitor", + "$fmonitorb", + "$fmonitorh", + "$fmonitoro", + "$sformat", + "$sformatf", + "$fgetc", + "$ungetc", + "$fgets", + "$sscanf", + "$rewind", + "$ftell", + "$ferror" + ] }; + const BUILT_IN_CONSTANTS = [ + "__FILE__", + "__LINE__" + ]; + const DIRECTIVES = [ + "begin_keywords", + "celldefine", + "default_nettype", + "default_decay_time", + "default_trireg_strength", + "define", + "delay_mode_distributed", + "delay_mode_path", + "delay_mode_unit", + "delay_mode_zero", + "else", + "elsif", + "end_keywords", + "endcelldefine", + "endif", + "ifdef", + "ifndef", + "include", + "line", + "nounconnected_drive", + "pragma", + "resetall", + "timescale", + "unconnected_drive", + "undef", + "undefineall" + ]; return { name: 'Verilog', @@ -76,30 +504,30 @@ export default function(hljs) { 'svh' ], case_insensitive: false, - keywords: SV_KEYWORDS, + keywords: KEYWORDS, contains: [ hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE, hljs.QUOTE_STRING_MODE, { - className: 'number', + scope: 'number', contains: [ hljs.BACKSLASH_ESCAPE ], variants: [ { - begin: '\\b((\\d+\'(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)' + begin: /\b((\d+'([bhodBHOD]))[0-9xzXZa-fA-F_]+)/ }, { - begin: '\\B((\'(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)' + begin: /\B(('([bhodBHOD]))[0-9xzXZa-fA-F_]+)/ }, - { - begin: '\\b([0-9_])+', + { // decimal + begin: /\b[0-9][0-9_]*/, relevance: 0 } ] }, /* parameters to instances */ { - className: 'variable', + scope: 'variable', variants: [ { begin: '#\\((?!parameter).+\\)' @@ -111,18 +539,15 @@ export default function(hljs) { ] }, { - className: 'meta', - begin: '`', - end: '$', - keywords: { - keyword: - 'define __FILE__ ' + - '__LINE__ begin_keywords celldefine default_nettype define ' + - 'else elsif end_keywords endcelldefine endif ifdef ifndef ' + - 'include line nounconnected_drive pragma resetall timescale ' + - 'unconnected_drive undef undefineall' - }, - relevance: 0 + scope: 'variable.constant', + match: regex.concat(/`/, regex.either(...BUILT_IN_CONSTANTS)), + }, + { + scope: 'meta', + begin: regex.concat(/`/, regex.either(...DIRECTIVES)), + end: /$|\/\/|\/\*/, + returnEnd: true, + keywords: DIRECTIVES } ] }; diff --git a/test/markup/verilog/directives.expect.txt b/test/markup/verilog/directives.expect.txt new file mode 100644 index 0000000000..c4e6b8fa70 --- /dev/null +++ b/test/markup/verilog/directives.expect.txt @@ -0,0 +1,2 @@ +`define CONSTANT value // this is a comment +wire result = `CONSTANT + variable; // comment diff --git a/test/markup/verilog/directives.txt b/test/markup/verilog/directives.txt new file mode 100644 index 0000000000..90b815672b --- /dev/null +++ b/test/markup/verilog/directives.txt @@ -0,0 +1,2 @@ +`define CONSTANT value // this is a comment +wire result = `CONSTANT + variable; // comment From 0756ba981d2fdb0c06140c96b431e0e9dd4f10b1 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 18 Aug 2021 04:45:06 -0400 Subject: [PATCH 003/227] fix(css-like) Now always detect block comments (#3301) * (enh) CSS consistency for function dispatch * enh(css-like) detect block comments better * changelog * fix(css consistency) consistently highlight % keyframe as a number --- CHANGES.md | 8 ++++++++ src/languages/css.js | 9 +++------ src/languages/less.js | 6 ++++-- src/languages/lib/css-shared.js | 5 +++++ src/languages/scss.js | 7 ++++++- src/languages/stylus.js | 3 ++- test/markup/css/css_consistency.expect.txt | 5 +++++ test/markup/css/css_consistency.txt | 5 +++++ test/markup/less/css_consistency.expect.txt | 11 +++++++++++ test/markup/less/css_consistency.txt | 11 +++++++++++ test/markup/scss/css_consistency.expect.txt | 11 +++++++++++ test/markup/scss/css_consistency.txt | 11 +++++++++++ test/markup/stylus/css_consistency.expect.txt | 11 +++++++++++ test/markup/stylus/css_consistency.txt | 11 +++++++++++ test/markup/stylus/default.expect.txt | 6 +++--- 15 files changed, 107 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4fadeff441..cdb479d899 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,11 @@ +## Version 11.3.0 (most likely) + +enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][] +enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][] + +[Josh Goebel]: https://github.com/joshgoebel + + ## Version 11.2.0 Build: diff --git a/src/languages/css.js b/src/languages/css.js index cd74457086..c40d2cab6c 100644 --- a/src/languages/css.js +++ b/src/languages/css.js @@ -11,10 +11,6 @@ import * as regex from '../lib/regex.js'; /** @type LanguageFn */ export default function(hljs) { const modes = css.MODES(hljs); - const FUNCTION_DISPATCH = { - className: "built_in", - begin: /[\w-]+(?=\()/ - }; const VENDOR_PREFIX = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }; @@ -39,7 +35,7 @@ export default function(hljs) { keyframePosition: "selector-tag" }, contains: [ - hljs.C_BLOCK_COMMENT_MODE, + modes.BLOCK_COMMENT, VENDOR_PREFIX, // to recognize keyframe 40% etc which are outside the scope of our // attribute value mode @@ -82,6 +78,7 @@ export default function(hljs) { begin: ':', end: '[;}]', contains: [ + modes.BLOCK_COMMENT, modes.HEXCOLOR, modes.IMPORTANT, modes.CSS_NUMBER_MODE, @@ -107,7 +104,7 @@ export default function(hljs) { } ] }, - FUNCTION_DISPATCH + modes.FUNCTION_DISPATCH ] }, { diff --git a/src/languages/less.js b/src/languages/less.js index c98492ee16..08001098fc 100644 --- a/src/languages/less.js +++ b/src/languages/less.js @@ -187,7 +187,8 @@ export default function(hljs) { begin: '\\b(' + css.TAGS.join('|') + ')\\b', className: 'selector-tag' }, - IDENT_MODE('selector-tag', INTERP_IDENT_RE + '%?', 0), // '%' for more consistent coloring of @keyframes "tags" + modes.CSS_NUMBER_MODE, + IDENT_MODE('selector-tag', INTERP_IDENT_RE, 0), IDENT_MODE('selector-id', '#' + INTERP_IDENT_RE), IDENT_MODE('selector-class', '\\.' + INTERP_IDENT_RE, 0), IDENT_MODE('selector-tag', '&', 0), @@ -208,7 +209,8 @@ export default function(hljs) { }, // argument list of parametric mixins { begin: '!important' - } // eat !important after mixin call or it will be colored as tag + }, // eat !important after mixin call or it will be colored as tag + modes.FUNCTION_DISPATCH ] }; diff --git a/src/languages/lib/css-shared.js b/src/languages/lib/css-shared.js index 9145033f8d..e14825d8e9 100644 --- a/src/languages/lib/css-shared.js +++ b/src/languages/lib/css-shared.js @@ -4,10 +4,15 @@ export const MODES = (hljs) => { scope: 'meta', begin: '!important' }, + BLOCK_COMMENT: hljs.C_BLOCK_COMMENT_MODE, HEXCOLOR: { scope: 'number', begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})' }, + FUNCTION_DISPATCH: { + className: "built_in", + begin: /[\w-]+(?=\()/ + }, ATTRIBUTE_SELECTOR_MODE: { scope: 'selector-attr', begin: /\[/, diff --git a/src/languages/scss.js b/src/languages/scss.js index 244e8505c3..9fe75c1a26 100644 --- a/src/languages/scss.js +++ b/src/languages/scss.js @@ -29,6 +29,9 @@ export default function(hljs) { contains: [ hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, + // to recognize keyframe 40% etc which are outside the scope of our + // attribute value mode + modes.CSS_NUMBER_MODE, { className: 'selector-id', begin: '#[A-Za-z0-9_-]+', @@ -72,6 +75,7 @@ export default function(hljs) { begin: ':', end: ';', contains: [ + modes.BLOCK_COMMENT, VARIABLE, modes.HEXCOLOR, modes.CSS_NUMBER_MODE, @@ -114,7 +118,8 @@ export default function(hljs) { modes.HEXCOLOR, modes.CSS_NUMBER_MODE ] - } + }, + modes.FUNCTION_DISPATCH ] }; } diff --git a/src/languages/stylus.js b/src/languages/stylus.js index d329dc41e1..6d5d4e5985 100644 --- a/src/languages/stylus.js +++ b/src/languages/stylus.js @@ -178,7 +178,8 @@ export default function(hljs) { illegal: /\./, relevance: 0 } - } + }, + modes.FUNCTION_DISPATCH ] }; } diff --git a/test/markup/css/css_consistency.expect.txt b/test/markup/css/css_consistency.expect.txt index 31ee17b143..784eda969c 100644 --- a/test/markup/css/css_consistency.expect.txt +++ b/test/markup/css/css_consistency.expect.txt @@ -68,3 +68,8 @@ --color: red; color: var(--color); } + +main { + /* normal comment */ + width: /* inline comment */ 50px; +} diff --git a/test/markup/css/css_consistency.txt b/test/markup/css/css_consistency.txt index 1dc3879b73..1f2354ba28 100644 --- a/test/markup/css/css_consistency.txt +++ b/test/markup/css/css_consistency.txt @@ -68,3 +68,8 @@ main { --color: red; color: var(--color); } + +main { + /* normal comment */ + width: /* inline comment */ 50px; +} diff --git a/test/markup/less/css_consistency.expect.txt b/test/markup/less/css_consistency.expect.txt index e60d0c8dfb..5df3c49ffc 100644 --- a/test/markup/less/css_consistency.expect.txt +++ b/test/markup/less/css_consistency.expect.txt @@ -58,7 +58,18 @@ url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); */ } +@keyframes important1 { + from { margin-top: 50px; } + 50% { margin-top: 60px !important; } + to { margin-top: 100px; } +} + main { --color: red; color: var(--color); } + +main { + /* normal comment */ + width: /* inline comment */ 50px; +} diff --git a/test/markup/less/css_consistency.txt b/test/markup/less/css_consistency.txt index 26ed3b079e..1f2354ba28 100644 --- a/test/markup/less/css_consistency.txt +++ b/test/markup/less/css_consistency.txt @@ -58,7 +58,18 @@ a[href*="example"] {} url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); */ } +@keyframes important1 { + from { margin-top: 50px; } + 50% { margin-top: 60px !important; } + to { margin-top: 100px; } +} + main { --color: red; color: var(--color); } + +main { + /* normal comment */ + width: /* inline comment */ 50px; +} diff --git a/test/markup/scss/css_consistency.expect.txt b/test/markup/scss/css_consistency.expect.txt index e60d0c8dfb..53fda48980 100644 --- a/test/markup/scss/css_consistency.expect.txt +++ b/test/markup/scss/css_consistency.expect.txt @@ -58,7 +58,18 @@ url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); */ } +@keyframes important1 { + from { margin-top: 50px; } + 50% { margin-top: 60px !important; } + to { margin-top: 100px; } +} + main { --color: red; color: var(--color); } + +main { + /* normal comment */ + width: /* inline comment */ 50px; +} diff --git a/test/markup/scss/css_consistency.txt b/test/markup/scss/css_consistency.txt index 26ed3b079e..1f2354ba28 100644 --- a/test/markup/scss/css_consistency.txt +++ b/test/markup/scss/css_consistency.txt @@ -58,7 +58,18 @@ a[href*="example"] {} url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); */ } +@keyframes important1 { + from { margin-top: 50px; } + 50% { margin-top: 60px !important; } + to { margin-top: 100px; } +} + main { --color: red; color: var(--color); } + +main { + /* normal comment */ + width: /* inline comment */ 50px; +} diff --git a/test/markup/stylus/css_consistency.expect.txt b/test/markup/stylus/css_consistency.expect.txt index e60d0c8dfb..53fda48980 100644 --- a/test/markup/stylus/css_consistency.expect.txt +++ b/test/markup/stylus/css_consistency.expect.txt @@ -58,7 +58,18 @@ url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); */ } +@keyframes important1 { + from { margin-top: 50px; } + 50% { margin-top: 60px !important; } + to { margin-top: 100px; } +} + main { --color: red; color: var(--color); } + +main { + /* normal comment */ + width: /* inline comment */ 50px; +} diff --git a/test/markup/stylus/css_consistency.txt b/test/markup/stylus/css_consistency.txt index 26ed3b079e..1f2354ba28 100644 --- a/test/markup/stylus/css_consistency.txt +++ b/test/markup/stylus/css_consistency.txt @@ -58,7 +58,18 @@ a[href*="example"] {} url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); */ } +@keyframes important1 { + from { margin-top: 50px; } + 50% { margin-top: 60px !important; } + to { margin-top: 100px; } +} + main { --color: red; color: var(--color); } + +main { + /* normal comment */ + width: /* inline comment */ 50px; +} diff --git a/test/markup/stylus/default.expect.txt b/test/markup/stylus/default.expect.txt index 8bc18f71f1..5816eb2ada 100644 --- a/test/markup/stylus/default.expect.txt +++ b/test/markup/stylus/default.expect.txt @@ -2,7 +2,7 @@ // variables $green = #008000 -$green_dark = darken($green, 10) +$green_dark = darken($green, 10) // mixin/function container() @@ -16,10 +16,10 @@ background-color #B22222 button - buttonBG(red) + buttonBG(red) .blue-button - buttonBG(blue) + buttonBG(blue) #content, .content font Tahoma, Chunkfive, sans-serif From a05a1acaff34a02e6625f3be8d0ec7bedcb175aa Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 18 Aug 2021 04:49:20 -0400 Subject: [PATCH 004/227] fix(csharp) Fix assignments flagging as functions (#3289) --- CHANGES.md | 1 + src/languages/csharp.js | 7 +++++-- test/markup/csharp/functions.expect.txt | 12 ++++++------ test/markup/csharp/generic_modifiers.expect.txt | 9 ++++++--- test/markup/csharp/generic_modifiers.txt | 6 +++++- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cdb479d899..6d8361a261 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Build: Parser: +- fix(csharp) Fix assignments flagging as functions [Josh Goebel][] - fix(types) Fix some type definition issues (#3274) [Josh Goebel][] - fix(verilog) Fix directive handling (#3283) [Josh Goebel][] - fix(verilog) Fix binary number false positives on `_` (#3283) [Josh Goebel][] diff --git a/src/languages/csharp.js b/src/languages/csharp.js index b89704d4bc..f21fd767e6 100644 --- a/src/languages/csharp.js +++ b/src/languages/csharp.js @@ -396,7 +396,7 @@ export default function(hljs) { }, { className: 'function', - begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*(<.+>\\s*)?\\(', + begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*(<[^=]+>\\s*)?\\(', returnBegin: true, end: /\s*[{;=]/, excludeEnd: true, @@ -408,7 +408,7 @@ export default function(hljs) { relevance: 0 }, { - begin: hljs.IDENT_RE + '\\s*(<.+>\\s*)?\\(', + begin: hljs.IDENT_RE + '\\s*(<[^=]+>\\s*)?\\(', returnBegin: true, contains: [ hljs.TITLE_MODE, @@ -416,6 +416,9 @@ export default function(hljs) { ], relevance: 0 }, + { + match: /\(\)/ + }, { className: 'params', begin: /\(/, diff --git a/test/markup/csharp/functions.expect.txt b/test/markup/csharp/functions.expect.txt index f3c7cba65f..7dabf2dbad 100644 --- a/test/markup/csharp/functions.expect.txt +++ b/test/markup/csharp/functions.expect.txt @@ -1,16 +1,16 @@ -public void ExampleFunction1() { +public void ExampleFunction1() { } -public void ExampleFunction2() +public void ExampleFunction2() { } -void ExampleFunctionDeclaration1(); +void ExampleFunctionDeclaration1(); -void ExampleFunctionDeclaration2() +void ExampleFunctionDeclaration2() ; -public string ExampleExpressionBodiedFunction1() => "dummy"; +public string ExampleExpressionBodiedFunction1() => "dummy"; -public string ExampleExpressionBodiedFunction2() +public string ExampleExpressionBodiedFunction2() => "dummy"; \ No newline at end of file diff --git a/test/markup/csharp/generic_modifiers.expect.txt b/test/markup/csharp/generic_modifiers.expect.txt index 04d3a96b09..89bba00e34 100644 --- a/test/markup/csharp/generic_modifiers.expect.txt +++ b/test/markup/csharp/generic_modifiers.expect.txt @@ -6,7 +6,10 @@ public delegate void DContravariant<in A>(A argument); -public delegate A DCovariant<out A>(); +public delegate A DCovariant<out A>(); -void MethodWithGenericParameter<T>() - \ No newline at end of file +void MethodWithGenericParameter<T>(); + +private static List<string> leftHalfDiamond = new List<string>(); + +private static List<Tuple<int, string>> leftHalfDiamond = new List<Tuple<int, string>>(); diff --git a/test/markup/csharp/generic_modifiers.txt b/test/markup/csharp/generic_modifiers.txt index 71273e85b2..da800a2ced 100644 --- a/test/markup/csharp/generic_modifiers.txt +++ b/test/markup/csharp/generic_modifiers.txt @@ -8,4 +8,8 @@ public delegate void DContravariant(A argument); public delegate A DCovariant(); -void MethodWithGenericParameter() +void MethodWithGenericParameter(); + +private static List leftHalfDiamond = new List(); + +private static List> leftHalfDiamond = new List>(); From a41d7127c9b6b9a3c7f1d998707380f77980cd37 Mon Sep 17 00:00:00 2001 From: Denis Kovalchuk Date: Sat, 28 Aug 2021 18:07:20 +0300 Subject: [PATCH 005/227] fix(cpp) fix `xor_eq` keyword highlighting. (#3315) --- CHANGES.md | 3 ++- src/languages/cpp.js | 2 +- test/markup/cpp/bitwise-keywords.expect.txt | 14 ++++++++++++++ test/markup/cpp/bitwise-keywords.txt | 14 ++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 test/markup/cpp/bitwise-keywords.expect.txt create mode 100644 test/markup/cpp/bitwise-keywords.txt diff --git a/CHANGES.md b/CHANGES.md index 6d8361a261..b937b64e0e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,9 +2,10 @@ enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][] enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][] +- fix(cpp) fix `xor_eq` keyword highlighting. [Denis Kovalchuk][] [Josh Goebel]: https://github.com/joshgoebel - +[Denis Kovalchuk]: https://github.com/deniskovalchuk ## Version 11.2.0 diff --git a/src/languages/cpp.js b/src/languages/cpp.js index e0d10e6a50..ecf89cdd64 100644 --- a/src/languages/cpp.js +++ b/src/languages/cpp.js @@ -198,7 +198,7 @@ export default function(hljs) { 'volatile', 'while', 'xor', - 'xor_eq,' + 'xor_eq' ]; // https://en.cppreference.com/w/cpp/keyword diff --git a/test/markup/cpp/bitwise-keywords.expect.txt b/test/markup/cpp/bitwise-keywords.expect.txt new file mode 100644 index 0000000000..abf6570af9 --- /dev/null +++ b/test/markup/cpp/bitwise-keywords.expect.txt @@ -0,0 +1,14 @@ +unsigned char a = 0xFA; +unsigned char b = 0x4C; + +a = compl b; +a = not b; +a and b; +a bitor b; +a or b; +a xor b; +a bitand b; +a and_eq b; +a or_eq b; +a xor_eq b; +a not_eq b; \ No newline at end of file diff --git a/test/markup/cpp/bitwise-keywords.txt b/test/markup/cpp/bitwise-keywords.txt new file mode 100644 index 0000000000..49012e4cd0 --- /dev/null +++ b/test/markup/cpp/bitwise-keywords.txt @@ -0,0 +1,14 @@ +unsigned char a = 0xFA; +unsigned char b = 0x4C; + +a = compl b; +a = not b; +a and b; +a bitor b; +a or b; +a xor b; +a bitand b; +a and_eq b; +a or_eq b; +a xor_eq b; +a not_eq b; \ No newline at end of file From 51d4c1b0871be337eeb6c651c9b41bc9529c37c1 Mon Sep 17 00:00:00 2001 From: monochromer Date: Mon, 30 Aug 2021 00:19:23 +0500 Subject: [PATCH 006/227] enh(css-like) Add support for CSS Grid properties (#3314) * Add support for CSS Grid * update changelog --- CHANGES.md | 2 ++ src/languages/lib/css-shared.js | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index b937b64e0e..c38f3158e7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,9 +3,11 @@ enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][] enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][] - fix(cpp) fix `xor_eq` keyword highlighting. [Denis Kovalchuk][] +- enh(css/less/stylus/scss) add support for CSS Grid properties [monochromer][] [Josh Goebel]: https://github.com/joshgoebel [Denis Kovalchuk]: https://github.com/deniskovalchuk +[monochromer]: https://github.com/monochromer ## Version 11.2.0 diff --git a/src/languages/lib/css-shared.js b/src/languages/lib/css-shared.js index e14825d8e9..14eed970d7 100644 --- a/src/languages/lib/css-shared.js +++ b/src/languages/lib/css-shared.js @@ -346,6 +346,23 @@ export const ATTRIBUTES = [ 'font-variant-ligatures', 'font-variation-settings', 'font-weight', + 'gap', + 'grid', + 'grid-area', + 'grid-auto-columns', + 'grid-auto-flow', + 'grid-auto-rows', + 'grid-column', + 'grid-column-end', + 'grid-column-start', + 'grid-gap', + 'grid-row', + 'grid-row-end', + 'grid-row-start', + 'grid-template', + 'grid-template-areas', + 'grid-template-columns', + 'grid-template-rows', 'height', 'hyphens', 'icon', @@ -410,6 +427,7 @@ export const ATTRIBUTES = [ 'quotes', 'resize', 'right', + 'row-gap', 'src', // @font-face 'tab-size', 'table-layout', From e4226f5724c5a8fad85a95ead2123bde49c070a4 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 29 Aug 2021 15:25:04 -0400 Subject: [PATCH 007/227] fix(cpp) switch is a keyword (#3312) --- CHANGES.md | 5 +++-- src/languages/cpp.js | 1 + test/markup/cpp/function-like-keywords.expect.txt | 7 +++++++ test/markup/cpp/function-like-keywords.txt | 8 ++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 test/markup/cpp/function-like-keywords.expect.txt create mode 100644 test/markup/cpp/function-like-keywords.txt diff --git a/CHANGES.md b/CHANGES.md index c38f3158e7..d0ad3f8cab 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,8 @@ ## Version 11.3.0 (most likely) -enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][] -enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][] +- enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][] +- enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][] +- fix(cpp) switch is a keyword (#3312) [Josh Goebel][] - fix(cpp) fix `xor_eq` keyword highlighting. [Denis Kovalchuk][] - enh(css/less/stylus/scss) add support for CSS Grid properties [monochromer][] diff --git a/src/languages/cpp.js b/src/languages/cpp.js index ecf89cdd64..2c1976e588 100644 --- a/src/languages/cpp.js +++ b/src/languages/cpp.js @@ -411,6 +411,7 @@ export default function(hljs) { /(?!decltype)/, /(?!if)/, /(?!for)/, + /(?!switch)/, /(?!while)/, hljs.IDENT_RE, regex.lookahead(/(<[^<>]+>|)\s*\(/)) diff --git a/test/markup/cpp/function-like-keywords.expect.txt b/test/markup/cpp/function-like-keywords.expect.txt new file mode 100644 index 0000000000..f58427e223 --- /dev/null +++ b/test/markup/cpp/function-like-keywords.expect.txt @@ -0,0 +1,7 @@ +if (ch) {} + +switch (ch) {} + +while (ch) {} + +for (;;) {} diff --git a/test/markup/cpp/function-like-keywords.txt b/test/markup/cpp/function-like-keywords.txt new file mode 100644 index 0000000000..514676c0a0 --- /dev/null +++ b/test/markup/cpp/function-like-keywords.txt @@ -0,0 +1,8 @@ + +if (ch) {} + +switch (ch) {} + +while (ch) {} + +for (;;) {} From 1fcf61550517a91c1008dde447891f75e87258b9 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 30 Aug 2021 02:11:39 -0400 Subject: [PATCH 008/227] enh(c,cpp) highlight type modifiers as type (#3316) --- CHANGES.md | 1 + src/languages/c.js | 5 +++-- src/languages/cpp.js | 10 +++++----- test/markup/cpp/bitwise-keywords.expect.txt | 4 ++-- test/markup/cpp/template-complexity.expect.txt | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d0ad3f8cab..0396698f38 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ - enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][] - fix(cpp) switch is a keyword (#3312) [Josh Goebel][] - fix(cpp) fix `xor_eq` keyword highlighting. [Denis Kovalchuk][] +- enh(c,cpp) highlight type modifiers as type (#3316) [Josh Goebel][] - enh(css/less/stylus/scss) add support for CSS Grid properties [monochromer][] [Josh Goebel]: https://github.com/joshgoebel diff --git a/src/languages/c.js b/src/languages/c.js index 84912237bb..b868580012 100644 --- a/src/languages/c.js +++ b/src/languages/c.js @@ -116,7 +116,6 @@ export default function(hljs) { "auto", "break", "case", - "const", "continue", "default", "do", @@ -132,7 +131,6 @@ export default function(hljs) { "restrict", "return", "sizeof", - "static", "struct", "switch", "typedef", @@ -172,6 +170,9 @@ export default function(hljs) { "_Decimal32", "_Decimal64", "_Decimal128", + // modifiers + "const", + "static", // aliases "complex", "bool", diff --git a/src/languages/cpp.js b/src/languages/cpp.js index 2c1976e588..dce1565658 100644 --- a/src/languages/cpp.js +++ b/src/languages/cpp.js @@ -128,7 +128,6 @@ export default function(hljs) { 'co_yield', 'compl', 'concept', - 'const', 'const_cast|10', 'consteval', 'constexpr', @@ -172,9 +171,7 @@ export default function(hljs) { 'reinterpret_cast|10', 'requires', 'return', - 'signed', 'sizeof', - 'static', 'static_assert', 'static_cast|10', 'struct', @@ -192,7 +189,6 @@ export default function(hljs) { 'typeid', 'typename', 'union', - 'unsigned', 'using', 'virtual', 'volatile', @@ -214,7 +210,11 @@ export default function(hljs) { 'long', 'short', 'void', - 'wchar_t' + 'wchar_t', + 'unsigned', + 'signed', + 'const', + 'static' ]; const TYPE_HINTS = [ diff --git a/test/markup/cpp/bitwise-keywords.expect.txt b/test/markup/cpp/bitwise-keywords.expect.txt index abf6570af9..c27ed59d06 100644 --- a/test/markup/cpp/bitwise-keywords.expect.txt +++ b/test/markup/cpp/bitwise-keywords.expect.txt @@ -1,5 +1,5 @@ -unsigned char a = 0xFA; -unsigned char b = 0x4C; +unsigned char a = 0xFA; +unsigned char b = 0x4C; a = compl b; a = not b; diff --git a/test/markup/cpp/template-complexity.expect.txt b/test/markup/cpp/template-complexity.expect.txt index 9e004abdb7..92b83178b6 100644 --- a/test/markup/cpp/template-complexity.expect.txt +++ b/test/markup/cpp/template-complexity.expect.txt @@ -7,8 +7,8 @@ } // Disable overload for already valid operands. -template<class T, class = std::enable_if_t<!impl::is_streamable_v<const T &> && std::is_convertible_v<const T &, std::wstring_view>>> -std::wostream &operator <<(std::wostream &stream, const T &thing) +template<class T, class = std::enable_if_t<!impl::is_streamable_v<const T &> && std::is_convertible_v<const T &, std::wstring_view>>> +std::wostream &operator <<(std::wostream &stream, const T &thing) { return stream << static_cast<std::wstring_view>(thing); } From bb4fb2291bcd7323e0e577b9abc00e89f2e2cf14 Mon Sep 17 00:00:00 2001 From: Austin Schick Date: Tue, 31 Aug 2021 20:24:01 -0400 Subject: [PATCH 009/227] enh(python) Add support for unicode identifiers (#3280) * Add support for diacritics in Python identifiers * Add performance testing scripts * Rebuild hljs before each perf test Co-authored-by: Josh Goebel --- CHANGES.md | 10 + docs/mode-reference.rst | 11 + src/languages/python.js | 11 +- src/lib/mode_compiler.js | 2 +- test/markup/index.js | 21 +- .../python/diacritic_identifiers.expect.txt | 23 + test/markup/python/diacritic_identifiers.txt | 23 + test/regex/lib/util.js | 4 +- tools/checkAutoDetect.js | 10 +- tools/perf.js | 70 + tools/sample_files/python.txt | 1713 +++++++++++++++++ types/index.d.ts | 1 + 12 files changed, 1882 insertions(+), 17 deletions(-) create mode 100644 test/markup/python/diacritic_identifiers.expect.txt create mode 100644 test/markup/python/diacritic_identifiers.txt create mode 100755 tools/perf.js create mode 100644 tools/sample_files/python.txt diff --git a/CHANGES.md b/CHANGES.md index 0396698f38..4eee005021 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ ## Version 11.3.0 (most likely) +Parser: + +- add first rough performance testing script (#3280) [Austin Schick][] + +Grammars: + +- fix(python) added support for unicode identifiers (#3280) [Austin Schick][] - enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][] - enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][] - fix(cpp) switch is a keyword (#3312) [Josh Goebel][] @@ -7,10 +14,12 @@ - enh(c,cpp) highlight type modifiers as type (#3316) [Josh Goebel][] - enh(css/less/stylus/scss) add support for CSS Grid properties [monochromer][] +[Austin Schick]: https://github.com/austin-schick [Josh Goebel]: https://github.com/joshgoebel [Denis Kovalchuk]: https://github.com/deniskovalchuk [monochromer]: https://github.com/monochromer + ## Version 11.2.0 Build: @@ -41,6 +50,7 @@ New Languages: [Bradley Mackey]: https://github.com/bradleymackey [Dereavy]: https://github.com/dereavy + ## Version 11.1.0 Grammars: diff --git a/docs/mode-reference.rst b/docs/mode-reference.rst index 40151fb6ad..960b999fd5 100644 --- a/docs/mode-reference.rst +++ b/docs/mode-reference.rst @@ -42,12 +42,22 @@ name The canonical name of this language, ie "JavaScript", etc. +unicodeRegex +^^^^^^^^^^^^ + +- **type**: boolean + +Expresses whether the grammar in question uses Unicode (``u`` flag) regular expressions. +(defaults to false) + + case_insensitive ^^^^^^^^^^^^^^^^ - **type**: boolean Case insensitivity of language keywords and regexps. Used only on the top-level mode. +(defaults to false) aliases @@ -92,6 +102,7 @@ disableAutodetect - **type**: boolean Disables autodetection for this language. +(defaults to false, meaning auto-detect is enabled) compilerExtensions diff --git a/src/languages/python.js b/src/languages/python.js index c2e7e7e90f..03093d2be1 100644 --- a/src/languages/python.js +++ b/src/languages/python.js @@ -5,10 +5,10 @@ Website: https://www.python.org Category: common */ -import { UNDERSCORE_IDENT_RE } from '../lib/modes.js'; import * as regex from '../lib/regex.js'; export default function(hljs) { + const IDENT_RE = /[\p{XID_Start}_]\p{XID_Continue}*/u; const RESERVED_WORDS = [ 'and', 'as', @@ -358,6 +358,7 @@ export default function(hljs) { 'gyp', 'ipython' ], + unicodeRegex: true, keywords: KEYWORDS, illegal: /(<\/|->|\?)|=>/, contains: [ @@ -379,7 +380,7 @@ export default function(hljs) { { match: [ /def/, /\s+/, - UNDERSCORE_IDENT_RE + IDENT_RE, ], scope: { 1: "keyword", @@ -392,14 +393,14 @@ export default function(hljs) { { match: [ /class/, /\s+/, - UNDERSCORE_IDENT_RE, /\s*/, - /\(\s*/, UNDERSCORE_IDENT_RE,/\s*\)/ + IDENT_RE, /\s*/, + /\(\s*/, IDENT_RE,/\s*\)/ ], }, { match: [ /class/, /\s+/, - UNDERSCORE_IDENT_RE + IDENT_RE ], } ], diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index 3ba6159bb8..f4b1ba3e5d 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -33,7 +33,7 @@ export function compileLanguage(language) { function langRe(value, global) { return new RegExp( regex.source(value), - 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '') + 'm' + (language.case_insensitive ? 'i' : '') + (language.unicodeRegex ? 'u' : '') + (global ? 'g' : '') ); } diff --git a/test/markup/index.js b/test/markup/index.js index f653976082..d451e5da5d 100644 --- a/test/markup/index.js +++ b/test/markup/index.js @@ -46,16 +46,23 @@ describe('highlight() markup', async() => { const markupPath = utility.buildPath('markup'); if (!process.env.ONLY_EXTRA) { - const languages = await fs.readdir(markupPath); + let languages = null; + if (process.env.ONLY_LANGUAGES) { + languages = process.env.ONLY_LANGUAGES.split(" "); + } else { + languages = await fs.readdir(markupPath); + } languages.forEach(testLanguage); } - const thirdPartyPackages = await getThirdPartyPackages(); - thirdPartyPackages.forEach( - (pkg) => pkg.names.forEach( - (name, idx) => testLanguage(name, { testDir: pkg.markupTestPaths[idx] }) - ) - ); + if (!process.env.ONLY_LANGUAGES) { + const thirdPartyPackages = await getThirdPartyPackages(); + thirdPartyPackages.forEach( + (pkg) => pkg.names.forEach( + (name, idx) => testLanguage(name, { testDir: pkg.markupTestPaths[idx] }) + ) + ); + } }); it("adding dynamic tests...", async function() {}); // this is required to work diff --git a/test/markup/python/diacritic_identifiers.expect.txt b/test/markup/python/diacritic_identifiers.expect.txt new file mode 100644 index 0000000000..8354526406 --- /dev/null +++ b/test/markup/python/diacritic_identifiers.expect.txt @@ -0,0 +1,23 @@ +def fóö(): + pass + +def bär(): + pass + +def FOÖ(): + pass + +def ÿay(): + pass + +class fóö(): + pass + +class bär(): + pass + +class FOÖ(): + pass + +class ÿay(): + pass \ No newline at end of file diff --git a/test/markup/python/diacritic_identifiers.txt b/test/markup/python/diacritic_identifiers.txt new file mode 100644 index 0000000000..89a2ac9b3d --- /dev/null +++ b/test/markup/python/diacritic_identifiers.txt @@ -0,0 +1,23 @@ +def fóö(): + pass + +def bär(): + pass + +def FOÖ(): + pass + +def ÿay(): + pass + +class fóö(): + pass + +class bär(): + pass + +class FOÖ(): + pass + +class ÿay(): + pass \ No newline at end of file diff --git a/test/regex/lib/util.js b/test/regex/lib/util.js index f323a37264..f253d8328a 100644 --- a/test/regex/lib/util.js +++ b/test/regex/lib/util.js @@ -8,7 +8,9 @@ const { RegExpParser } = require('regexpp'); * @typedef {{ pattern: Pattern, flags: Flags }} LiteralAST */ -const parser = new RegExpParser({ strict: false, ecmaVersion: 6 }); +const parser = new RegExpParser({ strict: false, ecmaVersion: 2018 }); +// ecmaVersion 2018 is ECMAScript 9 + /** @type {Map} */ const astCache = new Map(); diff --git a/tools/checkAutoDetect.js b/tools/checkAutoDetect.js index f4ff21ed0e..5b101672fb 100755 --- a/tools/checkAutoDetect.js +++ b/tools/checkAutoDetect.js @@ -58,12 +58,16 @@ function testAutoDetection(language, index, languages) { }); } -const languages = hljs.listLanguages() - .filter(hljs.autoDetection); +let languages = null; +if (process.env.ONLY_LANGUAGES) { + languages = process.env.ONLY_LANGUAGES.split(" "); +} else { + languages = hljs.listLanguages().filter(hljs.autoDetection); +} console.log('Checking auto-highlighting for ' + colors.grey(languages.length) + ' languages...'); languages.forEach((lang, index) => { - if (index%60===0) { console.log("") } + if (index % 60 === 0) { console.log(""); } testAutoDetection(lang) process.stdout.write("."); }); diff --git a/tools/perf.js b/tools/perf.js new file mode 100755 index 0000000000..0c31b59b44 --- /dev/null +++ b/tools/perf.js @@ -0,0 +1,70 @@ +#!/usr/bin/env node +const execSync = require('child_process').execSync; +const fs = require('fs'); +const { performance } = require('perf_hooks'); + +const build = () => { + console.log(`Starting perf tests, building hljs ... `); + // build node.js version of library with CJS and ESM libraries + execSync('npm run build', { + cwd: '.', + env: Object.assign( + process.env + ) + }); +}; + +const timeTest = (name, func) => { + process.stdout.write(` running ${name}...`); + const t0 = performance.now(); + func(); + const t1 = performance.now(); + console.log(` done! [${((t1 - t0) / 1000).toFixed(2)}s elapsed]`); +} + +const oneLanguageMarkupTests = (lang) => { + for (let i = 0; i < 50; i++) { + execSync('npx mocha ./test/markup', { + cwd: '.', + env: Object.assign( + process.env, + { ONLY_LANGUAGES: lang } + ) + }); + } +}; + +const oneLanguageCheckAutoDetect = (lang) => { + for (let i = 0; i < 50; i++) { + execSync('node ./tools/checkAutoDetect.js', { + env: Object.assign( + process.env, + { ONLY_LANGUAGES: lang } + ) + }); + } +}; + +const globalCheckAutoDetect = () => { + for (let i = 0; i < 5; i++) { + execSync('node ./tools/checkAutoDetect.js'); + } +}; + +const highlightFile = (lang) => { + const source = fs.readFileSync(`./tools/sample_files/${lang}.txt`, { encoding:'utf8' }); + const hljs = require('../build'); + for (let i = 0; i < 2000; i++) { + hljs.highlight(source, {language: lang}); + } +}; + +const main = (lang) => { + build(); + timeTest(`global checkAutoDetect`, globalCheckAutoDetect); + timeTest(`${lang}-only markup tests`, () => oneLanguageMarkupTests(lang)); + timeTest(`${lang}-only checkAutoDetect`, () => oneLanguageCheckAutoDetect(lang)); + timeTest(`highlight large file`, () => highlightFile(lang)); +}; + +main('python'); diff --git a/tools/sample_files/python.txt b/tools/sample_files/python.txt new file mode 100644 index 0000000000..c70ad5a014 --- /dev/null +++ b/tools/sample_files/python.txt @@ -0,0 +1,1713 @@ +from pdb import set_trace +import collections +import re +import sys +import warnings +from bs4.dammit import EntitySubstitution + +DEFAULT_OUTPUT_ENCODING = "utf-8" +PY3K = (sys.version_info[0] > 2) + +whitespace_re = re.compile("\s+") + +def _alias(attr): + """Alias one attribute name to another for backward compatibility""" + @property + def alias(self): + return getattr(self, attr) + + @alias.setter + def alias(self): + return setattr(self, attr) + return alias + + +class NamespacedAttribute(unicode): + + def __new__(cls, prefix, name, namespace=None): + if name is None: + obj = unicode.__new__(cls, prefix) + elif prefix is None: + # Not really namespaced. + obj = unicode.__new__(cls, name) + else: + obj = unicode.__new__(cls, prefix + ":" + name) + obj.prefix = prefix + obj.name = name + obj.namespace = namespace + return obj + +class AttributeValueWithCharsetSubstitution(unicode): + """A stand-in object for a character encoding specified in HTML.""" + +class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution): + """A generic stand-in for the value of a meta tag's 'charset' attribute. + + When Beautiful Soup parses the markup '', the + value of the 'charset' attribute will be one of these objects. + """ + + def __new__(cls, original_value): + obj = unicode.__new__(cls, original_value) + obj.original_value = original_value + return obj + + def encode(self, encoding): + return encoding + + +class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution): + """A generic stand-in for the value of a meta tag's 'content' attribute. + + When Beautiful Soup parses the markup: + + + The value of the 'content' attribute will be one of these objects. + """ + + CHARSET_RE = re.compile("((^|;)\s*charset=)([^;]*)", re.M) + + def __new__(cls, original_value): + match = cls.CHARSET_RE.search(original_value) + if match is None: + # No substitution necessary. + return unicode.__new__(unicode, original_value) + + obj = unicode.__new__(cls, original_value) + obj.original_value = original_value + return obj + + def encode(self, encoding): + def rewrite(match): + return match.group(1) + encoding + return self.CHARSET_RE.sub(rewrite, self.original_value) + +class HTMLAwareEntitySubstitution(EntitySubstitution): + + """Entity substitution rules that are aware of some HTML quirks. + + Specifically, the contents of From 0f3fc89685215fa83d1f967a1352da06d62add5f Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 7 Oct 2021 20:48:59 -0400 Subject: [PATCH 034/227] (chore) fix some linter unhappiness --- .eslintrc.js | 3 +-- src/highlight.js | 3 ++- src/lib/ext/multi_class.js | 6 +++--- src/lib/mode_compiler.js | 11 +++++++---- src/lib/regex.js | 13 +++++++++---- types/index.d.ts | 11 ++++++++--- 6 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 62ac0829fe..1d36330ef0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,8 +29,7 @@ module.exports = { quotes: "off", // this is the style we are already using "operator-linebreak": ["error", "before", { overrides: { - "=": "after", - "+": "after" + "=": "after" } }], // sometimes we declare variables with extra spacing diff --git a/src/highlight.js b/src/highlight.js index f8b9f2ad19..5049329b48 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -17,6 +17,7 @@ import * as logger from "./lib/logger.js"; /** @typedef {import('highlight.js').Mode} Mode @typedef {import('highlight.js').CompiledMode} CompiledMode +@typedef {import('highlight.js').CompiledScope} CompiledScope @typedef {import('highlight.js').Language} Language @typedef {import('highlight.js').HLJSApi} HLJSApi @typedef {import('highlight.js').HLJSPlugin} HLJSPlugin @@ -269,7 +270,7 @@ const HLJS = function(hljs) { } /** - * @param {CompiledMode} mode + * @param {CompiledScope} scope * @param {RegExpMatchArray} match */ function emitMultiClass(scope, match) { diff --git a/src/lib/ext/multi_class.js b/src/lib/ext/multi_class.js index 1ba9c3da79..9a6f2864a6 100644 --- a/src/lib/ext/multi_class.js +++ b/src/lib/ext/multi_class.js @@ -33,7 +33,7 @@ const MultiClassError = new Error(); * are 1, 2, and 5. This function handles this behavior. * * @param {CompiledMode} mode - * @param {Array} regexes + * @param {Array} regexes * @param {{key: "beginScope"|"endScope"}} opts */ function remapScopeNames(mode, regexes, { key }) { @@ -72,7 +72,7 @@ function beginMultiClass(mode) { throw MultiClassError; } - remapScopeNames(mode, mode.begin, {key: "beginScope"}); + remapScopeNames(mode, mode.begin, { key: "beginScope" }); mode.begin = regex._rewriteBackreferences(mode.begin, { joinWith: "" }); } @@ -92,7 +92,7 @@ function endMultiClass(mode) { throw MultiClassError; } - remapScopeNames(mode, mode.end, {key: "endScope"}); + remapScopeNames(mode, mode.end, { key: "endScope" }); mode.end = regex._rewriteBackreferences(mode.end, { joinWith: "" }); } diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index f4b1ba3e5d..dc51d0e8bb 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -33,7 +33,10 @@ export function compileLanguage(language) { function langRe(value, global) { return new RegExp( regex.source(value), - 'm' + (language.case_insensitive ? 'i' : '') + (language.unicodeRegex ? 'u' : '') + (global ? 'g' : '') + 'm' + + (language.case_insensitive ? 'i' : '') + + (language.unicodeRegex ? 'u' : '') + + (global ? 'g' : '') ); } @@ -334,10 +337,10 @@ export function compileLanguage(language) { if (parent) { if (!mode.begin) mode.begin = /\B|\b/; - cmode.beginRe = langRe(mode.begin); + cmode.beginRe = langRe(cmode.begin); if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/; - if (mode.end) cmode.endRe = langRe(mode.end); - cmode.terminatorEnd = regex.source(mode.end) || ''; + if (mode.end) cmode.endRe = langRe(cmode.end); + cmode.terminatorEnd = regex.source(cmode.end) || ''; if (mode.endsWithParent && parent.terminatorEnd) { cmode.terminatorEnd += (mode.end ? '|' : '') + parent.terminatorEnd; } diff --git a/src/lib/regex.js b/src/lib/regex.js index 7a3ff4b738..b914fb4c5f 100644 --- a/src/lib/regex.js +++ b/src/lib/regex.js @@ -50,6 +50,10 @@ export function concat(...args) { return joined; } +/** + * @param { Array } args + * @returns {object} + */ function stripOptionsFromArgs(args) { const opts = args[args.length - 1]; @@ -69,15 +73,16 @@ function stripOptionsFromArgs(args) { * @returns {string} */ export function either(...args) { + /** @type { object & {capture?: boolean} } */ const opts = stripOptionsFromArgs(args); - const joined = '(' + - (opts.capture ? "" : "?:") + - args.map((x) => source(x)).join("|") + ")"; + const joined = '(' + + (opts.capture ? "" : "?:") + + args.map((x) => source(x)).join("|") + ")"; return joined; } /** - * @param {RegExp} re + * @param {RegExp | string} re * @returns {number} */ export function countMatchGroups(re) { diff --git a/types/index.d.ts b/types/index.d.ts index 6db14635a5..c7f3eb5ed4 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -15,7 +15,7 @@ declare module 'highlight.js/private' { } declare module 'highlight.js' { - import { KeywordDict} from "highlight.js/private"; + import { KeywordDict } from "highlight.js/private"; export type HLJSApi = PublicApi & ModesAPI @@ -190,8 +190,13 @@ declare module 'highlight.js' { keywords: Record } + export type CompiledScope = Record & {_emit?: Record, _multi?: boolean, _wrap?: string}; + export type CompiledMode = Omit & { + begin?: RegExp | string + end?: RegExp | string + scope?: string contains: CompiledMode[] keywords: KeywordDict data: Record @@ -204,8 +209,8 @@ declare module 'highlight.js' { isCompiled: true starts?: CompiledMode parent?: CompiledMode - beginScope?: Record & {_emit?: Record, _multi?: boolean, _wrap?: string} - endScope?: Record & {_emit?: Record, _multi?: boolean, _wrap?: string} + beginScope?: CompiledScope + endScope?: CompiledScope } interface ModeDetails { From 1a258a3e72dce8b6534e28a741cfcd7d813463dd Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 8 Oct 2021 12:15:53 -0400 Subject: [PATCH 035/227] (chore) version 10 EOL --- README.md | 4 ---- SECURITY.md | 2 +- VERSION_11_UPGRADE.md | 11 ++++++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 89fb56fc03..c8c3a7baa0 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,6 @@ detection. As always, major releases do contain breaking changes which may require action from users. Please read [VERSION_11_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_11_UPGRADE.md) for a detailed summary of breaking changes and any actions you may need to take. -**Upgrading to v10**: You really should probably be upgrading to version 11... but if you're coming from version 9 then these documents may still prove helpful. - -- [VERSION_10_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_UPGRADE.md) and [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_BREAKING_CHANGES.md) - #### Support for older versions Please see [SECURITY.md](https://github.com/highlightjs/highlight.js/blob/main/SECURITY.md) for long-term support information. diff --git a/SECURITY.md b/SECURITY.md index 2c01436609..086a03424a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,7 +7,7 @@ Due to both time and resource constrains the Highlight.js core team fully suppor | Version | Support | Status | | :-----: | :-: | :------ | | 11.x | :white_check_mark: | The 11.x series recieves regular updates, new features & security fixes. | -| 10.7.x | :white_check_mark: | The 10.x series is now in maintence mode. EOL TBD.
See [VERSION_11_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_11_UPGRADE.md).| +| 10.7.x | :x: | No longer supported.
See [VERSION_11_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_11_UPGRADE.md).| | <= 10.4.0 | :x: | Known vulnerabities. | | <= 9.18.5 | :x: | Known vulnerabities. [EOL](https://github.com/highlightjs/highlight.js/issues/2877) | | 7.x, 8.x | :x: | Obsolete. Known vulnerabities. | diff --git a/VERSION_11_UPGRADE.md b/VERSION_11_UPGRADE.md index d30cfb5958..29364ca14e 100644 --- a/VERSION_11_UPGRADE.md +++ b/VERSION_11_UPGRADE.md @@ -11,6 +11,7 @@ - [Changes to Result Data](#changes-to-result-data) - [Feature Removal](#feature-removal) - [Small Things](#small-things) + - [Upgrading from Version 9.x](#upgrading-from-version-9x) ## Overview of Breaking Changes @@ -63,7 +64,7 @@ hljs.registerAliases(["php3","php4","php5","php6","php7","php8"],{ languageName: - `github` includes significant changes to more properly match modern GitHub syntax highlighting. If you desire the old theme you can manually copy it into your project from the [10-stable branch](https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles). - `github-gist` has been removed in favor of `github` as GitHub and GitHub Gist have converged. If you desire the theme you can manually copy it into your project from the [10-stable branch](https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles). - The `.hljs` CSS selector is now further scoped. It now targets `code.hljs` (inline code) and `pre code.hljs` (code blocks). If you are using a different element you may need to update your CSS to reapply some styling. -- All [Base16 themes](https://github.com/highlightjs/base16-highlightjs) now live in the `styles/base16` directory - this means some CSS files have moved. Please confirm themes you use reference the new locations. +- All [Base16 themes](https://github.com/highlightjs/base16-highlightjs) now live in the `styles/base16` directory - this means some CSS files have moved. Please confirm themes you use reference the new locations. #### Grammar Scopes @@ -191,4 +192,12 @@ This configuration option was deprecated in v10.5. Use a plugin or pre-render co - The `regex` utility `join` has been renamed to `_eitherRewriteBackreferences` (this has always been intended for internal use only) +### Upgrading from Version 9.x + +If you're upgrading all the way from version 9 it may still be helpful to review all the breaking changes in version 10 as well: + +- [VERSION_10_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_UPGRADE.md) +- [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_BREAKING_CHANGES.md) + + [meta-keyword]: https://github.com/highlightjs/highlight.js/pull/3167 From 1c79370d8028d4c2b04ef4050cf3c87b6f9ce9ce Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 12 Oct 2021 07:39:53 -0400 Subject: [PATCH 036/227] fix(js/ts) Float32Array higlighted incorrectly (#3353) * fix(js/ts) Float32Array higlighted incorrectly * add JSON as an exception --- CHANGES.md | 1 + src/languages/javascript.js | 12 ++++- src/languages/lib/ecmascript.js | 63 ++++++++++++++++--------- test/markup/javascript/class.expect.txt | 7 +++ test/markup/javascript/class.txt | 7 +++ 5 files changed, 66 insertions(+), 24 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6b1a4c2939..c6d07459bc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Parser: Grammars: +- fix(js/ts) `Float32Array` highlighted incorrectly (#3353) [Josh Goebel][] - fix(css) single-colon psuedo-elements no longer break highlighting (#3240) [Josh Goebel][] - fix(scss) single-colon psuedo-elements no longer break highlighting (#3240) [Josh Goebel][] - enh(fsharp) rewrite most of the grammar, with many improvements [Melvyn Laïly][] diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 1ad7391950..6dc7bd521b 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -254,7 +254,17 @@ export default function(hljs) { const CLASS_REFERENCE = { relevance: 0, - match: /\b[A-Z][a-z]+([A-Z][a-z]+)*/, + match: + regex.either( + // Hard coded exceptions + /\bJSON/, + // Float32Array + /\b[A-Z][a-z]+([A-Z][a-z]+|\d)*/, + // CSSFactory + /\b[A-Z]{2,}([A-Z][a-z]+|\d)+/, + // BLAH + // this will be flagged as a UPPER_CASE_CONSTANT instead + ), className: "title.class", keywords: { _: [ diff --git a/src/languages/lib/ecmascript.js b/src/languages/lib/ecmascript.js index 965af40f71..e1a2218378 100644 --- a/src/languages/lib/ecmascript.js +++ b/src/languages/lib/ecmascript.js @@ -51,44 +51,61 @@ const LITERALS = [ "Infinity" ]; +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects export const TYPES = [ - "Intl", - "DataView", - "Number", - "Math", - "Date", - "String", - "RegExp", + // Fundamental objects "Object", "Function", "Boolean", - "Error", "Symbol", - "Set", - "Map", - "WeakSet", - "WeakMap", - "Proxy", - "Reflect", - "JSON", - "Promise", + // numbers and dates + "Math", + "Date", + "Number", + "BigInt", + // text + "String", + "RegExp", + // Indexed collections + "Array", + "Float32Array", "Float64Array", + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", "Int16Array", "Int32Array", - "Int8Array", "Uint16Array", "Uint32Array", - "Float32Array", - "Array", - "Uint8Array", - "Uint8ClampedArray", - "ArrayBuffer", "BigInt64Array", "BigUint64Array", - "BigInt" + // Keyed collections + "Set", + "Map", + "WeakSet", + "WeakMap", + // Structured data + "ArrayBuffer", + "SharedArrayBuffer", + "Atomics", + "DataView", + "JSON", + // Control abstraction objects + "Promise", + "Generator", + "GeneratorFunction", + "AsyncFunction", + // Reflection + "Reflect", + "Proxy", + // Internationalization + "Intl", + // WebAssembly + "WebAssembly" ]; export const ERROR_TYPES = [ + "Error", "EvalError", "InternalError", "RangeError", diff --git a/test/markup/javascript/class.expect.txt b/test/markup/javascript/class.expect.txt index 3096980ec4..3ef253c364 100644 --- a/test/markup/javascript/class.expect.txt +++ b/test/markup/javascript/class.expect.txt @@ -26,3 +26,10 @@ if(value) {} switch(value) {} try {} catch(err) {} + +Car +Vehicle +SelfDrivingTruck +CSSParser +Float32Array +BigInt64Array diff --git a/test/markup/javascript/class.txt b/test/markup/javascript/class.txt index 0ba06eab72..bebfe77f90 100644 --- a/test/markup/javascript/class.txt +++ b/test/markup/javascript/class.txt @@ -26,3 +26,10 @@ while(value) {} if(value) {} switch(value) {} try {} catch(err) {} + +Car +Vehicle +SelfDrivingTruck +CSSParser +Float32Array +BigInt64Array From 7c87adcc39fed1754e9c85c2e7f744b560acd24e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 12 Oct 2021 07:59:43 -0400 Subject: [PATCH 037/227] enh(parser) add throwUnescapedHTML to throw error when an HTML injection vulnerability detected (#3352) --- CHANGES.md | 1 + docs/api.rst | 3 +++ src/highlight.js | 25 ++++++++++++++++++++----- src/lib/html_injection_error.js | 7 +++++++ types/index.d.ts | 1 + 5 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 src/lib/html_injection_error.js diff --git a/CHANGES.md b/CHANGES.md index c6d07459bc..9ffa791fee 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ Parser: - add first rough performance testing script (#3280) [Austin Schick][] +- add `throwUnescapedHTML` to warn against potential HTML injection [Josh Goebel][] - expose `regex` helper functions via `hljs` injection [Josh Goebel][] - concat - lookahead diff --git a/docs/api.rst b/docs/api.rst index a5d7880fe9..f4301a2889 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -89,6 +89,9 @@ Configures global options: * ``languageDetectRe``: a regex to configure how CSS class names map to language (allows class names like say `color-as-php` vs the default of `language-php`, etc.) * ``noHighlightRe``: a regex to configure which CSS classes are to be skipped completely. * ``cssSelector``: a CSS selector to configure which elements are affected by ``hljs.highlightAll``. Defaults to ``'pre code'``. +* ``ignoreUnescapedHTML``: do not log warnings to console about unescaped HTML in code blocks +* ``throwUnescapedHTML``: throw a ``HTMLInjectionError`` when ``highlightElement`` is asked to highlight content that includes unescaped HTML + Accepts an object representing options with the values to updated. Other options don't change :: diff --git a/src/highlight.js b/src/highlight.js index 5049329b48..6f546e6ccc 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -13,6 +13,7 @@ import * as MODES from './lib/modes.js'; import { compileLanguage } from './lib/mode_compiler.js'; import * as packageJSON from '../package.json'; import * as logger from "./lib/logger.js"; +import HTMLInjectionError from "./lib/html_injection_error.js"; /** @typedef {import('highlight.js').Mode} Mode @@ -66,6 +67,7 @@ const HLJS = function(hljs) { /** @type HLJSOptions */ let options = { ignoreUnescapedHTML: false, + throwUnescapedHTML: false, noHighlightRe: /^(no-?highlight)$/i, languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i, classPrefix: 'hljs-', @@ -724,11 +726,24 @@ const HLJS = function(hljs) { fire("before:highlightElement", { el: element, language: language }); - // we should be all text, no child nodes - if (!options.ignoreUnescapedHTML && element.children.length > 0) { - console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."); - console.warn("https://github.com/highlightjs/highlight.js/issues/2886"); - console.warn(element); + // we should be all text, no child nodes (unescaped HTML) - this is possibly + // an HTML injection attack - it's likely too late if this is already in + // production (the code has likely already done its damage by the time + // we're seeing it)... but we yell loudly about this so that hopefully it's + // more likely to be caught in development before making it to production + if (element.children.length > 0) { + if (!options.ignoreUnescapedHTML) { + console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."); + console.warn("https://github.com/highlightjs/highlight.js/issues/2886"); + console.warn(element); + } + if (options.throwUnescapedHTML) { + const err = new HTMLInjectionError( + "One of your code blocks includes unescaped HTML.", + element.innerHTML + ); + throw err; + } } node = element; diff --git a/src/lib/html_injection_error.js b/src/lib/html_injection_error.js new file mode 100644 index 0000000000..332a0c13bf --- /dev/null +++ b/src/lib/html_injection_error.js @@ -0,0 +1,7 @@ +export default class HTMLInjectionError extends Error { + constructor(reason, html) { + super(reason); + this.name = "HTMLInjectionError"; + this.html = html; + } +} diff --git a/types/index.d.ts b/types/index.d.ts index c7f3eb5ed4..dae5dff32e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -134,6 +134,7 @@ declare module 'highlight.js' { languages?: string[] __emitter: EmitterConstructor ignoreUnescapedHTML?: boolean + throwUnescapedHTML?: boolean } export interface CallbackResponse { From 2c8da4391aff559e18158bd40f32d17d3c4cceae Mon Sep 17 00:00:00 2001 From: Syb Wartna Date: Wed, 13 Oct 2021 15:41:20 +0200 Subject: [PATCH 038/227] enh(css): add properties from several W3C (Candidate) Recommendations (#3356) * enh(css): add properties from several W3C (Candidate) Recommendations (#3308) * fix(css): remove CSS values in list of CSS properties --- CHANGES.md | 2 + src/languages/lib/css-shared.js | 93 +++++++++++++++++++++++++++++++-- 2 files changed, 92 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9ffa791fee..edd60e83fb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Parser: Grammars: +- enh(css): add properties from several W3C (Candidate) Recommendations (#3308) - fix(js/ts) `Float32Array` highlighted incorrectly (#3353) [Josh Goebel][] - fix(css) single-colon psuedo-elements no longer break highlighting (#3240) [Josh Goebel][] - fix(scss) single-colon psuedo-elements no longer break highlighting (#3240) [Josh Goebel][] @@ -46,6 +47,7 @@ Grammars: [Bahnschrift]: https://github.com/Bahnschrift [Melvyn Laïly]: https://github.com/mlaily [katzeprior]: https://github.com/katzeprior +[Syb Wartna]:https://github.com/waarissyb ## Version 11.2.0 diff --git a/src/languages/lib/css-shared.js b/src/languages/lib/css-shared.js index 14eed970d7..9c9d2a364a 100644 --- a/src/languages/lib/css-shared.js +++ b/src/languages/lib/css-shared.js @@ -240,6 +240,7 @@ export const ATTRIBUTES = [ 'align-content', 'align-items', 'align-self', + 'all', 'animation', 'animation-delay', 'animation-direction', @@ -249,7 +250,6 @@ export const ATTRIBUTES = [ 'animation-name', 'animation-play-state', 'animation-timing-function', - 'auto', 'backface-visibility', 'background', 'background-attachment', @@ -301,9 +301,11 @@ export const ATTRIBUTES = [ 'break-before', 'break-inside', 'caption-side', + 'caret-color', 'clear', 'clip', 'clip-path', + 'clip-rule', 'color', 'column-count', 'column-fill', @@ -315,9 +317,14 @@ export const ATTRIBUTES = [ 'column-span', 'column-width', 'columns', + 'contain', 'content', + 'content-visibility', 'counter-increment', 'counter-reset', + 'cue', + 'cue-after', + 'cue-before', 'cursor', 'direction', 'display', @@ -331,6 +338,7 @@ export const ATTRIBUTES = [ 'flex-shrink', 'flex-wrap', 'float', + 'flow', 'font', 'font-display', 'font-family', @@ -342,11 +350,17 @@ export const ATTRIBUTES = [ 'font-smoothing', 'font-stretch', 'font-style', + 'font-synthesis', 'font-variant', + 'font-variant-caps', + 'font-variant-east-asian', 'font-variant-ligatures', + 'font-variant-numeric', + 'font-variant-position', 'font-variation-settings', 'font-weight', 'gap', + 'glyph-orientation-vertical', 'grid', 'grid-area', 'grid-auto-columns', @@ -363,6 +377,7 @@ export const ATTRIBUTES = [ 'grid-template-areas', 'grid-template-columns', 'grid-template-rows', + 'hanging-punctuation', 'height', 'hyphens', 'icon', @@ -370,11 +385,11 @@ export const ATTRIBUTES = [ 'image-rendering', 'image-resolution', 'ime-mode', - 'inherit', - 'initial', + 'isolation', 'justify-content', 'left', 'letter-spacing', + 'line-break', 'line-height', 'list-style', 'list-style-image', @@ -387,10 +402,27 @@ export const ATTRIBUTES = [ 'margin-top', 'marks', 'mask', + 'mask-border', + 'mask-border-mode', + 'mask-border-outset', + 'mask-border-repeat', + 'mask-border-slice', + 'mask-border-source', + 'mask-border-width', + 'mask-clip', + 'mask-composite', + 'mask-image', + 'mask-mode', + 'mask-origin', + 'mask-position', + 'mask-repeat', + 'mask-size', + 'mask-type', 'max-height', 'max-width', 'min-height', 'min-width', + 'mix-blend-mode', 'nav-down', 'nav-index', 'nav-left', @@ -420,24 +452,68 @@ export const ATTRIBUTES = [ 'page-break-after', 'page-break-before', 'page-break-inside', + 'pause', + 'pause-after', + 'pause-before', 'perspective', 'perspective-origin', 'pointer-events', 'position', 'quotes', 'resize', + 'rest', + 'rest-after', + 'rest-before', 'right', 'row-gap', + 'scroll-margin', + 'scroll-margin-block', + 'scroll-margin-block-end', + 'scroll-margin-block-start', + 'scroll-margin-bottom', + 'scroll-margin-inline', + 'scroll-margin-inline-end', + 'scroll-margin-inline-start', + 'scroll-margin-left', + 'scroll-margin-right', + 'scroll-margin-top', + 'scroll-padding', + 'scroll-padding-block', + 'scroll-padding-block-end', + 'scroll-padding-block-start', + 'scroll-padding-bottom', + 'scroll-padding-inline', + 'scroll-padding-inline-end', + 'scroll-padding-inline-start', + 'scroll-padding-left', + 'scroll-padding-right', + 'scroll-padding-top', + 'scroll-snap-align', + 'scroll-snap-stop', + 'scroll-snap-type', + 'shape-image-threshold', + 'shape-margin', + 'shape-outside', + 'speak', + 'speak-as', 'src', // @font-face 'tab-size', 'table-layout', 'text-align', + 'text-align-all', 'text-align-last', + 'text-combine-upright', 'text-decoration', 'text-decoration-color', 'text-decoration-line', 'text-decoration-style', + 'text-emphasis', + 'text-emphasis-color', + 'text-emphasis-position', + 'text-emphasis-style', 'text-indent', + 'text-justify', + 'text-orientation', 'text-overflow', 'text-rendering', 'text-shadow', @@ -445,6 +521,7 @@ export const ATTRIBUTES = [ 'text-underline-position', 'top', 'transform', + 'transform-box', 'transform-origin', 'transform-style', 'transition', @@ -455,12 +532,22 @@ export const ATTRIBUTES = [ 'unicode-bidi', 'vertical-align', 'visibility', + 'voice-balance', + 'voice-duration', + 'voice-family', + 'voice-pitch', + 'voice-range', + 'voice-rate', + 'voice-stress', + 'voice-volume', 'white-space', 'widows', 'width', + 'will-change', 'word-break', 'word-spacing', 'word-wrap', + 'writing-mode', 'z-index' // reverse makes sure longer attributes `font-weight` are matched fully // instead of getting false positives on say `font` From fc35be599857b1a040fce0a0eddc8bf451635804 Mon Sep 17 00:00:00 2001 From: Zsolt Lengyel Date: Wed, 13 Oct 2021 15:51:21 +0200 Subject: [PATCH 039/227] fix(css/scss/less/stylus) support single colon when using pseudo element selector (#3358) Fixes highlightjs/highlight.js#3240 --- CHANGES.md | 2 ++ src/languages/css.js | 2 +- src/languages/less.js | 2 +- src/languages/scss.js | 2 +- src/languages/stylus.js | 2 +- test/markup/css/pseudo.expect.txt | 4 ++-- test/markup/less/css_consistency.expect.txt | 2 ++ test/markup/less/css_consistency.txt | 2 ++ test/markup/scss/css_consistency.expect.txt | 2 ++ test/markup/scss/css_consistency.txt | 2 ++ test/markup/stylus/css_consistency.expect.txt | 2 ++ test/markup/stylus/css_consistency.txt | 2 ++ 12 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index edd60e83fb..7502834a43 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -37,6 +37,7 @@ Grammars: - enh(scala) add `using` soft keyword (#3330) [Nicolas Stucki][] - enh(fsharp) added `f#` alias (#3337) [Bahnschrift][] - enh(bash) added gnu core utilities (#3342) [katzeprior][] +- fix(css/less/stylus/scss) highlight single-colon psuedo-elements properly (#3240) [zsoltlengyelit][] [Austin Schick]: https://github.com/austin-schick [Josh Goebel]: https://github.com/joshgoebel @@ -47,6 +48,7 @@ Grammars: [Bahnschrift]: https://github.com/Bahnschrift [Melvyn Laïly]: https://github.com/mlaily [katzeprior]: https://github.com/katzeprior +[zsoltlengyelit]: github.com/zsoltlengyelit [Syb Wartna]:https://github.com/waarissyb diff --git a/src/languages/css.js b/src/languages/css.js index ca3952c6c2..e9121740e9 100644 --- a/src/languages/css.js +++ b/src/languages/css.js @@ -58,7 +58,7 @@ export default function(hljs) { begin: ':(' + css.PSEUDO_CLASSES.join('|') + ')' }, { - begin: '::(' + css.PSEUDO_ELEMENTS.join('|') + ')' + begin: ':(:)?(' + css.PSEUDO_ELEMENTS.join('|') + ')' } ] }, diff --git a/src/languages/less.js b/src/languages/less.js index 08001098fc..b1ad793d9a 100644 --- a/src/languages/less.js +++ b/src/languages/less.js @@ -199,7 +199,7 @@ export default function(hljs) { }, { className: 'selector-pseudo', - begin: '::(' + css.PSEUDO_ELEMENTS.join('|') + ')' + begin: ':(:)?(' + css.PSEUDO_ELEMENTS.join('|') + ')' }, { begin: /\(/, diff --git a/src/languages/scss.js b/src/languages/scss.js index 87a07cc4d4..f44f8ee57c 100644 --- a/src/languages/scss.js +++ b/src/languages/scss.js @@ -55,7 +55,7 @@ export default function(hljs) { }, { className: 'selector-pseudo', - begin: '::(' + PSEUDO_ELEMENTS.join('|') + ')' + begin: ':(:)?(' + PSEUDO_ELEMENTS.join('|') + ')' }, VARIABLE, { // pseudo-selector params diff --git a/src/languages/stylus.js b/src/languages/stylus.js index 6d5d4e5985..40ac186cba 100644 --- a/src/languages/stylus.js +++ b/src/languages/stylus.js @@ -96,7 +96,7 @@ export default function(hljs) { }, { className: 'selector-pseudo', - begin: '&?::(' + css.PSEUDO_ELEMENTS.join('|') + ')' + LOOKAHEAD_TAG_END + begin: '&?:(:)?(' + css.PSEUDO_ELEMENTS.join('|') + ')' + LOOKAHEAD_TAG_END }, modes.ATTRIBUTE_SELECTOR_MODE, diff --git a/test/markup/css/pseudo.expect.txt b/test/markup/css/pseudo.expect.txt index 1ea40bb2ab..c6833dcef0 100644 --- a/test/markup/css/pseudo.expect.txt +++ b/test/markup/css/pseudo.expect.txt @@ -1,5 +1,5 @@ -.test:before, -.test:after { +.test:before, +.test:after { color: pink; color: red; } diff --git a/test/markup/less/css_consistency.expect.txt b/test/markup/less/css_consistency.expect.txt index 5df3c49ffc..7d2646167a 100644 --- a/test/markup/less/css_consistency.expect.txt +++ b/test/markup/less/css_consistency.expect.txt @@ -22,7 +22,9 @@ a:visited { color: blue; } div::after { content: "test"; } +div:after { content: "test"; } div::before { content: open-quote; } +div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} diff --git a/test/markup/less/css_consistency.txt b/test/markup/less/css_consistency.txt index 1f2354ba28..fdf6529313 100644 --- a/test/markup/less/css_consistency.txt +++ b/test/markup/less/css_consistency.txt @@ -22,7 +22,9 @@ h1, h2, figcaption, aside, main, form, footer {} a:visited { color: blue; } div::after { content: "test"; } +div:after { content: "test"; } div::before { content: open-quote; } +div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} diff --git a/test/markup/scss/css_consistency.expect.txt b/test/markup/scss/css_consistency.expect.txt index 53fda48980..fa8feaa41c 100644 --- a/test/markup/scss/css_consistency.expect.txt +++ b/test/markup/scss/css_consistency.expect.txt @@ -22,7 +22,9 @@ a:visited { color: blue; } div::after { content: "test"; } +div:after { content: "test"; } div::before { content: open-quote; } +div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} diff --git a/test/markup/scss/css_consistency.txt b/test/markup/scss/css_consistency.txt index 1f2354ba28..fdf6529313 100644 --- a/test/markup/scss/css_consistency.txt +++ b/test/markup/scss/css_consistency.txt @@ -22,7 +22,9 @@ h1, h2, figcaption, aside, main, form, footer {} a:visited { color: blue; } div::after { content: "test"; } +div:after { content: "test"; } div::before { content: open-quote; } +div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} diff --git a/test/markup/stylus/css_consistency.expect.txt b/test/markup/stylus/css_consistency.expect.txt index 53fda48980..fa8feaa41c 100644 --- a/test/markup/stylus/css_consistency.expect.txt +++ b/test/markup/stylus/css_consistency.expect.txt @@ -22,7 +22,9 @@ a:visited { color: blue; } div::after { content: "test"; } +div:after { content: "test"; } div::before { content: open-quote; } +div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} diff --git a/test/markup/stylus/css_consistency.txt b/test/markup/stylus/css_consistency.txt index 1f2354ba28..fdf6529313 100644 --- a/test/markup/stylus/css_consistency.txt +++ b/test/markup/stylus/css_consistency.txt @@ -22,7 +22,9 @@ h1, h2, figcaption, aside, main, form, footer {} a:visited { color: blue; } div::after { content: "test"; } +div:after { content: "test"; } div::before { content: open-quote; } +div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} From 7cb4e3d14a4ce579dc093836d9b29ee165b1553c Mon Sep 17 00:00:00 2001 From: "Jan T. Sott" Date: Wed, 13 Oct 2021 19:51:45 +0200 Subject: [PATCH 040/227] enh(nsis) adds NSIS v3.08 commands, some small improvements (#3351) - Adding some missing keywords - Splitting keywords into arrays Co-authored-by: Josh Goebel --- CHANGES.md | 3 + src/languages/nsis.js | 448 +++++++++++++++++++++++++++- test/markup/nsis/default.expect.txt | 14 +- 3 files changed, 445 insertions(+), 20 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7502834a43..86dc83bf1f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -37,6 +37,8 @@ Grammars: - enh(scala) add `using` soft keyword (#3330) [Nicolas Stucki][] - enh(fsharp) added `f#` alias (#3337) [Bahnschrift][] - enh(bash) added gnu core utilities (#3342) [katzeprior][] +- enh(nsis) add new NSIS commands (#3351) [idleberg][] +- fix(nsis) set `case_insensitive` to `true` (#3351) [idleberg][] - fix(css/less/stylus/scss) highlight single-colon psuedo-elements properly (#3240) [zsoltlengyelit][] [Austin Schick]: https://github.com/austin-schick @@ -50,6 +52,7 @@ Grammars: [katzeprior]: https://github.com/katzeprior [zsoltlengyelit]: github.com/zsoltlengyelit [Syb Wartna]:https://github.com/waarissyb +[idleberg]: https://github.com/idleberg ## Version 11.2.0 diff --git a/src/languages/nsis.js b/src/languages/nsis.js index 59956cbfaf..fa3b2e547f 100644 --- a/src/languages/nsis.js +++ b/src/languages/nsis.js @@ -5,10 +5,149 @@ Author: Jan T. Sott Website: https://nsis.sourceforge.io/Main_Page */ +import * as regex from '../lib/regex.js'; + export default function(hljs) { + const LANGUAGE_CONSTANTS = [ + "ADMINTOOLS", + "APPDATA", + "CDBURN_AREA", + "CMDLINE", + "COMMONFILES32", + "COMMONFILES64", + "COMMONFILES", + "COOKIES", + "DESKTOP", + "DOCUMENTS", + "EXEDIR", + "EXEFILE", + "EXEPATH", + "FAVORITES", + "FONTS", + "HISTORY", + "HWNDPARENT", + "INSTDIR", + "INTERNET_CACHE", + "LANGUAGE", + "LOCALAPPDATA", + "MUSIC", + "NETHOOD", + "OUTDIR", + "PICTURES", + "PLUGINSDIR", + "PRINTHOOD", + "PROFILE", + "PROGRAMFILES32", + "PROGRAMFILES64", + "PROGRAMFILES", + "QUICKLAUNCH", + "RECENT", + "RESOURCES_LOCALIZED", + "RESOURCES", + "SENDTO", + "SMPROGRAMS", + "SMSTARTUP", + "STARTMENU", + "SYSDIR", + "TEMP", + "TEMPLATES", + "VIDEOS", + "WINDIR" + ]; + + const PARAM_NAMES = [ + "ARCHIVE", + "FILE_ATTRIBUTE_ARCHIVE", + "FILE_ATTRIBUTE_NORMAL", + "FILE_ATTRIBUTE_OFFLINE", + "FILE_ATTRIBUTE_READONLY", + "FILE_ATTRIBUTE_SYSTEM", + "FILE_ATTRIBUTE_TEMPORARY", + "HKCR", + "HKCU", + "HKDD", + "HKEY_CLASSES_ROOT", + "HKEY_CURRENT_CONFIG", + "HKEY_CURRENT_USER", + "HKEY_DYN_DATA", + "HKEY_LOCAL_MACHINE", + "HKEY_PERFORMANCE_DATA", + "HKEY_USERS", + "HKLM", + "HKPD", + "HKU", + "IDABORT", + "IDCANCEL", + "IDIGNORE", + "IDNO", + "IDOK", + "IDRETRY", + "IDYES", + "MB_ABORTRETRYIGNORE", + "MB_DEFBUTTON1", + "MB_DEFBUTTON2", + "MB_DEFBUTTON3", + "MB_DEFBUTTON4", + "MB_ICONEXCLAMATION", + "MB_ICONINFORMATION", + "MB_ICONQUESTION", + "MB_ICONSTOP", + "MB_OK", + "MB_OKCANCEL", + "MB_RETRYCANCEL", + "MB_RIGHT", + "MB_RTLREADING", + "MB_SETFOREGROUND", + "MB_TOPMOST", + "MB_USERICON", + "MB_YESNO", + "NORMAL", + "OFFLINE", + "READONLY", + "SHCTX", + "SHELL_CONTEXT", + "SYSTEM|TEMPORARY", + ]; + + const COMPILER_FLAGS = [ + "addincludedir", + "addplugindir", + "appendfile", + "cd", + "define", + "delfile", + "echo", + "else", + "endif", + "error", + "execute", + "finalize", + "getdllversion", + "gettlbversion", + "if", + "ifdef", + "ifmacrodef", + "ifmacrondef", + "ifndef", + "include", + "insertmacro", + "macro", + "macroend", + "makensis", + "packhdr", + "searchparse", + "searchreplace", + "system", + "tempfile", + "undef", + "uninstfinalize", + "verbose", + "warning", + ]; + const CONSTANTS = { - className: 'variable', - begin: /\$(ADMINTOOLS|APPDATA|CDBURN_AREA|CMDLINE|COMMONFILES32|COMMONFILES64|COMMONFILES|COOKIES|DESKTOP|DOCUMENTS|EXEDIR|EXEFILE|EXEPATH|FAVORITES|FONTS|HISTORY|HWNDPARENT|INSTDIR|INTERNET_CACHE|LANGUAGE|LOCALAPPDATA|MUSIC|NETHOOD|OUTDIR|PICTURES|PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES32|PROGRAMFILES64|PROGRAMFILES|QUICKLAUNCH|RECENT|RESOURCES_LOCALIZED|RESOURCES|SENDTO|SMPROGRAMS|SMSTARTUP|STARTMENU|SYSDIR|TEMP|TEMPLATES|VIDEOS|WINDIR)/ + className: 'variable.constant', + begin: regex.concat(/\$/, regex.either(...LANGUAGE_CONSTANTS)) }; const DEFINES = { @@ -33,13 +172,16 @@ export default function(hljs) { const PARAMETERS = { // command parameters className: 'params', - begin: '(ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)' + begin: regex.either(...PARAM_NAMES) }; const COMPILER = { // !compiler_flags className: 'keyword', - begin: /!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|if|ifdef|ifmacrodef|ifmacrondef|ifndef|include|insertmacro|macro|macroend|makensis|packhdr|searchparse|searchreplace|system|tempfile|undef|verbose|warning)/ + begin: regex.concat( + /!/, + regex.either(...COMPILER_FLAGS) + ) }; const METACHARS = { @@ -50,7 +192,7 @@ export default function(hljs) { const PLUGINS = { // plug::ins - className: 'class', + className: 'title.function', begin: /\w+::\w+/ }; @@ -80,14 +222,295 @@ export default function(hljs) { ] }; + const KEYWORDS = [ + "Abort", + "AddBrandingImage", + "AddSize", + "AllowRootDirInstall", + "AllowSkipFiles", + "AutoCloseWindow", + "BGFont", + "BGGradient", + "BrandingText", + "BringToFront", + "Call", + "CallInstDLL", + "Caption", + "ChangeUI", + "CheckBitmap", + "ClearErrors", + "CompletedText", + "ComponentText", + "CopyFiles", + "CRCCheck", + "CreateDirectory", + "CreateFont", + "CreateShortCut", + "Delete", + "DeleteINISec", + "DeleteINIStr", + "DeleteRegKey", + "DeleteRegValue", + "DetailPrint", + "DetailsButtonText", + "DirText", + "DirVar", + "DirVerify", + "EnableWindow", + "EnumRegKey", + "EnumRegValue", + "Exch", + "Exec", + "ExecShell", + "ExecShellWait", + "ExecWait", + "ExpandEnvStrings", + "File", + "FileBufSize", + "FileClose", + "FileErrorText", + "FileOpen", + "FileRead", + "FileReadByte", + "FileReadUTF16LE", + "FileReadWord", + "FileWriteUTF16LE", + "FileSeek", + "FileWrite", + "FileWriteByte", + "FileWriteWord", + "FindClose", + "FindFirst", + "FindNext", + "FindWindow", + "FlushINI", + "GetCurInstType", + "GetCurrentAddress", + "GetDlgItem", + "GetDLLVersion", + "GetDLLVersionLocal", + "GetErrorLevel", + "GetFileTime", + "GetFileTimeLocal", + "GetFullPathName", + "GetFunctionAddress", + "GetInstDirError", + "GetKnownFolderPath", + "GetLabelAddress", + "GetTempFileName", + "GetWinVer", + "Goto", + "HideWindow", + "Icon", + "IfAbort", + "IfErrors", + "IfFileExists", + "IfRebootFlag", + "IfRtlLanguage", + "IfShellVarContextAll", + "IfSilent", + "InitPluginsDir", + "InstallButtonText", + "InstallColors", + "InstallDir", + "InstallDirRegKey", + "InstProgressFlags", + "InstType", + "InstTypeGetText", + "InstTypeSetText", + "Int64Cmp", + "Int64CmpU", + "Int64Fmt", + "IntCmp", + "IntCmpU", + "IntFmt", + "IntOp", + "IntPtrCmp", + "IntPtrCmpU", + "IntPtrOp", + "IsWindow", + "LangString", + "LicenseBkColor", + "LicenseData", + "LicenseForceSelection", + "LicenseLangString", + "LicenseText", + "LoadAndSetImage", + "LoadLanguageFile", + "LockWindow", + "LogSet", + "LogText", + "ManifestDPIAware", + "ManifestLongPathAware", + "ManifestMaxVersionTested", + "ManifestSupportedOS", + "MessageBox", + "MiscButtonText", + "Name", + "Nop", + "OutFile", + "Page", + "PageCallbacks", + "PEAddResource", + "PEDllCharacteristics", + "PERemoveResource", + "PESubsysVer", + "Pop", + "Push", + "Quit", + "ReadEnvStr", + "ReadINIStr", + "ReadRegDWORD", + "ReadRegStr", + "Reboot", + "RegDLL", + "Rename", + "RequestExecutionLevel", + "ReserveFile", + "Return", + "RMDir", + "SearchPath", + "SectionGetFlags", + "SectionGetInstTypes", + "SectionGetSize", + "SectionGetText", + "SectionIn", + "SectionSetFlags", + "SectionSetInstTypes", + "SectionSetSize", + "SectionSetText", + "SendMessage", + "SetAutoClose", + "SetBrandingImage", + "SetCompress", + "SetCompressor", + "SetCompressorDictSize", + "SetCtlColors", + "SetCurInstType", + "SetDatablockOptimize", + "SetDateSave", + "SetDetailsPrint", + "SetDetailsView", + "SetErrorLevel", + "SetErrors", + "SetFileAttributes", + "SetFont", + "SetOutPath", + "SetOverwrite", + "SetRebootFlag", + "SetRegView", + "SetShellVarContext", + "SetSilent", + "ShowInstDetails", + "ShowUninstDetails", + "ShowWindow", + "SilentInstall", + "SilentUnInstall", + "Sleep", + "SpaceTexts", + "StrCmp", + "StrCmpS", + "StrCpy", + "StrLen", + "SubCaption", + "Unicode", + "UninstallButtonText", + "UninstallCaption", + "UninstallIcon", + "UninstallSubCaption", + "UninstallText", + "UninstPage", + "UnRegDLL", + "Var", + "VIAddVersionKey", + "VIFileVersion", + "VIProductVersion", + "WindowIcon", + "WriteINIStr", + "WriteRegBin", + "WriteRegDWORD", + "WriteRegExpandStr", + "WriteRegMultiStr", + "WriteRegNone", + "WriteRegStr", + "WriteUninstaller", + "XPStyle" + ]; + + const LITERALS = [ + "admin", + "all", + "auto", + "both", + "bottom", + "bzip2", + "colored", + "components", + "current", + "custom", + "directory", + "false", + "force", + "hide", + "highest", + "ifdiff", + "ifnewer", + "instfiles", + "lastused", + "leave", + "left", + "license", + "listonly", + "lzma", + "nevershow", + "none", + "normal", + "notset", + "off", + "on", + "open", + "print", + "right", + "show", + "silent", + "silentlog", + "smooth", + "textonly", + "top", + "true", + "try", + "un.components", + "un.custom", + "un.directory", + "un.instfiles", + "un.license", + "uninstConfirm", + "user", + "Win10", + "Win7", + "Win8", + "WinVista", + "zlib" + ]; + + const FUNCTION_DEF = { + match: [ + /Function/, + /\s+/, + regex.concat(/(\.)?/, hljs.IDENT_RE) + ], + scope: { + 1: "keyword", + 3: "title.function" + } + }; + return { name: 'NSIS', - case_insensitive: false, + case_insensitive: true, keywords: { - keyword: - 'Abort AddBrandingImage AddSize AllowRootDirInstall AllowSkipFiles AutoCloseWindow BGFont BGGradient BrandingText BringToFront Call CallInstDLL Caption ChangeUI CheckBitmap ClearErrors CompletedText ComponentText CopyFiles CRCCheck CreateDirectory CreateFont CreateShortCut Delete DeleteINISec DeleteINIStr DeleteRegKey DeleteRegValue DetailPrint DetailsButtonText DirText DirVar DirVerify EnableWindow EnumRegKey EnumRegValue Exch Exec ExecShell ExecShellWait ExecWait ExpandEnvStrings File FileBufSize FileClose FileErrorText FileOpen FileRead FileReadByte FileReadUTF16LE FileReadWord FileWriteUTF16LE FileSeek FileWrite FileWriteByte FileWriteWord FindClose FindFirst FindNext FindWindow FlushINI GetCurInstType GetCurrentAddress GetDlgItem GetDLLVersion GetDLLVersionLocal GetErrorLevel GetFileTime GetFileTimeLocal GetFullPathName GetFunctionAddress GetInstDirError GetKnownFolderPath GetLabelAddress GetTempFileName Goto HideWindow Icon IfAbort IfErrors IfFileExists IfRebootFlag IfRtlLanguage IfShellVarContextAll IfSilent InitPluginsDir InstallButtonText InstallColors InstallDir InstallDirRegKey InstProgressFlags InstType InstTypeGetText InstTypeSetText Int64Cmp Int64CmpU Int64Fmt IntCmp IntCmpU IntFmt IntOp IntPtrCmp IntPtrCmpU IntPtrOp IsWindow LangString LicenseBkColor LicenseData LicenseForceSelection LicenseLangString LicenseText LoadAndSetImage LoadLanguageFile LockWindow LogSet LogText ManifestDPIAware ManifestLongPathAware ManifestMaxVersionTested ManifestSupportedOS MessageBox MiscButtonText Name Nop OutFile Page PageCallbacks PEAddResource PEDllCharacteristics PERemoveResource PESubsysVer Pop Push Quit ReadEnvStr ReadINIStr ReadRegDWORD ReadRegStr Reboot RegDLL Rename RequestExecutionLevel ReserveFile Return RMDir SearchPath SectionGetFlags SectionGetInstTypes SectionGetSize SectionGetText SectionIn SectionSetFlags SectionSetInstTypes SectionSetSize SectionSetText SendMessage SetAutoClose SetBrandingImage SetCompress SetCompressor SetCompressorDictSize SetCtlColors SetCurInstType SetDatablockOptimize SetDateSave SetDetailsPrint SetDetailsView SetErrorLevel SetErrors SetFileAttributes SetFont SetOutPath SetOverwrite SetRebootFlag SetRegView SetShellVarContext SetSilent ShowInstDetails ShowUninstDetails ShowWindow SilentInstall SilentUnInstall Sleep SpaceTexts StrCmp StrCmpS StrCpy StrLen SubCaption Unicode UninstallButtonText UninstallCaption UninstallIcon UninstallSubCaption UninstallText UninstPage UnRegDLL Var VIAddVersionKey VIFileVersion VIProductVersion WindowIcon WriteINIStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegMultiStr WriteRegNone WriteRegStr WriteUninstaller XPStyle', - literal: - 'admin all auto both bottom bzip2 colored components current custom directory false force hide highest ifdiff ifnewer instfiles lastused leave left license listonly lzma nevershow none normal notset off on open print right show silent silentlog smooth textonly top true try un.components un.custom un.directory un.instfiles un.license uninstConfirm user Win10 Win7 Win8 WinVista zlib' + keyword: KEYWORDS, + literal: LITERALS }, contains: [ hljs.HASH_COMMENT_MODE, @@ -99,10 +522,9 @@ export default function(hljs) { relevance: 0 } ), + FUNCTION_DEF, { - className: 'function', - beginKeywords: 'Function PageEx Section SectionGroup', - end: '$' + beginKeywords: 'Function PageEx Section SectionGroup FunctionEnd SectionEnd', }, STRING, COMPILER, diff --git a/test/markup/nsis/default.expect.txt b/test/markup/nsis/default.expect.txt index d3e453a2b0..9574047d8f 100644 --- a/test/markup/nsis/default.expect.txt +++ b/test/markup/nsis/default.expect.txt @@ -16,22 +16,22 @@ CRCCheck on !ifdef ${x64} - InstallDir "$PROGRAMFILES64\installer_name" + InstallDir "$PROGRAMFILES64\installer_name" !else - InstallDir "$PROGRAMFILES\installer_name" + InstallDir "$PROGRAMFILES\installer_name" !endif ; Pages !insertmacro MUI_PAGE_INSTFILES ; Sections -Section "section_name" section_index - nsExec::ExecToLog "calc.exe" -SectionEnd +Section "section_name" section_index + nsExec::ExecToLog "calc.exe" +SectionEnd ; Functions -Function .onInit +Function .onInit DetailPrint "The install button reads $(^InstallBtn)" DetailPrint 'Here comes a$\n$\rline-break!' DetailPrint `Escape the dollar-sign: $$` -FunctionEnd +FunctionEnd From 7315fb1c8944a74d58b8359d996009fb963dfa9a Mon Sep 17 00:00:00 2001 From: Leon <31146334+ierehon1905@users.noreply.github.com> Date: Sun, 17 Oct 2021 15:41:13 +0300 Subject: [PATCH 041/227] enh(css) add support for hex color alpha channel (#3360) (#3362) --- CHANGES.md | 2 ++ src/languages/lib/css-shared.js | 2 +- test/markup/css/hex-colors.expect.txt | 19 +++++++++++++++++++ test/markup/css/hex-colors.txt | 19 +++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 test/markup/css/hex-colors.expect.txt create mode 100644 test/markup/css/hex-colors.txt diff --git a/CHANGES.md b/CHANGES.md index 86dc83bf1f..f906cad1ec 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -40,6 +40,7 @@ Grammars: - enh(nsis) add new NSIS commands (#3351) [idleberg][] - fix(nsis) set `case_insensitive` to `true` (#3351) [idleberg][] - fix(css/less/stylus/scss) highlight single-colon psuedo-elements properly (#3240) [zsoltlengyelit][] +- fix(css) add css hex color alpha support (#3360) [ierehon1905][] [Austin Schick]: https://github.com/austin-schick [Josh Goebel]: https://github.com/joshgoebel @@ -53,6 +54,7 @@ Grammars: [zsoltlengyelit]: github.com/zsoltlengyelit [Syb Wartna]:https://github.com/waarissyb [idleberg]: https://github.com/idleberg +[ierehon1905]: https://github.com/ierehon1905 ## Version 11.2.0 diff --git a/src/languages/lib/css-shared.js b/src/languages/lib/css-shared.js index 9c9d2a364a..933a484154 100644 --- a/src/languages/lib/css-shared.js +++ b/src/languages/lib/css-shared.js @@ -7,7 +7,7 @@ export const MODES = (hljs) => { BLOCK_COMMENT: hljs.C_BLOCK_COMMENT_MODE, HEXCOLOR: { scope: 'number', - begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})' + begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/ }, FUNCTION_DISPATCH: { className: "built_in", diff --git a/test/markup/css/hex-colors.expect.txt b/test/markup/css/hex-colors.expect.txt new file mode 100644 index 0000000000..062d05876c --- /dev/null +++ b/test/markup/css/hex-colors.expect.txt @@ -0,0 +1,19 @@ +.test-short { + color: #abc; +} + +.test-short-alpha { + color: #abcd; +} + +.test-long { + color: #aabbcc; +} + +.test-long-alpha { + color: #aabbccdd; +} + +.test-invalid { + color: #aabbccd; +} \ No newline at end of file diff --git a/test/markup/css/hex-colors.txt b/test/markup/css/hex-colors.txt new file mode 100644 index 0000000000..f74a3cec52 --- /dev/null +++ b/test/markup/css/hex-colors.txt @@ -0,0 +1,19 @@ +.test-short { + color: #abc; +} + +.test-short-alpha { + color: #abcd; +} + +.test-long { + color: #aabbcc; +} + +.test-long-alpha { + color: #aabbccdd; +} + +.test-invalid { + color: #aabbccd; +} \ No newline at end of file From 0f70132be18769c36b33740c99276e355b0b8702 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 17 Oct 2021 08:59:59 -0400 Subject: [PATCH 042/227] (chore) export named `HighlightJS` export in Node packages (#3307) Resolves #3333. Resolves #3295. - exports a `HighlightJS` named export - exports a `default` named export for CJS (TS compatibility) --- CHANGES.md | 5 +++++ test/builds/package.js | 7 +++++-- tools/build_config.js | 7 ++++++- tools/build_node.js | 11 ++++++++--- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f906cad1ec..ac98114f38 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ ## Version 11.3.0 (most likely) +Build: + +- add `HighlightJS` named export (#3295) [Josh Goebel][] +- add `.default` named export to CJS builds (#3333) [Josh Goebel][] + Parser: - add first rough performance testing script (#3280) [Austin Schick][] diff --git a/test/builds/package.js b/test/builds/package.js index 49376f43b2..eaff262ce0 100644 --- a/test/builds/package.js +++ b/test/builds/package.js @@ -6,6 +6,9 @@ See .travis.yml */ import hljs from '../../build/lib/index.js'; +import { HighlightJS } from '../../build/lib/index.js' -hljs.highlight("cpp","/* test */") -console.log("Rollup built package works.") +const language = "cpp"; +hljs.highlight("/* test */", {language}); +HighlightJS.highlight("/* test */", {language}); +console.log("Rollup built package works."); diff --git a/tools/build_config.js b/tools/build_config.js index 6d6557f4ab..02f91373ad 100644 --- a/tools/build_config.js +++ b/tools/build_config.js @@ -28,7 +28,12 @@ module.exports = { } }, node: { - output: { format: "cjs", strict: false, exports: "auto" } + output: { + format: "cjs", + strict: false, + exports: "auto", + footer: "" + } }, browser_iife: { input: { diff --git a/tools/build_node.js b/tools/build_node.js index 6e8117e664..9dcc8579b5 100644 --- a/tools/build_node.js +++ b/tools/build_node.js @@ -12,14 +12,18 @@ const log = (...args) => console.log(...args); async function buildESMStub(name) { const code = `// https://nodejs.org/api/packages.html#packages_writing_dual_packages_while_avoiding_or_minimizing_hazards\n` + - `import hljs from '../lib/${name}.js';\n` + - `export default hljs;\n`; + `import HighlightJS from '../lib/${name}.js';\n` + + `export { HighlightJS };\n` + + `export default HighlightJS;\n`; await fs.writeFile(`${process.env.BUILD_DIR}/es/${name}.js`, code); } async function buildCJSIndex(name, languages) { const header = "var hljs = require('./core');"; - const footer = "module.exports = hljs;"; + const footer = + `hljs.HighlightJS = hljs\n` + + `hljs.default = hljs\n` + + `module.exports = hljs;`; const registration = languages.map((lang) => { const require = `require('./languages/${lang.name}')`; @@ -82,6 +86,7 @@ async function buildESMUtils() { async function buildNodeHighlightJS(options) { const input = { ...config.rollup.core.input, input: `src/highlight.js` }; const output = { ...config.rollup.node.output, file: `${process.env.BUILD_DIR}/lib/core.js` }; + output.footer = "highlight.HighlightJS = highlight;\nhighlight.default = highlight;"; await rollupWrite(input, output); if (options.esm) { buildESMStub("core"); From fbf95341756f14691eb332e47d4284097ba71015 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 17 Oct 2021 09:10:17 -0400 Subject: [PATCH 043/227] fix(js/ts) fix detecting types as JSX (#3278) --- CHANGES.md | 2 + src/languages/javascript.js | 59 +++++++++++++++++++++------ src/languages/typescript.js | 40 ++++++++++++------ test/markup/javascript/jsx.expect.txt | 18 ++++++++ test/markup/javascript/jsx.txt | 18 ++++++++ 5 files changed, 111 insertions(+), 26 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ac98114f38..2a09c4c6a5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,8 @@ Parser: Grammars: +- fix(ts) some complex types would classify as JSX (#3278) [Josh Goebel][] +- fix(js/ts) less false positives for `class X extends Y` (#3278) [Josh Goebel][] - enh(css): add properties from several W3C (Candidate) Recommendations (#3308) - fix(js/ts) `Float32Array` highlighted incorrectly (#3353) [Josh Goebel][] - fix(css) single-colon psuedo-elements no longer break highlighting (#3240) [Josh Goebel][] diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 6dc7bd521b..b09065dd85 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -28,6 +28,8 @@ export default function(hljs) { begin: '<>', end: '' }; + // to avoid some special cases inside isTrulyOpeningTag + const XML_SELF_CLOSING = /<[A-Za-z0-9\\._:-]+\s*\/>/; const XML_TAG = { begin: /<[A-Za-z0-9\\._:-]+/, end: /\/[A-Za-z0-9\\._:-]+>|\/>/, @@ -38,15 +40,20 @@ export default function(hljs) { isTrulyOpeningTag: (match, response) => { const afterMatchIndex = match[0].length + match.index; const nextChar = match.input[afterMatchIndex]; - // nested type? - // HTML should not include another raw `<` inside a tag - // But a type might: `>`, etc. - if (nextChar === "<") { + if ( + // HTML should not include another raw `<` inside a tag + // nested type? + // `>`, etc. + nextChar === "<" || + // the , gives away that this is not HTML + // `` + nextChar === ",") { response.ignoreMatch(); return; } - // - // This is now either a tag or a type. + + // `` + // Quite possibly a tag, lets look for a matching closing tag... if (nextChar === ">") { // if we cannot find a matching closing tag, then we // will ignore it @@ -54,6 +61,22 @@ export default function(hljs) { response.ignoreMatch(); } } + + // `` (self-closing) + // handled by simpleSelfClosing rule + + // `` + // technically this could be HTML, but it smells like a type + let m; + const afterMatch = match.input.substr(afterMatchIndex); + // NOTE: This is ugh, but added specifically for https://github.com/highlightjs/highlight.js/issues/3276 + if ((m = afterMatch.match(/^\s+extends\s+/))) { + if (m.index === 0) { + response.ignoreMatch(); + // eslint-disable-next-line no-useless-return + return; + } + } } }; const KEYWORDS = { @@ -227,28 +250,37 @@ export default function(hljs) { // ES6 classes const CLASS_OR_EXTENDS = { variants: [ + // class Car extends vehicle { match: [ /class/, /\s+/, - IDENT_RE + IDENT_RE, + /\s+/, + /extends/, + /\s+/, + regex.concat(IDENT_RE, "(", regex.concat(/\./, IDENT_RE), ")*") ], scope: { 1: "keyword", - 3: "title.class" + 3: "title.class", + 5: "keyword", + 7: "title.class.inherited" } }, + // class Car { match: [ - /extends/, + /class/, /\s+/, - regex.concat(IDENT_RE, "(", regex.concat(/\./, IDENT_RE), ")*") + IDENT_RE ], scope: { 1: "keyword", - 3: "title.class.inherited" + 3: "title.class" } - } + }, + ] }; @@ -390,7 +422,7 @@ export default function(hljs) { aliases: ['js', 'jsx', 'mjs', 'cjs'], keywords: KEYWORDS, // this will be extended by TypeScript - exports: { PARAMS_CONTAINS }, + exports: { PARAMS_CONTAINS, CLASS_REFERENCE }, illegal: /#(?![$_A-z])/, contains: [ hljs.SHEBANG({ @@ -464,6 +496,7 @@ export default function(hljs) { { // JSX variants: [ { begin: FRAGMENT.begin, end: FRAGMENT.end }, + { match: XML_SELF_CLOSING }, { begin: XML_TAG.begin, // we carefully check the opening tag to see if it truly diff --git a/src/languages/typescript.js b/src/languages/typescript.js index eea7ad8967..c63adc995c 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -12,19 +12,9 @@ import javascript from "./javascript.js"; /** @type LanguageFn */ export default function(hljs) { + const tsLanguage = javascript(hljs); + const IDENT_RE = ECMAScript.IDENT_RE; - const NAMESPACE = { - beginKeywords: 'namespace', end: /\{/, excludeEnd: true - }; - const INTERFACE = { - beginKeywords: 'interface', end: /\{/, excludeEnd: true, - keywords: 'interface extends' - }; - const USE_STRICT = { - className: 'meta', - relevance: 10, - begin: /^\s*['"]use strict['"]/ - }; const TYPES = [ "any", "void", @@ -35,6 +25,31 @@ export default function(hljs) { "never", "enum" ]; + const NAMESPACE = { + beginKeywords: 'namespace', + end: /\{/, + excludeEnd: true, + contains: [ + tsLanguage.exports.CLASS_REFERENCE + ] + }; + const INTERFACE = { + beginKeywords: 'interface', + end: /\{/, + excludeEnd: true, + keywords: { + keyword: 'interface extends', + built_in: TYPES + }, + contains: [ + tsLanguage.exports.CLASS_REFERENCE + ] + }; + const USE_STRICT = { + className: 'meta', + relevance: 10, + begin: /^\s*['"]use strict['"]/ + }; const TS_SPECIFIC_KEYWORDS = [ "type", "namespace", @@ -67,7 +82,6 @@ export default function(hljs) { mode.contains.splice(indx, 1, replacement); }; - const tsLanguage = javascript(hljs); // this should update anywhere keywords is used since // it will be the same actual JS object diff --git a/test/markup/javascript/jsx.expect.txt b/test/markup/javascript/jsx.expect.txt index 41e17403a3..c10ef1add8 100644 --- a/test/markup/javascript/jsx.expect.txt +++ b/test/markup/javascript/jsx.expect.txt @@ -25,3 +25,21 @@ } var x = 5; + +// this is NOT JSX and should not trigger the rule +interface Prefixer<Something extends string> { + (): `other__${Something}`; + + parse: <From extends string>( + value: From + ) => number; +} + +const cloneWith = <T, A extends keyof T, V>( + i: T, + a: A, + value: V +): Omit<T, A> & {[K in A]: V} => ({ + ...i, + [a]: value, +}); \ No newline at end of file diff --git a/test/markup/javascript/jsx.txt b/test/markup/javascript/jsx.txt index a76ef8eecd..4cb3104d10 100644 --- a/test/markup/javascript/jsx.txt +++ b/test/markup/javascript/jsx.txt @@ -25,3 +25,21 @@ class App extends Component { } var x = 5; + +// this is NOT JSX and should not trigger the rule +interface Prefixer { + (): `other__${Something}`; + + parse: ( + value: From + ) => number; +} + +const cloneWith = ( + i: T, + a: A, + value: V +): Omit & {[K in A]: V} => ({ + ...i, + [a]: value, +}); \ No newline at end of file From 0ce39797eef11bc60005e956b44660851e802d24 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 17 Oct 2021 09:30:27 -0400 Subject: [PATCH 044/227] 11.3.0 --- CHANGES.md | 2 +- README.md | 18 +- docs/conf.py | 2 +- package-lock.json | 1548 +++++++++++++++++---------------------------- package.json | 12 +- 5 files changed, 600 insertions(+), 982 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2a09c4c6a5..4918079eb5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## Version 11.3.0 (most likely) +## Version 11.3.0 Build: diff --git a/README.md b/README.md index c8c3a7baa0..0c283eb2a5 100644 --- a/README.md +++ b/README.md @@ -320,28 +320,28 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md **cdnjs** ([link](https://cdnjs.com/libraries/highlight.js)) ```html - - + + - + ``` **jsdelivr** ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) ```html - - + + - + ``` **unpkg** ([link](https://unpkg.com/browse/@highlightjs/cdn-assets/)) ```html - - + + - + ``` **Note:** *The CDN-hosted `highlight.min.js` package doesn't bundle every language.* It would be diff --git a/docs/conf.py b/docs/conf.py index af33353924..251e60b38c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,7 @@ # built documents. # The full version, including alpha/beta/rc tags. -release = '11.2.0' +release = '11.3.0' # The short X.Y version. version = ".".join(release.split(".")[:2]) diff --git a/package-lock.json b/package-lock.json index fcbb17d048..07072aab00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "highlight.js", - "version": "11.2.0", + "version": "11.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "11.2.0", + "version": "11.3.0", "license": "BSD-3-Clause", "devDependencies": { "@rollup/plugin-commonjs": "^21.0.0", @@ -24,21 +24,21 @@ "dependency-resolver": "^2.0.1", "eslint": "^7.26.0", "eslint-config-standard": "^16.0.1", - "eslint-plugin-import": "^2.22.1", + "eslint-plugin-import": "^2.25.2", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", "glob": "^7.1.7", - "glob-promise": "^4.0.1", + "glob-promise": "^4.2.1", "handlebars": "^4.7.6", - "jsdom": "^17.0.0", + "jsdom": "^18.0.0", "lodash": "^4.17.20", - "mocha": "9.1", + "mocha": "^9.1.3", "refa": "^0.4.1", "rollup": "^2.47.0", "should": "^13.2.3", "terser": "^5.7.0", "tiny-worker": "^2.3.0", - "typescript": "^4.0.5" + "typescript": "^4.4.4" }, "engines": { "node": ">=12.0.0" @@ -272,12 +272,12 @@ "dev": true }, "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true, "engines": { - "node": ">= 6" + "node": ">= 10" } }, "node_modules/@types/estree": { @@ -665,16 +665,16 @@ } }, "node_modules/array-includes": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", - "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", + "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", + "es-abstract": "^1.19.1", "get-intrinsic": "^1.1.1", - "is-string": "^1.0.5" + "is-string": "^1.0.7" }, "engines": { "node": ">= 0.4" @@ -693,14 +693,14 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", - "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", + "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" + "es-abstract": "^1.19.0" }, "engines": { "node": ">= 0.4" @@ -1067,14 +1067,14 @@ "dev": true }, "node_modules/data-urls": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.0.tgz", - "integrity": "sha512-4AefxbTTdFtxDUdh0BuMBs2qJVL25Mow2zlcuuePegQwgD6GEmQao42LLEeksOui8nL4RcNEugIpFP7eRd33xg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.1.tgz", + "integrity": "sha512-Ds554NeT5Gennfoo9KN50Vh6tpgtvYEwraYjejXnyTpu1C7oXKxdFk75REooENHE8ndTVOJuv+BEs4/J/xcozw==", "dev": true, "dependencies": { "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^9.0.0" + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^10.0.0" }, "engines": { "node": ">=12" @@ -1213,24 +1213,15 @@ } }, "node_modules/domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, "dependencies": { - "webidl-conversions": "^5.0.0" + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/domexception/node_modules/webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/emoji-regex": { @@ -1251,32 +1242,27 @@ "node": ">=8.6" } }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, "node_modules/es-abstract": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz", - "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", + "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-symbols": "^1.0.2", - "is-callable": "^1.2.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.3", - "is-string": "^1.0.6", - "object-inspect": "^1.10.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.1", + "is-string": "^1.0.7", + "is-weakref": "^1.0.1", + "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -1459,12 +1445,13 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz", - "integrity": "sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz", + "integrity": "sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ==", "dev": true, "dependencies": { "debug": "^3.2.7", + "find-up": "^2.1.0", "pkg-dir": "^2.0.0" }, "engines": { @@ -1480,6 +1467,64 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-module-utils/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/eslint-plugin-es": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.0.tgz", @@ -1494,24 +1539,22 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.24.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz", - "integrity": "sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q==", + "version": "2.25.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.2.tgz", + "integrity": "sha512-qCwQr9TYfoBHOFcVGKY9C9unq05uOxxdklmBXLVvcwo68y5Hta6/GzCZEMx2zQiu0woKNEER0LE7ZgaOfBU14g==", "dev": true, "dependencies": { - "array-includes": "^3.1.3", - "array.prototype.flat": "^1.2.4", + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.6.2", - "find-up": "^2.0.0", + "eslint-module-utils": "^2.7.0", "has": "^1.0.3", - "is-core-module": "^2.6.0", + "is-core-module": "^2.7.0", + "is-glob": "^4.0.3", "minimatch": "^3.0.4", - "object.values": "^1.1.4", - "pkg-up": "^2.0.0", - "read-pkg-up": "^3.0.0", + "object.values": "^1.1.5", "resolve": "^1.20.0", "tsconfig-paths": "^3.11.0" }, @@ -1519,7 +1562,7 @@ "node": ">=4" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" } }, "node_modules/eslint-plugin-import/node_modules/debug": { @@ -1543,70 +1586,12 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-plugin-import/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "node_modules/eslint-plugin-import/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -2043,6 +2028,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -2076,9 +2077,9 @@ } }, "node_modules/glob-promise": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-4.2.0.tgz", - "integrity": "sha512-XQlQamNoMi++Sd5c8Y3l/FE2aqia+Lo1ghXEJZiqXdOvWOosA/zVetMahrdfRwwPjCXcFjg3fUogryAMa7IRQQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-4.2.1.tgz", + "integrity": "sha512-KdazFt1ybE3nfcwCQdpJJW6ImFI6pen2YXSIeui2d8nMv5eolWBq2WFQRYFMjvgUjuB9cYR8Ez8zrphLC9hnXA==", "dev": true, "dependencies": { "@types/glob": "^7.1.3" @@ -2207,6 +2208,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -2216,31 +2232,25 @@ "he": "bin/he" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, "node_modules/html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", "dev": true, "dependencies": { - "whatwg-encoding": "^1.0.5" + "whatwg-encoding": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, "dependencies": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" }, @@ -2262,12 +2272,12 @@ } }, "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { "node": ">=0.10.0" @@ -2332,17 +2342,28 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "node_modules/internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } }, "node_modules/is-bigint": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", - "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2360,12 +2381,13 @@ } }, "node_modules/is-boolean-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", - "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2375,9 +2397,9 @@ } }, "node_modules/is-callable": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", - "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", "dev": true, "engines": { "node": ">= 0.4" @@ -2399,10 +2421,13 @@ } }, "node_modules/is-date-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", - "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -2420,9 +2445,9 @@ } }, "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" @@ -2459,10 +2484,13 @@ } }, "node_modules/is-number-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", - "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", + "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -2504,13 +2532,13 @@ "dev": true }, "node_modules/is-regex": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", - "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "has-symbols": "^1.0.2" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2519,11 +2547,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", + "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-string": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", - "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -2558,6 +2598,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakref": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz", + "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2584,23 +2636,23 @@ } }, "node_modules/jsdom": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-17.0.0.tgz", - "integrity": "sha512-MUq4XdqwtNurZDVeKScENMPHnkgmdIvMzZ1r1NSwHkDuaqI6BouPjr+17COo4/19oLNnmdpFDPOHVpgIZmZ+VA==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-18.0.0.tgz", + "integrity": "sha512-HVLuBcFmwdWulStv5U+J59b1AyzXhM92KXlM8HQ3ecYtRM2OQEUCPMa4oNuDeCBmtRcC7tJvb0Xz5OeFXMOKTA==", "dev": true, "dependencies": { "abab": "^2.0.5", - "acorn": "^8.4.1", + "acorn": "^8.5.0", "acorn-globals": "^6.0.0", "cssom": "^0.5.0", "cssstyle": "^2.3.0", - "data-urls": "^3.0.0", + "data-urls": "^3.0.1", "decimal.js": "^10.3.1", - "domexception": "^2.0.1", + "domexception": "^4.0.0", "escodegen": "^2.0.0", "form-data": "^4.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.0", @@ -2609,13 +2661,13 @@ "symbol-tree": "^3.2.4", "tough-cookie": "^4.0.0", "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^9.0.0", - "ws": "^8.0.0", - "xml-name-validator": "^3.0.0" + "w3c-xmlserializer": "^3.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^10.0.0", + "ws": "^8.2.3", + "xml-name-validator": "^4.0.0" }, "engines": { "node": ">=12" @@ -2641,12 +2693,6 @@ "node": ">=0.4.0" } }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -2684,21 +2730,6 @@ "node": ">= 0.8.0" } }, - "node_modules/load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -2825,9 +2856,9 @@ "dev": true }, "node_modules/mocha": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.2.tgz", - "integrity": "sha512-ta3LtJ+63RIBP03VBjMGtSqbe6cWXRejF9SyM9Zyli1CKZJZ+vfCTj3oW24V7wAphMJdpOFLoMI3hjJ1LWbs0w==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", @@ -2974,27 +3005,6 @@ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3011,9 +3021,9 @@ "dev": true }, "node_modules/object-inspect": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", - "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3047,14 +3057,14 @@ } }, "node_modules/object.values": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz", - "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.2" + "es-abstract": "^1.19.1" }, "engines": { "node": ">= 0.4" @@ -3146,19 +3156,6 @@ "node": ">=6" } }, - "node_modules/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/parse5": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", @@ -3219,15 +3216,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", @@ -3298,83 +3286,13 @@ "node": ">=4" } }, - "node_modules/pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true, - "dependencies": { - "find-up": "^2.1.0" - }, "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-up/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-up/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-up/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-up/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-up/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true, - "engines": { - "node": ">= 0.8.0" + "node": ">= 0.8.0" } }, "node_modules/progress": { @@ -3410,103 +3328,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "dependencies": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "dependencies": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg/node_modules/path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "dependencies": { - "pify": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -3757,6 +3578,20 @@ "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -3860,38 +3695,6 @@ "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", "dev": true }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", - "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", - "dev": true - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -4108,15 +3911,15 @@ } }, "node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", "dev": true, "dependencies": { "punycode": "^2.1.1" }, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/tsconfig-paths": { @@ -4177,9 +3980,9 @@ } }, "node_modules/typescript": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", - "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -4251,16 +4054,6 @@ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -4271,49 +4064,55 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", + "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", "dev": true, "dependencies": { - "xml-name-validator": "^3.0.0" + "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true, "engines": { - "node": ">=10.4" + "node": ">=12" } }, "node_modules/whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", "dev": true, "dependencies": { - "iconv-lite": "0.4.24" + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" } }, "node_modules/whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "engines": { + "node": ">=12" + } }, "node_modules/whatwg-url": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-9.1.0.tgz", - "integrity": "sha512-CQ0UcrPHyomtlOCot1TL77WyMIm/bCwrJ2D6AOKGwEczU9EpyoqAokfqrf/MioU9kHcMsmJZcg1egXix2KYEsA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", + "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", "dev": true, "dependencies": { - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" }, "engines": { "node": ">=12" @@ -4449,10 +4248,13 @@ } }, "node_modules/xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } }, "node_modules/xmlchars": { "version": "2.2.0", @@ -4739,9 +4541,9 @@ } }, "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, "@types/estree": { @@ -5011,16 +4813,16 @@ } }, "array-includes": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", - "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", + "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", + "es-abstract": "^1.19.1", "get-intrinsic": "^1.1.1", - "is-string": "^1.0.5" + "is-string": "^1.0.7" } }, "array-union": { @@ -5030,14 +4832,14 @@ "dev": true }, "array.prototype.flat": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", - "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", + "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", "dev": true, "requires": { - "call-bind": "^1.0.0", + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" + "es-abstract": "^1.19.0" } }, "astral-regex": { @@ -5333,14 +5135,14 @@ } }, "data-urls": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.0.tgz", - "integrity": "sha512-4AefxbTTdFtxDUdh0BuMBs2qJVL25Mow2zlcuuePegQwgD6GEmQao42LLEeksOui8nL4RcNEugIpFP7eRd33xg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.1.tgz", + "integrity": "sha512-Ds554NeT5Gennfoo9KN50Vh6tpgtvYEwraYjejXnyTpu1C7oXKxdFk75REooENHE8ndTVOJuv+BEs4/J/xcozw==", "dev": true, "requires": { "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^9.0.0" + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^10.0.0" } }, "debug": { @@ -5444,20 +5246,12 @@ } }, "domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, "requires": { - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true - } + "webidl-conversions": "^7.0.0" } }, "emoji-regex": { @@ -5475,32 +5269,27 @@ "ansi-colors": "^4.1.1" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es-abstract": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz", - "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", + "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", "dev": true, "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-symbols": "^1.0.2", - "is-callable": "^1.2.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.3", - "is-string": "^1.0.6", - "object-inspect": "^1.10.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.1", + "is-string": "^1.0.7", + "is-weakref": "^1.0.1", + "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -5688,12 +5477,13 @@ } }, "eslint-module-utils": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz", - "integrity": "sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz", + "integrity": "sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ==", "dev": true, "requires": { "debug": "^3.2.7", + "find-up": "^2.1.0", "pkg-dir": "^2.0.0" }, "dependencies": { @@ -5705,64 +5495,11 @@ "requires": { "ms": "^2.1.1" } - } - } - }, - "eslint-plugin-es": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.0.tgz", - "integrity": "sha512-6/Jb/J/ZvSebydwbBJO1R9E5ky7YeElfK56Veh7e4QGFHCXoIXGH9HhVz+ibJLM3XJ1XjP+T7rKBLUa/Y7eIng==", - "dev": true, - "requires": { - "eslint-utils": "^2.0.0", - "regexpp": "^3.0.0" - } - }, - "eslint-plugin-import": { - "version": "2.24.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz", - "integrity": "sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q==", - "dev": true, - "requires": { - "array-includes": "^3.1.3", - "array.prototype.flat": "^1.2.4", - "debug": "^2.6.9", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.6.2", - "find-up": "^2.0.0", - "has": "^1.0.3", - "is-core-module": "^2.6.0", - "minimatch": "^3.0.4", - "object.values": "^1.1.4", - "pkg-up": "^2.0.0", - "read-pkg-up": "^3.0.0", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.11.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } }, - "doctrine": { + "find-up": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -5778,12 +5515,6 @@ "path-exists": "^3.0.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -5810,6 +5541,63 @@ } } }, + "eslint-plugin-es": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.0.tgz", + "integrity": "sha512-6/Jb/J/ZvSebydwbBJO1R9E5ky7YeElfK56Veh7e4QGFHCXoIXGH9HhVz+ibJLM3XJ1XjP+T7rKBLUa/Y7eIng==", + "dev": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + } + }, + "eslint-plugin-import": { + "version": "2.25.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.2.tgz", + "integrity": "sha512-qCwQr9TYfoBHOFcVGKY9C9unq05uOxxdklmBXLVvcwo68y5Hta6/GzCZEMx2zQiu0woKNEER0LE7ZgaOfBU14g==", + "dev": true, + "requires": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.0", + "has": "^1.0.3", + "is-core-module": "^2.7.0", + "is-glob": "^4.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.5", + "resolve": "^1.20.0", + "tsconfig-paths": "^3.11.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -6085,6 +5873,16 @@ "has-symbols": "^1.0.1" } }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -6109,9 +5907,9 @@ } }, "glob-promise": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-4.2.0.tgz", - "integrity": "sha512-XQlQamNoMi++Sd5c8Y3l/FE2aqia+Lo1ghXEJZiqXdOvWOosA/zVetMahrdfRwwPjCXcFjg3fUogryAMa7IRQQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-4.2.1.tgz", + "integrity": "sha512-KdazFt1ybE3nfcwCQdpJJW6ImFI6pen2YXSIeui2d8nMv5eolWBq2WFQRYFMjvgUjuB9cYR8Ez8zrphLC9hnXA==", "dev": true, "requires": { "@types/glob": "^7.1.3" @@ -6192,34 +5990,37 @@ "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", "dev": true }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, "html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", "dev": true, "requires": { - "whatwg-encoding": "^1.0.5" + "whatwg-encoding": "^2.0.0" } }, "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, "requires": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" } @@ -6235,12 +6036,12 @@ } }, "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "ignore": { @@ -6287,17 +6088,25 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } }, "is-bigint": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", - "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", - "dev": true + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } }, "is-binary-path": { "version": "2.1.0", @@ -6309,18 +6118,19 @@ } }, "is-boolean-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", - "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "requires": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" } }, "is-callable": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", - "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", "dev": true }, "is-core-module": { @@ -6333,10 +6143,13 @@ } }, "is-date-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", - "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", - "dev": true + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-extglob": { "version": "2.1.1", @@ -6345,9 +6158,9 @@ "dev": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -6372,10 +6185,13 @@ "dev": true }, "is-number-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", - "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", - "dev": true + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", + "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-path-cwd": { "version": "2.2.0", @@ -6402,21 +6218,30 @@ "dev": true }, "is-regex": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", - "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "requires": { "call-bind": "^1.0.2", - "has-symbols": "^1.0.2" + "has-tostringtag": "^1.0.0" } }, - "is-string": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", - "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", + "is-shared-array-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", + "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", "dev": true }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-symbol": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", @@ -6432,6 +6257,15 @@ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, + "is-weakref": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz", + "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0" + } + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -6455,23 +6289,23 @@ } }, "jsdom": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-17.0.0.tgz", - "integrity": "sha512-MUq4XdqwtNurZDVeKScENMPHnkgmdIvMzZ1r1NSwHkDuaqI6BouPjr+17COo4/19oLNnmdpFDPOHVpgIZmZ+VA==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-18.0.0.tgz", + "integrity": "sha512-HVLuBcFmwdWulStv5U+J59b1AyzXhM92KXlM8HQ3ecYtRM2OQEUCPMa4oNuDeCBmtRcC7tJvb0Xz5OeFXMOKTA==", "dev": true, "requires": { "abab": "^2.0.5", - "acorn": "^8.4.1", + "acorn": "^8.5.0", "acorn-globals": "^6.0.0", "cssom": "^0.5.0", "cssstyle": "^2.3.0", - "data-urls": "^3.0.0", + "data-urls": "^3.0.1", "decimal.js": "^10.3.1", - "domexception": "^2.0.1", + "domexception": "^4.0.0", "escodegen": "^2.0.0", "form-data": "^4.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.0", @@ -6480,13 +6314,13 @@ "symbol-tree": "^3.2.4", "tough-cookie": "^4.0.0", "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^9.0.0", - "ws": "^8.0.0", - "xml-name-validator": "^3.0.0" + "w3c-xmlserializer": "^3.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^10.0.0", + "ws": "^8.2.3", + "xml-name-validator": "^4.0.0" }, "dependencies": { "acorn": { @@ -6497,12 +6331,6 @@ } } }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -6534,18 +6362,6 @@ "type-check": "~0.3.2" } }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -6645,9 +6461,9 @@ "dev": true }, "mocha": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.2.tgz", - "integrity": "sha512-ta3LtJ+63RIBP03VBjMGtSqbe6cWXRejF9SyM9Zyli1CKZJZ+vfCTj3oW24V7wAphMJdpOFLoMI3hjJ1LWbs0w==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", @@ -6758,26 +6574,6 @@ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -6791,9 +6587,9 @@ "dev": true }, "object-inspect": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", - "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", "dev": true }, "object-keys": { @@ -6815,14 +6611,14 @@ } }, "object.values": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz", - "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.2" + "es-abstract": "^1.19.1" } }, "once": { @@ -6890,16 +6686,6 @@ "callsites": "^3.0.0" } }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, "parse5": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", @@ -6942,12 +6728,6 @@ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, "pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", @@ -7002,60 +6782,6 @@ } } }, - "pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - } - } - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -7089,83 +6815,6 @@ "safe-buffer": "^5.1.0" } }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - }, - "dependencies": { - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - } - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - } - } - }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -7356,6 +7005,17 @@ "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -7437,38 +7097,6 @@ "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", "dev": true }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", - "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", - "dev": true - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -7645,9 +7273,9 @@ } }, "tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", "dev": true, "requires": { "punycode": "^2.1.1" @@ -7696,9 +7324,9 @@ "dev": true }, "typescript": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", - "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true }, "uglify-js": { @@ -7753,16 +7381,6 @@ "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -7773,43 +7391,43 @@ } }, "w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", + "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", "dev": true, "requires": { - "xml-name-validator": "^3.0.0" + "xml-name-validator": "^4.0.0" } }, "webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true }, "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", "dev": true, "requires": { - "iconv-lite": "0.4.24" + "iconv-lite": "0.6.3" } }, "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", "dev": true }, "whatwg-url": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-9.1.0.tgz", - "integrity": "sha512-CQ0UcrPHyomtlOCot1TL77WyMIm/bCwrJ2D6AOKGwEczU9EpyoqAokfqrf/MioU9kHcMsmJZcg1egXix2KYEsA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", + "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", "dev": true, "requires": { - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" } }, "which": { @@ -7903,9 +7521,9 @@ "requires": {} }, "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", "dev": true }, "xmlchars": { diff --git a/package.json b/package.json index aef2c32b21..88464cc18c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "11.2.0", + "version": "11.3.0", "author": { "name": "Ivan Sagalaev", "email": "maniac@softwaremaniacs.org" @@ -70,20 +70,20 @@ "dependency-resolver": "^2.0.1", "eslint": "^7.26.0", "eslint-config-standard": "^16.0.1", - "eslint-plugin-import": "^2.22.1", + "eslint-plugin-import": "^2.25.2", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", "glob": "^7.1.7", - "glob-promise": "^4.0.1", + "glob-promise": "^4.2.1", "handlebars": "^4.7.6", - "jsdom": "^17.0.0", + "jsdom": "^18.0.0", "lodash": "^4.17.20", - "mocha": "9.1", + "mocha": "^9.1.3", "refa": "^0.4.1", "rollup": "^2.47.0", "should": "^13.2.3", "terser": "^5.7.0", "tiny-worker": "^2.3.0", - "typescript": "^4.0.5" + "typescript": "^4.4.4" } } From 76efccf3a36fdcf538403ebd498a1bd5c1166f4d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 17 Oct 2021 16:03:17 -0400 Subject: [PATCH 045/227] (fix/chore) safer wrapper for IIFE grammar plugins Resolves #3363. The `rollup` output format changed out from underneath us which means that our simple text processing of IIFE output broke and we were outputting invalid JS for our CDN language builds. Now we wrap the IIFE inside our own second IIFE and then perform `hljs.registerLanguage` there. This should be more resilient to future subtle changes in the output. --- tools/lib/language.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/lib/language.js b/tools/lib/language.js index 0e25f973c0..30dd1367a6 100644 --- a/tools/lib/language.js +++ b/tools/lib/language.js @@ -79,15 +79,18 @@ class Language { async function compileLanguage (language, options) { - const IIFE_HEADER_REGEX = /^(var hljsGrammar = )?\(function \(\)/; - // TODO: cant we use the source we already have? const input = { ...build_config.rollup.browser_iife.input, input: language.path }; const output = { ...build_config.rollup.browser_iife.output, name: `hljsGrammar`, file: "out.js" }; output.footer = null; - + const data = await rollupCode(input, output); - const iife = data.replace(IIFE_HEADER_REGEX, `hljs.registerLanguage('${language.name}', function ()`); + const iife = ` + (function(){ + ${data} + hljs.registerLanguage('${language.name}', hljsGrammar); + })(); + `.trim(); const esm = `${data};\nexport default hljsGrammar;`; language.module = iife; From 3d1836f5e9d28deca131e626241dfdd48ee40a6b Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 17 Oct 2021 16:12:41 -0400 Subject: [PATCH 046/227] (chore) add tiny header to HLJS grammar modules --- tools/lib/language.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/lib/language.js b/tools/lib/language.js index 30dd1367a6..3a1c20c978 100644 --- a/tools/lib/language.js +++ b/tools/lib/language.js @@ -5,6 +5,7 @@ const glob = require("glob") const path = require("path") const build_config = require("../build_config") +const packageJSON = require("../../package.json") const REQUIRES_REGEX = /\/\*.*?Requires: (.*?)\r?\n/s const CATEGORY_REGEX = /\/\*.*?Category: (.*?)\r?\n/s const LANGUAGE_REGEX = /\/\*.*?Language: (.*?)\r?\n/s @@ -79,6 +80,8 @@ class Language { async function compileLanguage (language, options) { + const HEADER = `/*! \`${language.name}\` grammar compiled for Highlight.js ${packageJSON.version} */`; + // TODO: cant we use the source we already have? const input = { ...build_config.rollup.browser_iife.input, input: language.path }; const output = { ...build_config.rollup.browser_iife.output, name: `hljsGrammar`, file: "out.js" }; @@ -86,12 +89,13 @@ async function compileLanguage (language, options) { const data = await rollupCode(input, output); const iife = ` + ${HEADER} (function(){ ${data} hljs.registerLanguage('${language.name}', hljsGrammar); })(); `.trim(); - const esm = `${data};\nexport default hljsGrammar;`; + const esm = `${HEADER}\n${data};\nexport default hljsGrammar;`; language.module = iife; const miniESM = await Terser.minify(esm, options.terser); From 175b8561ae1109c40118269d9dfe2d4629e8d3f6 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 17 Oct 2021 16:16:39 -0400 Subject: [PATCH 047/227] (release) bump 11.3.1 --- CHANGES.md | 10 ++++++++++ README.md | 18 +++++++++--------- docs/conf.py | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4918079eb5..cb4e2ee304 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,13 @@ + +## Version 11.3.1 + +Build: + +- (fix) Grammar CDN modules not generated correctly. (#3363) [Josh Goebel][] + +[Josh Goebel]: https://github.com/joshgoebel + + ## Version 11.3.0 Build: diff --git a/README.md b/README.md index 0c283eb2a5..96a8ca1c06 100644 --- a/README.md +++ b/README.md @@ -320,28 +320,28 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md **cdnjs** ([link](https://cdnjs.com/libraries/highlight.js)) ```html - - + + - + ``` **jsdelivr** ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) ```html - - + + - + ``` **unpkg** ([link](https://unpkg.com/browse/@highlightjs/cdn-assets/)) ```html - - + + - + ``` **Note:** *The CDN-hosted `highlight.min.js` package doesn't bundle every language.* It would be diff --git a/docs/conf.py b/docs/conf.py index 251e60b38c..3fd4634487 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,7 @@ # built documents. # The full version, including alpha/beta/rc tags. -release = '11.3.0' +release = '11.3.1' # The short X.Y version. version = ".".join(release.split(".")[:2]) diff --git a/package-lock.json b/package-lock.json index 07072aab00..877b12bf68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "highlight.js", - "version": "11.3.0", + "version": "11.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "11.3.0", + "version": "11.3.1", "license": "BSD-3-Clause", "devDependencies": { "@rollup/plugin-commonjs": "^21.0.0", diff --git a/package.json b/package.json index 88464cc18c..6f88716be7 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "11.3.0", + "version": "11.3.1", "author": { "name": "Ivan Sagalaev", "email": "maniac@softwaremaniacs.org" From 2a972d86589f65f4e79f67a02c3bf389a187afa0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 17 Oct 2021 16:18:15 -0400 Subject: [PATCH 048/227] (chore) remove extra linebreak --- CHANGES.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index cb4e2ee304..da390042c7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,3 @@ - ## Version 11.3.1 Build: From 257cfee803426333af25b68da17601aec2663172 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 19 Oct 2021 17:09:56 -0400 Subject: [PATCH 049/227] tests(python) Add coverage for digitpart-based imaginary literals (#3366) 009j is a valid literal even though 009 is not. Ref: 21b146644e15ba2b101341da0d3e4dc61db53056 --- test/markup/python/numbers.expect.txt | 4 ++-- test/markup/python/numbers.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/markup/python/numbers.expect.txt b/test/markup/python/numbers.expect.txt index 004a36eb08..aed662eaec 100644 --- a/test/markup/python/numbers.expect.txt +++ b/test/markup/python/numbers.expect.txt @@ -24,8 +24,8 @@ .0e10J, .00e+10j, .9e-10J, 4.2E10j, 40.0E+08J, 0.E-10j, 00.e100J, 0010e+10j .0e1_0J, .0_0e+10j, .9e-1_0J, 4.2E1_0j, 4_0.0E+0_8J, 0.E-1_0j, 0_0.e1_0_0J, 00_10e+10j -0j, 00J, 000j, 1234J -0j, 0_0J, 0_0_0j, 12_3_4J +0j, 00J, 000j, 009J, 1234j +0j, 0_0J, 0_0_0j, 0_0_9J, 12_3_4j # expressions containing numeric literals diff --git a/test/markup/python/numbers.txt b/test/markup/python/numbers.txt index a0aeb7dc50..8933000a0f 100644 --- a/test/markup/python/numbers.txt +++ b/test/markup/python/numbers.txt @@ -24,8 +24,8 @@ .0e10J, .00e+10j, .9e-10J, 4.2E10j, 40.0E+08J, 0.E-10j, 00.e100J, 0010e+10j .0e1_0J, .0_0e+10j, .9e-1_0J, 4.2E1_0j, 4_0.0E+0_8J, 0.E-1_0j, 0_0.e1_0_0J, 00_10e+10j -0j, 00J, 000j, 1234J -0j, 0_0J, 0_0_0j, 12_3_4J +0j, 00J, 000j, 009J, 1234j +0j, 0_0J, 0_0_0j, 0_0_9J, 12_3_4j # expressions containing numeric literals From 70286584d2abfafafdfa6a9f462dfd4fed856fd8 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 22 Oct 2021 09:08:08 -0400 Subject: [PATCH 050/227] fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#3367) Fixes #2985. * enh(python) Add tests for keyword after numeric literal * fix(python) Fix recognition of numeric literals followed by keywords without whitespace --- CHANGES.md | 8 ++++++++ src/languages/python.js | 18 ++++++++++++------ test/markup/python/keywords.expect.txt | 3 +-- test/markup/python/keywords.txt | 1 - test/markup/python/numbers.expect.txt | 18 ++++++++++++++++++ test/markup/python/numbers.txt | 18 ++++++++++++++++++ 6 files changed, 57 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index da390042c7..ef24a6123c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,11 @@ +## Version 11.3.2 (most likely) + +Grammars: + +- fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] + +[Richard Gibson]: https://github.com/gibson042 + ## Version 11.3.1 Build: diff --git a/src/languages/python.js b/src/languages/python.js index ce603a86d4..46ed88a6f0 100644 --- a/src/languages/python.js +++ b/src/languages/python.js @@ -255,6 +255,12 @@ export default function(hljs) { // https://docs.python.org/3.9/reference/lexical_analysis.html#numeric-literals const digitpart = '[0-9](_?[0-9])*'; const pointfloat = `(\\b(${digitpart}))?\\.(${digitpart})|\\b(${digitpart})\\.`; + // Whitespace after a number (or any lexical token) is needed only if its absence + // would change the tokenization + // https://docs.python.org/3.9/reference/lexical_analysis.html#whitespace-between-tokens + // We deviate slightly, requiring a word boundary or a keyword + // to avoid accidentally recognizing *prefixes* (e.g., `0` in `0x41` or `08` or `0__1`) + const lookahead = `\\b|${RESERVED_WORDS.join('|')}`; const NUMBER = { className: 'number', relevance: 0, @@ -270,7 +276,7 @@ export default function(hljs) { // because both MUST contain a decimal point and so cannot be confused with // the interior part of an identifier { - begin: `(\\b(${digitpart})|(${pointfloat}))[eE][+-]?(${digitpart})[jJ]?\\b` + begin: `(\\b(${digitpart})|(${pointfloat}))[eE][+-]?(${digitpart})[jJ]?(?=${lookahead})` }, { begin: `(${pointfloat})[jJ]?` @@ -283,22 +289,22 @@ export default function(hljs) { // decinteger is optionally imaginary // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals { - begin: '\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b' + begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${lookahead})` }, { - begin: '\\b0[bB](_?[01])+[lL]?\\b' + begin: `\\b0[bB](_?[01])+[lL]?(?=${lookahead})` }, { - begin: '\\b0[oO](_?[0-7])+[lL]?\\b' + begin: `\\b0[oO](_?[0-7])+[lL]?(?=${lookahead})` }, { - begin: '\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b' + begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${lookahead})` }, // imagnumber (digitpart-based) // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals { - begin: `\\b(${digitpart})[jJ]\\b` + begin: `\\b(${digitpart})[jJ](?=${lookahead})` } ] }; diff --git a/test/markup/python/keywords.expect.txt b/test/markup/python/keywords.expect.txt index 501f670464..f2227af2f5 100644 --- a/test/markup/python/keywords.expect.txt +++ b/test/markup/python/keywords.expect.txt @@ -13,5 +13,4 @@ x = Shorty() exec(123) -# note, numbers still aren't highlighted fully -print(1if 0==0else"b") +print(1if 0==0else"b") diff --git a/test/markup/python/keywords.txt b/test/markup/python/keywords.txt index 0b7835526d..30e3d0a180 100644 --- a/test/markup/python/keywords.txt +++ b/test/markup/python/keywords.txt @@ -13,5 +13,4 @@ for _ in sys.path: exec(123) -# note, numbers still aren't highlighted fully print(1if 0==0else"b") diff --git a/test/markup/python/numbers.expect.txt b/test/markup/python/numbers.expect.txt index aed662eaec..725eb354f7 100644 --- a/test/markup/python/numbers.expect.txt +++ b/test/markup/python/numbers.expect.txt @@ -30,6 +30,24 @@ # expressions containing numeric literals 0..__str__, 1e1.__str__, fn(.5) +0is 0, 0lis 0 +0_0_0is 0, 0_0_0lis 0 +0b0is 0, 0b0lis 0 +0b_0_0is 0, 0b_0_0lis 0 +0o0is 0, 0o0lis 0 +0o_0_0is 0, 0o_0_0lis 0 +0x0ais 0, 0x0elis 0 +0x_0_0is 0, 0x_0_0lis 0 +.0is 0, 0.is 0 +.0_0_0is 0, 0_0_0.is 0 +.0e+0is 0, 0.e-0is 0 +.0_0_0e-0_0_0is 0, 0_0_0.e+0_0_0is 0 +.0jis 0, 0.jis 0 +.0_0_0jis 0, 0_0_0.jis 0 +.0e+0jis 0, 0.e-0jis 0 +.0_0_0e-0_0_0jis 0, 0_0_0.e+0_0_0jis 0 +0jis 0, 009jis 0 +0_0_0jis 0, 0_0_9jis 0 # expressions not containing numeric literals x0.j diff --git a/test/markup/python/numbers.txt b/test/markup/python/numbers.txt index 8933000a0f..0511ce4337 100644 --- a/test/markup/python/numbers.txt +++ b/test/markup/python/numbers.txt @@ -30,6 +30,24 @@ # expressions containing numeric literals 0..__str__, 1e1.__str__, fn(.5) +0is 0, 0lis 0 +0_0_0is 0, 0_0_0lis 0 +0b0is 0, 0b0lis 0 +0b_0_0is 0, 0b_0_0lis 0 +0o0is 0, 0o0lis 0 +0o_0_0is 0, 0o_0_0lis 0 +0x0ais 0, 0x0elis 0 +0x_0_0is 0, 0x_0_0lis 0 +.0is 0, 0.is 0 +.0_0_0is 0, 0_0_0.is 0 +.0e+0is 0, 0.e-0is 0 +.0_0_0e-0_0_0is 0, 0_0_0.e+0_0_0is 0 +.0jis 0, 0.jis 0 +.0_0_0jis 0, 0_0_0.jis 0 +.0e+0jis 0, 0.e-0jis 0 +.0_0_0e-0_0_0jis 0, 0_0_0.e+0_0_0jis 0 +0jis 0, 009jis 0 +0_0_0jis 0, 0_0_9jis 0 # expressions not containing numeric literals x0.j From 2ccec7e16c178a6d4d601929a8d3e4ca6791348c Mon Sep 17 00:00:00 2001 From: jaacko-torus Date: Tue, 26 Oct 2021 16:49:21 -0500 Subject: [PATCH 051/227] (chore) `hljs.regex` helpers are missing from type refs (#3369) --- src/lib/regex.js | 2 +- types/index.d.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/regex.js b/src/lib/regex.js index b914fb4c5f..ec5c6bb87f 100644 --- a/src/lib/regex.js +++ b/src/lib/regex.js @@ -69,7 +69,7 @@ function stripOptionsFromArgs(args) { * Any of the passed expresssions may match * * Creates a huge this | this | that | that match - * @param {(RegExp | string)[] } args + * @param {(RegExp | string | { capture?: boolean })[]} args * @returns {string} */ export function either(...args) { diff --git a/types/index.d.ts b/types/index.d.ts index dae5dff32e..b89fffd52b 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -44,6 +44,13 @@ declare module 'highlight.js' { safeMode: () => void versionString: string vuePlugin: () => VuePlugin + regex: { + concat: (...args: (RegExp | string)[]) => string, + lookahead: (re: RegExp | string) => string, + either: (...args: (RegExp | string | { capture?: boolean })[]) => string, + optional: (re: RegExp | string) => string, + anyNumberOfTimes: (re: RegExp | string) => string + } } interface ModesAPI { From cd1c9dcf109b5d43bb1b7e46e312041fbe4805d2 Mon Sep 17 00:00:00 2001 From: Jan Pilzer Date: Sun, 31 Oct 2021 17:37:00 -0700 Subject: [PATCH 052/227] (chore) apply lint to our tooling scripts also (#3380) --- .eslintrc.js | 7 ++-- package.json | 2 +- tools/build.js | 6 +-- tools/build_browser.js | 32 ++++++++-------- tools/build_cdn.js | 4 +- tools/build_node.js | 27 ++++++------- tools/checkAutoDetect.js | 38 +++++++++---------- tools/checkTheme.js | 9 ++--- tools/lib/bundling.js | 4 +- tools/lib/dependencies.js | 55 +++++++++++++-------------- tools/lib/language.js | 79 ++++++++++++++++++--------------------- tools/lib/makestuff.js | 2 +- tools/perf.js | 8 ++-- 13 files changed, 130 insertions(+), 143 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1d36330ef0..61ad70d2e8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,9 +28,10 @@ module.exports = { // for now ignore diff between types of quoting quotes: "off", // this is the style we are already using - "operator-linebreak": ["error", "before", { overrides: { - "=": "after" - } + "operator-linebreak": ["error", "before", { + overrides: { + "=": "after" + } }], // sometimes we declare variables with extra spacing indent: ["error", 2, { VariableDeclarator: 2 }], diff --git a/package.json b/package.json index 6f88716be7..a6376bd740 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "types": "./types/index.d.ts", "scripts": { "mocha": "mocha", - "lint": "eslint src/*.js src/lib/*.js demo/*.js", + "lint": "eslint src/*.js src/lib/*.js demo/*.js tools/**/*.js --ignore-pattern vendor", "lint-languages": "eslint --no-eslintrc -c .eslintrc.lang.js src/languages/**/*.js", "build_and_test": "npm run build && npm run test", "build_and_test_browser": "npm run build-browser && npm run test-browser", diff --git a/tools/build.js b/tools/build.js index 0bf5082685..903976d5c2 100755 --- a/tools/build.js +++ b/tools/build.js @@ -62,7 +62,7 @@ const commander = require('commander'); const path = require('path'); -const { clean } = require("./lib/makestuff"); +const { clean } = require("./lib/makestuff.js"); const log = (...args) => console.log(...args); const TARGETS = ["cdn", "browser", "node"]; @@ -73,8 +73,8 @@ commander .option('-n, --no-minify', 'Disable minification') .option('-ne, --no-esm', 'Disable building ESM') .option('-t, --target ', - 'Build for target ' + - '[all, browser, cdn, node]', + 'Build for target ' + + '[all, browser, cdn, node]', 'browser') .parse(process.argv); diff --git a/tools/build_browser.js b/tools/build_browser.js index 48c0f465b6..24ad4fbed8 100644 --- a/tools/build_browser.js +++ b/tools/build_browser.js @@ -6,10 +6,10 @@ const path = require("path"); const zlib = require('zlib'); const Terser = require("terser"); const child_process = require('child_process'); -const { getLanguages } = require("./lib/language"); -const { filter } = require("./lib/dependencies"); -const config = require("./build_config"); -const { install, installCleanCSS, mkdir, renderTemplate } = require("./lib/makestuff"); +const { getLanguages } = require("./lib/language.js"); +const { filter } = require("./lib/dependencies.js"); +const config = require("./build_config.js"); +const { install, installCleanCSS, mkdir, renderTemplate } = require("./lib/makestuff.js"); const log = (...args) => console.log(...args); const { rollupCode } = require("./lib/bundling.js"); const bundling = require('./lib/bundling.js'); @@ -17,16 +17,16 @@ const Table = require('cli-table'); const getDefaultHeader = () => ({ ...require('../package.json'), - git_sha : child_process + git_sha: child_process .execSync("git rev-parse --short=10 HEAD") - .toString().trim(), + .toString().trim() }); function buildHeader(args = getDefaultHeader()) { - return "/*!\n" + - ` Highlight.js v${args.version} (git: ${args.git_sha})\n` + - ` (c) ${config.copyrightYears} ${args.author.name} and other contributors\n` + - ` License: ${args.license}\n` + - ` */`; + return "/*!\n" + + ` Highlight.js v${args.version} (git: ${args.git_sha})\n` + + ` (c) ${config.copyrightYears} ${args.author.name} and other contributors\n` + + ` License: ${args.license}\n` + + ` */`; } function sortByKey(array, key) { @@ -41,9 +41,9 @@ function detailedGrammarSizes(languages) { if (languages.length > 180) return; const resultTable = new Table({ - head: ['lang','minified'], + head: ['lang', 'minified'], // colWidths: [20,20,10,20,10,20], - chars: {'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': ''}, + chars: { mid: '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' }, style: { head: ['grey'] } @@ -230,19 +230,19 @@ async function buildCore(name, languages, options) { const sizeInfo = { shas: [] }; const writePromises = []; if (options.minify) { - const { code } = await Terser.minify(index, {...config.terser, module: (options.format === "es") }); + const { code } = await Terser.minify(index, { ...config.terser, module: (options.format === "es") }); const src = `${header}\n${code}`; writePromises.push(fs.writeFile(output.file.replace(/js$/, "min.js"), src)); sizeInfo.minified = src.length; sizeInfo.minifiedSrc = src; - sizeInfo.shas[`${relativePath}${name}.min.js`] = bundling.sha384(src) + sizeInfo.shas[`${relativePath}${name}.min.js`] = bundling.sha384(src); } { const src = `${header}\n${index}`; writePromises.push(fs.writeFile(output.file, src)); sizeInfo.fullSize = src.length; sizeInfo.fullSrc = src; - sizeInfo.shas[`${relativePath}${name}.js`] = bundling.sha384(src) + sizeInfo.shas[`${relativePath}${name}.js`] = bundling.sha384(src); } await Promise.all(writePromises); return sizeInfo; diff --git a/tools/build_cdn.js b/tools/build_cdn.js index 9cc3463ea2..5ca6dc927b 100644 --- a/tools/build_cdn.js +++ b/tools/build_cdn.js @@ -57,7 +57,7 @@ async function buildCDN(options) { if (options.esm) { mkdir("es"); await fs.writeFile(`${process.env.BUILD_DIR}/es/package.json`, `{ "type": "module" }`); - esmCoreSize = await buildCore("core", [], {minify: options.minify, format: "es"}); + esmCoreSize = await buildCore("core", [], { minify: options.minify, format: "es" }); esmCommonSize = await buildCore("highlight", embedLanguages, { minify: options.minify, format: "es" }); } shas = { @@ -157,7 +157,7 @@ async function buildDistributable(language, options) { await fs.mkdir(distDir, { recursive: true }); await fs.writeFile(path.join(language.moduleDir, "dist", filename), language.minified); if (options.esm) { - await fs.writeFile(path.join(language.moduleDir, "dist", filename.replace(".min.js",".es.min.js")), language.minifiedESM); + await fs.writeFile(path.join(language.moduleDir, "dist", filename.replace(".min.js", ".es.min.js")), language.minifiedESM); } } diff --git a/tools/build_node.js b/tools/build_node.js index 9dcc8579b5..d22c2b4e05 100644 --- a/tools/build_node.js +++ b/tools/build_node.js @@ -1,29 +1,29 @@ const fs = require("fs").promises; const fss = require("fs"); -const config = require("./build_config"); +const config = require("./build_config.js"); const glob = require("glob-promise"); -const { getLanguages } = require("./lib/language"); -const { install, mkdir, installCleanCSS } = require("./lib/makestuff"); -const { filter } = require("./lib/dependencies"); +const { getLanguages } = require("./lib/language.js"); +const { install, mkdir, installCleanCSS } = require("./lib/makestuff.js"); +const { filter } = require("./lib/dependencies.js"); const { rollupWrite } = require("./lib/bundling.js"); const log = (...args) => console.log(...args); // https://nodejs.org/api/packages.html#packages_writing_dual_packages_while_avoiding_or_minimizing_hazards async function buildESMStub(name) { const code = - `// https://nodejs.org/api/packages.html#packages_writing_dual_packages_while_avoiding_or_minimizing_hazards\n` + - `import HighlightJS from '../lib/${name}.js';\n` + - `export { HighlightJS };\n` + - `export default HighlightJS;\n`; + `// https://nodejs.org/api/packages.html#packages_writing_dual_packages_while_avoiding_or_minimizing_hazards\n` + + `import HighlightJS from '../lib/${name}.js';\n` + + `export { HighlightJS };\n` + + `export default HighlightJS;\n`; await fs.writeFile(`${process.env.BUILD_DIR}/es/${name}.js`, code); } async function buildCJSIndex(name, languages) { const header = "var hljs = require('./core');"; const footer = - `hljs.HighlightJS = hljs\n` + - `hljs.default = hljs\n` + - `module.exports = hljs;`; + `hljs.HighlightJS = hljs\n` + + `hljs.default = hljs\n` + + `module.exports = hljs;`; const registration = languages.map((lang) => { const require = `require('./languages/${lang.name}')`; @@ -57,7 +57,8 @@ async function buildNodeLanguage(language, options) { if (options.esm) { await fs.writeFile(`${process.env.BUILD_DIR}/es/languages/${language.name}.js.js`, ES_STUB.replace(/%%%%/g, language.name)); - await rollupWrite(input, {...output, + await rollupWrite(input, { + ...output, format: "es", file: output.file.replace("/lib/", "/es/") }); @@ -108,7 +109,7 @@ const generatePackageExports = () => ({ "./lib/languages/*": dual("./lib/languages/*.js"), "./scss/*": "./scss/*", "./styles/*": "./styles/*", - "./types/*": "./types/*", + "./types/*": "./types/*" }); function buildPackageJSON(options) { const packageJson = require("../package.json"); diff --git a/tools/checkAutoDetect.js b/tools/checkAutoDetect.js index 5b101672fb..0a725985a8 100755 --- a/tools/checkAutoDetect.js +++ b/tools/checkAutoDetect.js @@ -1,16 +1,16 @@ #!/usr/bin/env node 'use strict'; -let fs = require('fs') -let hljs = require('../build'); -let path = require('path'); -let utility = require('../test/utility'); -let Table = require('cli-table'); -let colors = require('colors/safe'); +const fs = require('fs'); +const hljs = require('../build.js'); +const path = require('path'); +const utility = require('../test/utility.js'); +const Table = require('cli-table'); +const colors = require('colors/safe.js'); -let resultTable = new Table({ - head: ['expected', 'actual', 'score', '2nd best', 'score','info'], - colWidths: [20,20,10,20,10,20], +const resultTable = new Table({ + head: ['expected', 'actual', 'score', '2nd best', 'score', 'info'], + colWidths: [20, 20, 10, 20, 10, 20], style: { head: ['grey'] } @@ -24,8 +24,8 @@ function testAutoDetection(language, index, languages) { return fs.readFileSync(filename, 'utf-8'); }) .forEach(function(content) { - const expected = language, - actual = hljs.highlightAuto(content); + const expected = language; + const actual = hljs.highlightAuto(content); if (actual.language !== expected && actual.secondBest.language !== expected) { return resultTable.push([ expected, @@ -45,7 +45,7 @@ function testAutoDetection(language, index, languages) { ]); } // equal relevance is flagged - if (actual.relevance == actual.secondBest.relevance) { + if (actual.relevance === actual.secondBest.relevance) { return resultTable.push([ expected, actual.language, @@ -68,18 +68,16 @@ if (process.env.ONLY_LANGUAGES) { console.log('Checking auto-highlighting for ' + colors.grey(languages.length) + ' languages...'); languages.forEach((lang, index) => { if (index % 60 === 0) { console.log(""); } - testAutoDetection(lang) + testAutoDetection(lang); process.stdout.write("."); }); -console.log("\n") +console.log("\n"); if (resultTable.length === 0) { - console.log(colors.green('SUCCESS') + ' - ' + colors.green(languages.length) + ' of ' + colors.gray(languages.length) + ' languages passed auto-highlight check!') + console.log(colors.green('SUCCESS') + ' - ' + colors.green(languages.length) + ' of ' + colors.gray(languages.length) + ' languages passed auto-highlight check!'); } else { console.log( - colors.red('ISSUES') + ' - ' + colors.red(resultTable.length) + ' of ' + colors.gray(languages.length) + ' languages have potential issues.' + - '\n' + - resultTable.toString()); + colors.red('ISSUES') + ' - ' + colors.red(resultTable.length) + ' of ' + colors.gray(languages.length) + ' languages have potential issues.' + + '\n' + + resultTable.toString()); } - - diff --git a/tools/checkTheme.js b/tools/checkTheme.js index 09f72f2245..e40c391ff5 100755 --- a/tools/checkTheme.js +++ b/tools/checkTheme.js @@ -2,7 +2,6 @@ const fs = require("fs"); const css = require("css"); -const { match } = require("assert"); require("colors"); const CODE = { @@ -166,19 +165,19 @@ function check_group(group, rules) { }); - let doesNotSupport = has_rules.map(x => x[1]).includes(false); - let skipped = has_rules.find(x => x[2]); + const doesNotSupport = has_rules.map(x => x[1]).includes(false); + const skipped = has_rules.find(x => x[2]); if (doesNotSupport || skipped) { console.log(group.name.yellow); if (doesNotSupport) { console.log(`- Theme does not fully support.`.brightMagenta); } - has_rules.filter(x => !x[1]).forEach(([scope,_]) => { + has_rules.filter(x => !x[1]).forEach(([scope, _]) => { const selector = scopeToSelector(scope); console.log(`- scope ${scope.cyan} is not highlighted\n (css: ${selector.green})`); }); - has_rules.filter(x => x[2]).forEach(([scope,_]) => { + has_rules.filter(x => x[2]).forEach(([scope, _]) => { console.log(` - scope ${scope.cyan} [purposely] un-highlighted.`.cyan); }); console.log(); diff --git a/tools/lib/bundling.js b/tools/lib/bundling.js index 1ca11a71c6..55360c6ee9 100644 --- a/tools/lib/bundling.js +++ b/tools/lib/bundling.js @@ -1,8 +1,8 @@ -const rollup = require('rollup') +const rollup = require('rollup'); const crypto = require("crypto"); async function rollupCode(inputOptions, outputOptions) { - const output = await generate(inputOptions, outputOptions) + const output = await generate(inputOptions, outputOptions); return output[0].code; } diff --git a/tools/lib/dependencies.js b/tools/lib/dependencies.js index edc621adf7..c2201d3396 100644 --- a/tools/lib/dependencies.js +++ b/tools/lib/dependencies.js @@ -6,20 +6,19 @@ const DependencyResolver = require('dependency-resolver'); * * @param {array} languages list of languages to be reordered * @returns {array} ordered list of languages -*/ - + */ const reorderDependencies = (languages) => { - let resolver = new DependencyResolver(); - for (let lang of languages) { + const resolver = new DependencyResolver(); + for (const lang of languages) { resolver.add(lang.name); - for (let required of lang.requires) { + for (const required of lang.requires) { resolver.setDependency(lang.name, required); } } return resolver.sort().map((name) => - languages.find((l) => l.name == name) + languages.find((l) => l.name === name) ); -} +}; /** * Filters languages by group (common, etc) @@ -28,14 +27,13 @@ const reorderDependencies = (languages) => { * * @param {array} languages full list of languages * @returns {array} filtered list -*/ - + */ const languagesByGroup = (languages, groupIdentifier) => { - let groupName = groupIdentifier.replace(":",""); + const groupName = groupIdentifier.replace(":", ""); return languages.filter((el) => el.categories.includes(groupName)); -} +}; // :common is a group identifier, "common" is the group name -const isGroup = (id) => id[0] == ":" +const isGroup = (id) => id[0] === ":"; /** @@ -48,39 +46,36 @@ const isGroup = (id) => id[0] == ":" * @param {array} includes - which languages or groups to include * example: ":common elixir ruby" * @returns {array} filtered list if languages -*/ + */ const filter = (allLanguages, includes) => { - if (includes==undefined || includes.length==0) - return reorderDependencies(allLanguages); + if (!includes || includes.length === 0) { return reorderDependencies(allLanguages); } let languages = []; - for (let item of includes) { + for (const item of includes) { if (isGroup(item)) { - languages = languages.concat(languagesByGroup(allLanguages, item)) + languages = languages.concat(languagesByGroup(allLanguages, item)); } else { - let languageName = item; - let found = allLanguages.find((el) => el.name == languageName ) - if (found) - languages.push(found) - else { - console.error(`[ERROR] Language '${languageName}' could not be found.`) - process.exit(1) + const languageName = item; + const found = allLanguages.find((el) => el.name === languageName); + if (found) { languages.push(found); } else { + console.error(`[ERROR] Language '${languageName}' could not be found.`); + process.exit(1); } } } // resolve requires - for (let lang of languages) { + for (const lang of languages) { lang.requires.forEach(needed => { - if (!languages.find((el) => el.name == needed)) { - console.info(`[INFO] Adding ${needed}... ${lang.name} requires ${needed}.`) - languages.push(allLanguages.find((el) => el.name == needed)) + if (!languages.find((el) => el.name === needed)) { + console.info(`[INFO] Adding ${needed}... ${lang.name} requires ${needed}.`); + languages.push(allLanguages.find((el) => el.name === needed)); } }); } // make sure our dependencies are in the correct order return reorderDependencies(languages); -} +}; -module.exports = { reorderDependencies, filter } +module.exports = { reorderDependencies, filter }; diff --git a/tools/lib/language.js b/tools/lib/language.js index 3a1c20c978..8da727e101 100644 --- a/tools/lib/language.js +++ b/tools/lib/language.js @@ -1,37 +1,35 @@ -const fs = require("fs") -const fsProm = require("fs").promises +const fs = require("fs"); const Terser = require("terser"); -const glob = require("glob") -const path = require("path") -const build_config = require("../build_config") +const glob = require("glob"); +const path = require("path"); +const build_config = require("../build_config.js"); -const packageJSON = require("../../package.json") -const REQUIRES_REGEX = /\/\*.*?Requires: (.*?)\r?\n/s -const CATEGORY_REGEX = /\/\*.*?Category: (.*?)\r?\n/s -const LANGUAGE_REGEX = /\/\*.*?Language: (.*?)\r?\n/s -const {rollupCode} = require("./bundling.js") -const { getThirdPartyPackages } = require("./external_language") +const packageJSON = require("../../package.json"); +const REQUIRES_REGEX = /\/\*.*?Requires: (.*?)\r?\n/s; +const CATEGORY_REGEX = /\/\*.*?Category: (.*?)\r?\n/s; +const LANGUAGE_REGEX = /\/\*.*?Language: (.*?)\r?\n/s; +const { rollupCode } = require("./bundling.js"); +const { getThirdPartyPackages } = require("./external_language.js"); class Language { - constructor(name, path) { - this.name = name - this.prettyName = name - this.requires = [] - this.categories = [] - this.third_party = false + this.name = name; + this.prettyName = name; + this.requires = []; + this.categories = []; + this.third_party = false; // compiled code - this.module = "" - this.minified = "" + this.module = ""; + this.minified = ""; - this.path = path - this.data = fs.readFileSync(path, {encoding: "utf8"}) - this.loadMetadata() + this.path = path; + this.data = fs.readFileSync(path, { encoding: "utf8" }); + this.loadMetadata(); } async compile(options) { - await compileLanguage(this,options); + await compileLanguage(this, options); return this; } @@ -39,8 +37,7 @@ class Language { if (this._sample) return this._sample; this._sample = ""; - if (fs.existsSync(this.samplePath)) - this._sample = fs.readFileSync(this.samplePath, {encoding: "utf8"}); + if (fs.existsSync(this.samplePath)) { this._sample = fs.readFileSync(this.samplePath, { encoding: "utf8" }); } return this._sample; } @@ -48,38 +45,34 @@ class Language { if (this.moduleDir) { // this is the 'extras' case. return `${this.moduleDir}/test/detect/${this.name}/default.txt`; - } - else { + } else { // this is the common/built-in case. return `./test/detect/${this.name}/default.txt`; } } loadMetadata() { - var requiresMatch = REQUIRES_REGEX.exec(this.data) - var categoryMatch = CATEGORY_REGEX.exec(this.data) - var languageMatch = LANGUAGE_REGEX.exec(this.data) + const requiresMatch = REQUIRES_REGEX.exec(this.data); + const categoryMatch = CATEGORY_REGEX.exec(this.data); + const languageMatch = LANGUAGE_REGEX.exec(this.data); - if (requiresMatch) - this.requires = requiresMatch[1].split(", ").map((n) => n.replace(".js","")) + if (requiresMatch) { this.requires = requiresMatch[1].split(", ").map((n) => n.replace(".js", "")); } - if (categoryMatch) - this.categories = categoryMatch[1].split(/,\s?/) + if (categoryMatch) { this.categories = categoryMatch[1].split(/,\s?/); } - if (languageMatch) - this.prettyName = languageMatch[1] + if (languageMatch) { this.prettyName = languageMatch[1]; } } static fromFile(filename) { return new Language( - path.basename(filename).replace(".js",""), + path.basename(filename).replace(".js", ""), filename ); } } -async function compileLanguage (language, options) { +async function compileLanguage(language, options) { const HEADER = `/*! \`${language.name}\` grammar compiled for Highlight.js ${packageJSON.version} */`; // TODO: cant we use the source we already have? @@ -105,14 +98,14 @@ async function compileLanguage (language, options) { } async function getLanguages() { - let languages = []; + const languages = []; glob.sync("./src/languages/*.js").forEach((file) => { languages.push(Language.fromFile(file)); }); - let extraPackages = await getThirdPartyPackages(); - for (let ext of extraPackages) { - for (let file of ext.files) { - let l = Language.fromFile(file); + const extraPackages = await getThirdPartyPackages(); + for (const ext of extraPackages) { + for (const file of ext.files) { + const l = Language.fromFile(file); l.loader = ext.loader; l.third_party = true; l.moduleDir = ext.dir; diff --git a/tools/lib/makestuff.js b/tools/lib/makestuff.js index 44e0035c25..9f3f7da707 100644 --- a/tools/lib/makestuff.js +++ b/tools/lib/makestuff.js @@ -2,8 +2,8 @@ const fs = require("fs"); const CleanCSS = require('clean-css'); const path = require('path'); const _ = require('lodash'); -const config = require("../build_config"); const del = require('del'); +const config = require("../build_config.js"); async function clean(directory) { del.sync([directory]); diff --git a/tools/perf.js b/tools/perf.js index 0c31b59b44..3c37ead0a1 100755 --- a/tools/perf.js +++ b/tools/perf.js @@ -20,7 +20,7 @@ const timeTest = (name, func) => { func(); const t1 = performance.now(); console.log(` done! [${((t1 - t0) / 1000).toFixed(2)}s elapsed]`); -} +}; const oneLanguageMarkupTests = (lang) => { for (let i = 0; i < 50; i++) { @@ -52,10 +52,10 @@ const globalCheckAutoDetect = () => { }; const highlightFile = (lang) => { - const source = fs.readFileSync(`./tools/sample_files/${lang}.txt`, { encoding:'utf8' }); - const hljs = require('../build'); + const source = fs.readFileSync(`./tools/sample_files/${lang}.txt`, { encoding: 'utf8' }); + const hljs = require('../build.js'); for (let i = 0; i < 2000; i++) { - hljs.highlight(source, {language: lang}); + hljs.highlight(source, { language: lang }); } }; From 8c00856391ba0120981543fb5b4660af0b2ded93 Mon Sep 17 00:00:00 2001 From: Bradley Mackey Date: Tue, 2 Nov 2021 05:48:47 +0000 Subject: [PATCH 053/227] enh(swift) add SE-0290 unavailability condition (#3382) --- CHANGES.md | 2 ++ src/languages/lib/kws_swift.js | 4 ++-- src/languages/swift.js | 2 +- test/markup/swift/attributes.expect.txt | 1 - test/markup/swift/attributes.txt | 1 - test/markup/swift/availability.expect.txt | 11 +++++++++++ test/markup/swift/availability.txt | 11 +++++++++++ 7 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 test/markup/swift/availability.expect.txt create mode 100644 test/markup/swift/availability.txt diff --git a/CHANGES.md b/CHANGES.md index ef24a6123c..0036c3a5fa 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,8 +3,10 @@ Grammars: - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] +- enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] [Richard Gibson]: https://github.com/gibson042 +[Bradley Mackey]: https://github.com/bradleymackey ## Version 11.3.1 diff --git a/src/languages/lib/kws_swift.js b/src/languages/lib/kws_swift.js index d54e6ed3a7..be06394ba8 100644 --- a/src/languages/lib/kws_swift.js +++ b/src/languages/lib/kws_swift.js @@ -141,7 +141,7 @@ export const precedencegroupKeywords = [ ]; // Keywords that start with a number sign (#). -// #available is handled separately. +// #(un)available is handled separately. export const numberSignKeywords = [ '#colorLiteral', '#column', @@ -307,7 +307,7 @@ export const keywordAttributes = [ 'usableFromInline' ]; -// Contextual keywords used in @available and #available. +// Contextual keywords used in @available and #(un)available. export const availabilityKeywords = [ 'iOS', 'iOSApplicationExtension', diff --git a/src/languages/swift.js b/src/languages/swift.js index 0adc30d957..15fb39c9e9 100644 --- a/src/languages/swift.js +++ b/src/languages/swift.js @@ -221,7 +221,7 @@ export default function(hljs) { // https://docs.swift.org/swift-book/ReferenceManual/Attributes.html const AVAILABLE_ATTRIBUTE = { - match: /(@|#)available/, + match: /(@|#(un)?)available/, className: "keyword", starts: { contains: [ diff --git a/test/markup/swift/attributes.expect.txt b/test/markup/swift/attributes.expect.txt index 885e678a6b..22d4e60978 100644 --- a/test/markup/swift/attributes.expect.txt +++ b/test/markup/swift/attributes.expect.txt @@ -1,4 +1,3 @@ -@available(iOS 14, deprecated: "reason", *) @convention(swift) @objc @objc(name) diff --git a/test/markup/swift/attributes.txt b/test/markup/swift/attributes.txt index 24fe9a41bf..8628043613 100644 --- a/test/markup/swift/attributes.txt +++ b/test/markup/swift/attributes.txt @@ -1,4 +1,3 @@ -@available(iOS 14, deprecated: "reason", *) @convention(swift) @objc @objc(name) diff --git a/test/markup/swift/availability.expect.txt b/test/markup/swift/availability.expect.txt new file mode 100644 index 0000000000..7435c86838 --- /dev/null +++ b/test/markup/swift/availability.expect.txt @@ -0,0 +1,11 @@ +#available() +#available(iOS 15.0, *) +@available() +@available(iOS 15.0, *) +@available(iOS 14, deprecated: "reason", *) + +#unavailable() +#unavailable(iOS 15.0, *) +// not a keyword +@unavailable() +@unavailable(iOS 15.0, *) diff --git a/test/markup/swift/availability.txt b/test/markup/swift/availability.txt new file mode 100644 index 0000000000..87cd134e35 --- /dev/null +++ b/test/markup/swift/availability.txt @@ -0,0 +1,11 @@ +#available() +#available(iOS 15.0, *) +@available() +@available(iOS 15.0, *) +@available(iOS 14, deprecated: "reason", *) + +#unavailable() +#unavailable(iOS 15.0, *) +// not a keyword +@unavailable() +@unavailable(iOS 15.0, *) From 998e25e41b030f5d949accd6fa9b65a990fc484d Mon Sep 17 00:00:00 2001 From: jaacko-torus Date: Tue, 2 Nov 2021 00:50:41 -0500 Subject: [PATCH 054/227] fixed type of `either` in `src/lib/regex.js` (#3374) --- src/lib/regex.js | 4 +++- types/index.d.ts | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/regex.js b/src/lib/regex.js index ec5c6bb87f..da6cc457c8 100644 --- a/src/lib/regex.js +++ b/src/lib/regex.js @@ -65,11 +65,13 @@ function stripOptionsFromArgs(args) { } } +/** @typedef { {capture?: boolean} } RegexEitherOptions */ + /** * Any of the passed expresssions may match * * Creates a huge this | this | that | that match - * @param {(RegExp | string | { capture?: boolean })[]} args + * @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args * @returns {string} */ export function either(...args) { diff --git a/types/index.d.ts b/types/index.d.ts index b89fffd52b..c1ff73b12d 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -23,6 +23,11 @@ declare module 'highlight.js' { install: (vue: any) => void } + // perhaps make this an interface? + type RegexEitherOptions = { + capture?: boolean + } + interface PublicApi { highlight: (codeOrLanguageName: string, optionsOrCode: string | HighlightOptions, ignoreIllegals?: boolean) => HighlightResult highlightAuto: (code: string, languageSubset?: string[]) => AutoHighlightResult @@ -47,7 +52,7 @@ declare module 'highlight.js' { regex: { concat: (...args: (RegExp | string)[]) => string, lookahead: (re: RegExp | string) => string, - either: (...args: (RegExp | string | { capture?: boolean })[]) => string, + either: (...args: (RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]) => string, optional: (re: RegExp | string) => string, anyNumberOfTimes: (re: RegExp | string) => string } From 7eb21e5524b1db3de76ba077d4d6034b35e11945 Mon Sep 17 00:00:00 2001 From: Jan Pilzer Date: Tue, 2 Nov 2021 16:12:36 -0700 Subject: [PATCH 055/227] (docs) make demo page more keyboard accessible (#3371) --- demo/demo.js | 16 ++++++++++++---- demo/index.html | 6 +++--- demo/style.css | 13 ++++++++----- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/demo/demo.js b/demo/demo.js index 079080e67a..49f6bcef1f 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -1,8 +1,10 @@ hljs.debugMode(); hljs.highlightAll(); -document.querySelectorAll(".categories > li").forEach((category) => { +document.querySelectorAll(".categories li a").forEach((category) => { category.addEventListener("click", (event) => { + event.preventDefault(); + const current = document.querySelector(".categories .current"); const currentCategory = current.dataset.category; const nextCategory = event.target.dataset.category; @@ -23,15 +25,21 @@ document.querySelectorAll(".categories > li").forEach((category) => { }); }); -document.querySelectorAll(".styles > li").forEach((style) => { +document.querySelectorAll(".styles li a").forEach((style) => { style.addEventListener("click", (event) => { + event.preventDefault(); + const current = document.querySelector(".styles .current"); const currentStyle = current.textContent; const nextStyle = event.target.textContent; if (currentStyle !== nextStyle) { - document.querySelector(`link[title="${nextStyle}"]`).removeAttribute("disabled"); - document.querySelector(`link[title="${currentStyle}"]`).setAttribute("disabled", "disabled"); + document + .querySelector(`link[title="${nextStyle}"]`) + .removeAttribute("disabled"); + document + .querySelector(`link[title="${currentStyle}"]`) + .setAttribute("disabled", "disabled"); current.classList.remove("current"); event.target.classList.add("current"); diff --git a/demo/index.html b/demo/index.html index f7ee27df84..ad6371748c 100644 --- a/demo/index.html +++ b/demo/index.html @@ -23,14 +23,14 @@

highlight.js demo

Language Categories

Themes

    -
  • Default
  • +
  • Default
  • <% styles.forEach(({name}) => {%> -
  • <%= name %>
  • +
  • <%= name %>
  • <% }); %>
diff --git a/demo/style.css b/demo/style.css index 9073c14c24..e23f06d2e7 100644 --- a/demo/style.css +++ b/demo/style.css @@ -102,16 +102,19 @@ aside ul::-webkit-scrollbar-thumb:active { background: #5d3333; } -aside li { - padding: 1px 1em; - cursor: pointer; +aside ul a { + display: block; + padding: 1px 0.5em 1px 1em; + text-decoration: none; } -aside li:hover { +aside ul a:focus, +aside ul a:hover { background: #500; + outline: none; } -aside li.current:before { +aside ul a.current:before { content: "▶"; font-size: smaller; position: absolute; From c100a39fa1f9f6e731f00ab7725453c1680db234 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 2 Nov 2021 23:25:25 -0400 Subject: [PATCH 056/227] (docs) update fiddle links --- .github/ISSUE_TEMPLATE/1_incorrect-syntax-highlighting.md | 2 +- CONTRIBUTING.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/1_incorrect-syntax-highlighting.md b/.github/ISSUE_TEMPLATE/1_incorrect-syntax-highlighting.md index 0083dfb43d..2da7594b42 100644 --- a/.github/ISSUE_TEMPLATE/1_incorrect-syntax-highlighting.md +++ b/.github/ISSUE_TEMPLATE/1_incorrect-syntax-highlighting.md @@ -24,7 +24,7 @@ Please specify exactly *which* language grammar you are using to highlight (`pyt Please include plain text examples of the code that fails to highlight properly or can reproduce the bug you are seeing. If you attach a screenshot PLEASE also provide the actually code that we can copy/paste if necessary to help resolve the issue. A jsfiddle can sometimes be even better. You can fork an example test case: -https://jsfiddle.net/ajoshguy/gfzujpyt/ +https://jsfiddle.net/ajoshguy/cjhvre2k/ --> diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c67163c962..7c7c60b823 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,7 +66,7 @@ If you wish we supported a language we don't, first read [On requesting new lang ## Reporting Issues If you find a bug or think of an improvement, feel free to [open an issue](https://github.com/highlightjs/highlight.js/issues/new/choose). -- If you've found a language highlighting issue, you can use [this JSFiddle](https://jsfiddle.net/ajoshguy/2bmdswn6/) to create a test case. +- If you've found a language highlighting issue, you can use [this JSFiddle](https://jsfiddle.net/ajoshguy/cjhvre2k/) to create a test case. ## Fixing Issues (PRs) From 99e05df083dff1feefd4bce278785d1b2ea4b897 Mon Sep 17 00:00:00 2001 From: Bradley Mackey Date: Wed, 3 Nov 2021 08:34:56 +0000 Subject: [PATCH 057/227] enh(java) add `sealed` and `non-sealed` keywords (#3386) --- CHANGES.md | 1 + src/languages/java.js | 8 +++++++- test/markup/java/titles.expect.txt | 8 ++++++++ test/markup/java/titles.txt | 8 ++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 0036c3a5fa..5f77890137 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ Grammars: - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] +- enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey diff --git a/src/languages/java.js b/src/languages/java.js index 17e73e66ea..8c55aae215 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -73,7 +73,8 @@ export default function(hljs) { 'module', 'requires', 'exports', - 'do' + 'do', + 'sealed' ]; const BUILT_INS = [ @@ -179,6 +180,11 @@ export default function(hljs) { 3: "title.class" } }, + { + // Exceptions for hyphenated keywords + match: /non-sealed/, + scope: "keyword" + }, { begin: [ JAVA_IDENT_RE, diff --git a/test/markup/java/titles.expect.txt b/test/markup/java/titles.expect.txt index 571bd0fe51..2043511c9a 100644 --- a/test/markup/java/titles.expect.txt +++ b/test/markup/java/titles.expect.txt @@ -8,3 +8,11 @@ } } } + +sealed interface Command permits LoginCommand { + void run(); +} + +non-sealed abstract class UserPluginCommand extends Command { + void runAsUser(); +} diff --git a/test/markup/java/titles.txt b/test/markup/java/titles.txt index c43f696c92..a4d553fbb6 100644 --- a/test/markup/java/titles.txt +++ b/test/markup/java/titles.txt @@ -8,3 +8,11 @@ public class Greet { } } } + +sealed interface Command permits LoginCommand { + void run(); +} + +non-sealed abstract class UserPluginCommand extends Command { + void runAsUser(); +} From 1d8031b2a59f6d9a5f9704857d953b8af8b7cf89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ebbinghaus?= Date: Tue, 9 Nov 2021 15:48:16 +0100 Subject: [PATCH 058/227] fix(clojure) comment macro should not be `comment` scope (#3395) --- CHANGES.md | 2 ++ src/languages/clojure.js | 1 - test/markup/clojure/comment-macro.expect.txt | 2 ++ test/markup/clojure/comment-macro.txt | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 test/markup/clojure/comment-macro.expect.txt create mode 100644 test/markup/clojure/comment-macro.txt diff --git a/CHANGES.md b/CHANGES.md index 5f77890137..b43a548aee 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,9 +5,11 @@ Grammars: - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] +- fix(clojure) `comment` macro catches more than it should [Björn Ebbinghaus][] [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey +[Björn Ebbinghaus]: https://github.com/MrEbbinghaus ## Version 11.3.1 diff --git a/src/languages/clojure.js b/src/languages/clojure.js index c34d0527a6..34c9ff18af 100644 --- a/src/languages/clojure.js +++ b/src/languages/clojure.js @@ -132,7 +132,6 @@ export default function(hljs) { }; LIST.contains = [ - hljs.COMMENT('comment', ''), GLOBAL, NAME, BODY diff --git a/test/markup/clojure/comment-macro.expect.txt b/test/markup/clojure/comment-macro.expect.txt new file mode 100644 index 0000000000..55260ddbb3 --- /dev/null +++ b/test/markup/clojure/comment-macro.expect.txt @@ -0,0 +1,2 @@ +(comment "comment is a macro that emits no code. It can contain clojure code in itself.") +(comment-and-something "This is a valid function name") \ No newline at end of file diff --git a/test/markup/clojure/comment-macro.txt b/test/markup/clojure/comment-macro.txt new file mode 100644 index 0000000000..8ebcefc043 --- /dev/null +++ b/test/markup/clojure/comment-macro.txt @@ -0,0 +1,2 @@ +(comment "comment is a macro that emits no code. It can contain clojure code in itself.") +(comment-and-something "This is a valid function name") \ No newline at end of file From 0f73808b50249e7f4aa75304da0ba6b4e2387b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ebbinghaus?= Date: Wed, 10 Nov 2021 23:57:33 +0100 Subject: [PATCH 059/227] fix(clojure) Several issues with Clojure highlighting (#3397) - fix(clojure) `$` in symbol breaks highlighting - fix(clojure) Add complete regex for number detection - enh(clojure) Add character mode for character literals - fix(clojure) Inconsistent namespaced map highlighting - enh(clojure) Add `regex` mode to regex literal - fix(clojure) Remove inconsistent/broken highlighting for metadata - enh(clojure) Add `punctuation` mode for commas. --- CHANGES.md | 10 ++- src/languages/clojure.js | 56 ++++++++++----- test/markup/clojure/character.expect.txt | 5 ++ test/markup/clojure/character.txt | 5 ++ test/markup/clojure/deps_edn.expect.txt | 18 ++--- .../clojure/globals_definition.expect.txt | 13 ++-- test/markup/clojure/globals_definition.txt | 7 +- test/markup/clojure/hint_col.expect.txt | 34 --------- test/markup/clojure/hint_col.txt | 34 --------- test/markup/clojure/number.expect.txt | 69 +++++++++++++++++++ test/markup/clojure/number.txt | 69 +++++++++++++++++++ .../markup/clojure/symbols-numbers.expect.txt | 3 + test/markup/clojure/symbols-numbers.txt | 3 + 13 files changed, 225 insertions(+), 101 deletions(-) create mode 100644 test/markup/clojure/character.expect.txt create mode 100644 test/markup/clojure/character.txt delete mode 100644 test/markup/clojure/hint_col.expect.txt delete mode 100644 test/markup/clojure/hint_col.txt create mode 100644 test/markup/clojure/number.expect.txt create mode 100644 test/markup/clojure/number.txt diff --git a/CHANGES.md b/CHANGES.md index b43a548aee..da9423a0c6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,15 @@ Grammars: - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] -- fix(clojure) `comment` macro catches more than it should [Björn Ebbinghaus][] +- fix(clojure) Several issues with Clojure highlighting (#3397) [Björn Ebbinghaus][] + - fix(clojure) `comment` macro catches more than it should (#3395) + - fix(clojure) `$` in symbol breaks highlighting + - fix(clojure) Add complete regex for number detection + - enh(clojure) Add character mode for character literals + - fix(clojure) Inconsistent namespaced map highlighting + - enh(clojure) Add `regex` mode to regex literal + - fix(clojure) Remove inconsistent/broken highlighting for metadata + - enh(clojure) Add `punctuation` mode for commas. [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey diff --git a/src/languages/clojure.js b/src/languages/clojure.js index 34c9ff18af..34a4dc7fe4 100644 --- a/src/languages/clojure.js +++ b/src/languages/clojure.js @@ -8,8 +8,8 @@ Category: lisp /** @type LanguageFn */ export default function(hljs) { - const SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\''; - const SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*'; + const SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&\''; + const SYMBOL_RE = '[#]?[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:$#]*'; const globals = 'def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord'; const keywords = { $pattern: SYMBOL_RE, @@ -45,20 +45,44 @@ export default function(hljs) { 'lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize' }; - const SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?'; - const SYMBOL = { begin: SYMBOL_RE, relevance: 0 }; const NUMBER = { - className: 'number', - begin: SIMPLE_NUMBER_RE, - relevance: 0 + scope: 'number', + relevance: 0, + variants: [ + {match: /[-+]?0[xX][0-9a-fA-F]+N?/}, // hexadecimal // 0x2a + {match: /[-+]?0[0-7]+N?/}, // octal // 052 + {match: /[-+]?[1-9][0-9]?[rR][0-9a-zA-Z]+N?/}, // variable radix from 2 to 36 // 2r101010, 8r52, 36r16 + {match: /[-+]?[0-9]+\/[0-9]+N?/}, // ratio // 1/2 + {match: /[-+]?[0-9]+((\.[0-9]*([eE][+-]?[0-9]+)?M?)|([eE][+-]?[0-9]+M?|M))/}, // float // 0.42 4.2E-1M 42E1 42M + {match: /[-+]?([1-9][0-9]*|0)N?/}, // int (don't match leading 0) // 42 42N + ] }; + const CHARACTER = { + scope: 'character', + variants: [ + {match: /\\o[0-3]?[0-7]{1,2}/}, // Unicode Octal 0 - 377 + {match: /\\u[0-9a-fA-F]{4}/}, // Unicode Hex 0000 - FFFF + {match: /\\(newline|space|tab|formfeed|backspace|return)/}, // special characters + {match: /\\\S/, relevance: 0} // any non-whitespace char + ] + } + const REGEX = { + scope: 'regex', + begin: /#"/, + end: /"/ + } const STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, { illegal: null }); + const COMMA = { + scope: 'punctuation', + match: /,/, + relevance: 0 + } const COMMENT = hljs.COMMENT( ';', '$', @@ -71,15 +95,10 @@ export default function(hljs) { begin: /\b(true|false|nil)\b/ }; const COLLECTION = { - begin: '[\\[\\{]', + begin: "\\[|(#::?" + SYMBOL_RE + ")?\\{", end: '[\\]\\}]', relevance: 0 }; - const HINT = { - className: 'comment', - begin: '\\^' + SYMBOL_RE - }; - const HINT_COL = hljs.COMMENT('\\^\\{', '\\}'); const KEY = { className: 'symbol', begin: '[:]{1,2}' + SYMBOL_RE @@ -100,10 +119,11 @@ export default function(hljs) { starts: BODY }; const DEFAULT_CONTAINS = [ + COMMA, LIST, + CHARACTER, + REGEX, STRING, - HINT, - HINT_COL, COMMENT, KEY, COLLECTION, @@ -138,17 +158,17 @@ export default function(hljs) { ]; BODY.contains = DEFAULT_CONTAINS; COLLECTION.contains = DEFAULT_CONTAINS; - HINT_COL.contains = [ COLLECTION ]; return { name: 'Clojure', aliases: [ 'clj', 'edn' ], illegal: /\S/, contains: [ + COMMA, LIST, + CHARACTER, + REGEX, STRING, - HINT, - HINT_COL, COMMENT, KEY, COLLECTION, diff --git a/test/markup/clojure/character.expect.txt b/test/markup/clojure/character.expect.txt new file mode 100644 index 0000000000..1b7cf05082 --- /dev/null +++ b/test/markup/clojure/character.expect.txt @@ -0,0 +1,5 @@ +\A +\a +\formfeed +\u00DF +\o303 \ No newline at end of file diff --git a/test/markup/clojure/character.txt b/test/markup/clojure/character.txt new file mode 100644 index 0000000000..7cf4531ab9 --- /dev/null +++ b/test/markup/clojure/character.txt @@ -0,0 +1,5 @@ +\A +\a +\formfeed +\u00DF +\o303 \ No newline at end of file diff --git a/test/markup/clojure/deps_edn.expect.txt b/test/markup/clojure/deps_edn.expect.txt index fdedd183bd..9d36af63ad 100644 --- a/test/markup/clojure/deps_edn.expect.txt +++ b/test/markup/clojure/deps_edn.expect.txt @@ -1,14 +1,14 @@ -{:aliases {:export {:exec-fn stelcodes.dev-blog.generator/export}, - :repl {:extra-deps {cider/cider-nrepl {:mvn/version "0.25.2"}, - nrepl/nrepl {:mvn/version "0.8.3"}}, - :extra-paths ["dev"], +{:aliases {:export {:exec-fn stelcodes.dev-blog.generator/export}, + :repl {:extra-deps {cider/cider-nrepl {:mvn/version "0.25.2"}, + nrepl/nrepl {:mvn/version "0.8.3"}}, + :extra-paths ["dev"], :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]" - "--interactive"]}, - :webhook {:exec-fn stelcodes.dev-blog.webhook/listen}}, - :deps {http-kit/http-kit {:mvn/version "2.5.3"}, - org.clojure/clojure {:mvn/version "1.10.1"}, - stasis/stasis {:mvn/version "2.5.1"}}, + "--interactive"]}, + :webhook {:exec-fn stelcodes.dev-blog.webhook/listen}}, + :deps {http-kit/http-kit {:mvn/version "2.5.3"}, + org.clojure/clojure {:mvn/version "1.10.1"}, + stasis/stasis {:mvn/version "2.5.1"}}, :paths ["src" "resources"]} diff --git a/test/markup/clojure/globals_definition.expect.txt b/test/markup/clojure/globals_definition.expect.txt index e387a1b63c..93ce3c17a2 100644 --- a/test/markup/clojure/globals_definition.expect.txt +++ b/test/markup/clojure/globals_definition.expect.txt @@ -5,8 +5,8 @@ ; function (defn clojure-function [args] (let [string "multiline\nstring" - regexp #"regexp" - number 100,000 + regexp #"regexp" + number 100000 booleans [false true] keyword ::the-keyword] ;; this is comment @@ -14,12 +14,17 @@ (->> (list [vector] {:map map} #{'set}))))) +#:person{:first "Han" + :last "Solo" + :ship #:ship{:name "Millenium Falcon"}} +#::{:a 1, :b 2} + ; global (def some-var) ; another one (def alternative-var "132") ; defonce -(defonce ^:private another-var #"foo") +(defonce ^:private another-var #"foo") ; private function (defn- add [x y] (+ x y)) @@ -58,4 +63,4 @@ ;; create a couple shapes and get their area (def myCircle (Circle. 10)) -(def mySquare (Square. 5 11)) +(def mySquare (Square. 5 11)) \ No newline at end of file diff --git a/test/markup/clojure/globals_definition.txt b/test/markup/clojure/globals_definition.txt index 6faeee7942..fadd808156 100644 --- a/test/markup/clojure/globals_definition.txt +++ b/test/markup/clojure/globals_definition.txt @@ -6,7 +6,7 @@ (defn clojure-function [args] (let [string "multiline\nstring" regexp #"regexp" - number 100,000 + number 100000 booleans [false true] keyword ::the-keyword] ;; this is comment @@ -14,6 +14,11 @@ (->> (list [vector] {:map map} #{'set}))))) +#:person{:first "Han" + :last "Solo" + :ship #:ship{:name "Millenium Falcon"}} +#::{:a 1, :b 2} + ; global (def some-var) ; another one diff --git a/test/markup/clojure/hint_col.expect.txt b/test/markup/clojure/hint_col.expect.txt deleted file mode 100644 index cb833d9027..0000000000 --- a/test/markup/clojure/hint_col.expect.txt +++ /dev/null @@ -1,34 +0,0 @@ -(import [java.lang.annotation Retention RetentionPolicy Target ElementType] - [javax.xml.ws WebServiceRef WebServiceRefs]) - -(definterface Foo (foo [])) - -;; annotation on type -(deftype ^{Deprecated true - Retention RetentionPolicy/RUNTIME - javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] - javax.xml.ws.soap.Addressing {:enabled false :required true} - WebServiceRefs [(WebServiceRef {:name "fred" :type String}) - (WebServiceRef {:name "ethel" :mappedName "lucy"})]} - Bar [^int a - ;; on field - ^{:tag int - Deprecated true - Retention RetentionPolicy/RUNTIME - javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] - javax.xml.ws.soap.Addressing {:enabled false :required true} - WebServiceRefs [(WebServiceRef {:name "fred" :type String}) - (WebServiceRef {:name "ethel" :mappedName "lucy"})]} - b] - ;; on method - Foo (^{Deprecated true - Retention RetentionPolicy/RUNTIME - javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] - javax.xml.ws.soap.Addressing {:enabled false :required true} - WebServiceRefs [(WebServiceRef {:name "fred" :type String}) - (WebServiceRef {:name "ethel" :mappedName "lucy"})]} - foo [this] 42)) - -(seq (.getAnnotations Bar)) -(seq (.getAnnotations (.getField Bar "b"))) -(seq (.getAnnotations (.getMethod Bar "foo" nil))) diff --git a/test/markup/clojure/hint_col.txt b/test/markup/clojure/hint_col.txt deleted file mode 100644 index 9584dec9d0..0000000000 --- a/test/markup/clojure/hint_col.txt +++ /dev/null @@ -1,34 +0,0 @@ -(import [java.lang.annotation Retention RetentionPolicy Target ElementType] - [javax.xml.ws WebServiceRef WebServiceRefs]) - -(definterface Foo (foo [])) - -;; annotation on type -(deftype ^{Deprecated true - Retention RetentionPolicy/RUNTIME - javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] - javax.xml.ws.soap.Addressing {:enabled false :required true} - WebServiceRefs [(WebServiceRef {:name "fred" :type String}) - (WebServiceRef {:name "ethel" :mappedName "lucy"})]} - Bar [^int a - ;; on field - ^{:tag int - Deprecated true - Retention RetentionPolicy/RUNTIME - javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] - javax.xml.ws.soap.Addressing {:enabled false :required true} - WebServiceRefs [(WebServiceRef {:name "fred" :type String}) - (WebServiceRef {:name "ethel" :mappedName "lucy"})]} - b] - ;; on method - Foo (^{Deprecated true - Retention RetentionPolicy/RUNTIME - javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] - javax.xml.ws.soap.Addressing {:enabled false :required true} - WebServiceRefs [(WebServiceRef {:name "fred" :type String}) - (WebServiceRef {:name "ethel" :mappedName "lucy"})]} - foo [this] 42)) - -(seq (.getAnnotations Bar)) -(seq (.getAnnotations (.getField Bar "b"))) -(seq (.getAnnotations (.getMethod Bar "foo" nil))) diff --git a/test/markup/clojure/number.expect.txt b/test/markup/clojure/number.expect.txt new file mode 100644 index 0000000000..25bb636d60 --- /dev/null +++ b/test/markup/clojure/number.expect.txt @@ -0,0 +1,69 @@ +; integer +00 +42 ++42 +-42 + +; BigInt +42N +0N ++42N +-42N + +; octal +052 +00N ++052 +-00N + +; hex +0x2a +0x0N ++0x2a +-0x0N + +; radix +2r101010 +8r52 +16r2a +36r16 +-2r101010 ++36r16 + +; radix BigInt +2r101010N +8r52N +16r2aN +36r16N ++8r52N +-16r2aN + +;; ratios +1/2 +-1/2 ++123/224 + +;; floats +42.0 +-42.0 ++42.0 +42. ++42. +-42. + +; BigDecimal +42.0M +-42M +42.M +42M + +; with Exponent +42.0E2 +-42.0E+9 +42E-0 ++42E-0 + +42.0E2M +42E+9M +-42E+9M ++42.0E2M \ No newline at end of file diff --git a/test/markup/clojure/number.txt b/test/markup/clojure/number.txt new file mode 100644 index 0000000000..01a0374c09 --- /dev/null +++ b/test/markup/clojure/number.txt @@ -0,0 +1,69 @@ +; integer +00 +42 ++42 +-42 + +; BigInt +42N +0N ++42N +-42N + +; octal +052 +00N ++052 +-00N + +; hex +0x2a +0x0N ++0x2a +-0x0N + +; radix +2r101010 +8r52 +16r2a +36r16 +-2r101010 ++36r16 + +; radix BigInt +2r101010N +8r52N +16r2aN +36r16N ++8r52N +-16r2aN + +;; ratios +1/2 +-1/2 ++123/224 + +;; floats +42.0 +-42.0 ++42.0 +42. ++42. +-42. + +; BigDecimal +42.0M +-42M +42.M +42M + +; with Exponent +42.0E2 +-42.0E+9 +42E-0 ++42E-0 + +42.0E2M +42E+9M +-42E+9M ++42.0E2M \ No newline at end of file diff --git a/test/markup/clojure/symbols-numbers.expect.txt b/test/markup/clojure/symbols-numbers.expect.txt index 87595d111b..7813d22876 100644 --- a/test/markup/clojure/symbols-numbers.expect.txt +++ b/test/markup/clojure/symbols-numbers.expect.txt @@ -1 +1,4 @@ (def +x [(a 1) +2 -3.0 y-5]) +(System/getProperty "java.vm.version") +(.getEnclosingClass java.util.Map$Entry) +(java.util.Map$Entry. .getEnclosingClass) diff --git a/test/markup/clojure/symbols-numbers.txt b/test/markup/clojure/symbols-numbers.txt index 01e839b555..97c92bb562 100644 --- a/test/markup/clojure/symbols-numbers.txt +++ b/test/markup/clojure/symbols-numbers.txt @@ -1 +1,4 @@ (def +x [(a 1) +2 -3.0 y-5]) +(System/getProperty "java.vm.version") +(.getEnclosingClass java.util.Map$Entry) +(java.util.Map$Entry. .getEnclosingClass) \ No newline at end of file From f86713bf3f39018b52d4dcb6f41e054371d5ab66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ebbinghaus?= Date: Thu, 11 Nov 2021 20:03:44 +0100 Subject: [PATCH 060/227] Fix clojure regex mode not allowing backslash escape (#3399) --- src/languages/clojure.js | 3 ++- test/markup/clojure/globals_definition.expect.txt | 6 ++++++ test/markup/clojure/globals_definition.txt | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/languages/clojure.js b/src/languages/clojure.js index 34a4dc7fe4..a5565e0680 100644 --- a/src/languages/clojure.js +++ b/src/languages/clojure.js @@ -73,7 +73,8 @@ export default function(hljs) { const REGEX = { scope: 'regex', begin: /#"/, - end: /"/ + end: /"/, + contains: [hljs.BACKSLASH_ESCAPE] } const STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, { illegal: null diff --git a/test/markup/clojure/globals_definition.expect.txt b/test/markup/clojure/globals_definition.expect.txt index 93ce3c17a2..832e283cd4 100644 --- a/test/markup/clojure/globals_definition.expect.txt +++ b/test/markup/clojure/globals_definition.expect.txt @@ -14,6 +14,12 @@ (->> (list [vector] {:map map} #{'set}))))) +#"\"abc\\" + +"real +multiline +string" + #:person{:first "Han" :last "Solo" :ship #:ship{:name "Millenium Falcon"}} diff --git a/test/markup/clojure/globals_definition.txt b/test/markup/clojure/globals_definition.txt index fadd808156..0858484786 100644 --- a/test/markup/clojure/globals_definition.txt +++ b/test/markup/clojure/globals_definition.txt @@ -14,6 +14,12 @@ (->> (list [vector] {:map map} #{'set}))))) +#"\"abc\\" + +"real +multiline +string" + #:person{:first "Han" :last "Solo" :ship #:ship{:name "Millenium Falcon"}} From 59b8f1fc0654400569a8d37f8c1990af4a4d1824 Mon Sep 17 00:00:00 2001 From: DanBarkus Date: Fri, 12 Nov 2021 16:29:01 -0500 Subject: [PATCH 061/227] (docs) added GSQL to supported languages (#3389) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 6d53724dde..aa6db49636 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -87,6 +87,7 @@ The table below shows the full list of languages (and corresponding classes/alia | Golo | golo, gololang | | | Gradle | gradle | | | Groovy | groovy | | +| GSQL | gsql | [highlightjs-gsql](https://github.com/DanBarkus/highlightjs-gsql) | | HTML, XML | xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist, svg | | | HTTP | http, https | | | Haml | haml | | From ef45496df863838e77409fbff431db9a3d6b4dc6 Mon Sep 17 00:00:00 2001 From: Bradley Mackey Date: Sun, 14 Nov 2021 18:41:00 +0000 Subject: [PATCH 062/227] (chore) add gzip size compression report (#3400) This will report the gzip'd size of the CDN build output on every pull request, being run via GitHub actions. * Workflow: only report size of minified files --- .github/workflows/size_report.yml | 21 +++++++++++++++++++++ CHANGES.md | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/size_report.yml diff --git a/.github/workflows/size_report.yml b/.github/workflows/size_report.yml new file mode 100644 index 0000000000..c542bff3e2 --- /dev/null +++ b/.github/workflows/size_report.yml @@ -0,0 +1,21 @@ +# This workflow computes the size of a CDN build's output on all Javascript files. +# Reported file sizes are after the result of gzip compression. +# Compression action used: https://github.com/preactjs/compressed-size-action + +name: Size Report (gzip) + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Compute Compressed Size + uses: preactjs/compressed-size-action@v2 + with: + build-script: "build-cdn" + compression: "gzip" + pattern: "./build/{*.min.js,es/*.min.js,languages/*.min.js,es/languages/*.min.js}" diff --git a/CHANGES.md b/CHANGES.md index da9423a0c6..59324b44b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,10 @@ Grammars: - fix(clojure) Remove inconsistent/broken highlighting for metadata - enh(clojure) Add `punctuation` mode for commas. +Developer Tools: + +- (chore) add gzip size compression report (#3400) [Bradley Mackey][] + [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey [Björn Ebbinghaus]: https://github.com/MrEbbinghaus From 10b322dc436333b04df8295c9bdf4bad324849e0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 16 Nov 2021 12:13:38 -0500 Subject: [PATCH 063/227] fix(python) `def`, `class` keywords detected mid-identifier (#3381) --- CHANGES.md | 2 ++ src/languages/python.js | 6 +++--- test/markup/python/false_positives.expect.txt | 5 +++++ test/markup/python/false_positives.txt | 5 +++++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 test/markup/python/false_positives.expect.txt create mode 100644 test/markup/python/false_positives.txt diff --git a/CHANGES.md b/CHANGES.md index 59324b44b6..5ca677923e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][] - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] @@ -22,6 +23,7 @@ Developer Tools: [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey [Björn Ebbinghaus]: https://github.com/MrEbbinghaus +[Josh Goebel]: https://github.com/joshgoebel ## Version 11.3.1 diff --git a/src/languages/python.js b/src/languages/python.js index 46ed88a6f0..cb152d1b6c 100644 --- a/src/languages/python.js +++ b/src/languages/python.js @@ -384,7 +384,7 @@ export default function(hljs) { hljs.HASH_COMMENT_MODE, { match: [ - /def/, /\s+/, + /\bdef/, /\s+/, IDENT_RE, ], scope: { @@ -397,14 +397,14 @@ export default function(hljs) { variants: [ { match: [ - /class/, /\s+/, + /\bclass/, /\s+/, IDENT_RE, /\s*/, /\(\s*/, IDENT_RE,/\s*\)/ ], }, { match: [ - /class/, /\s+/, + /\bclass/, /\s+/, IDENT_RE ], } diff --git a/test/markup/python/false_positives.expect.txt b/test/markup/python/false_positives.expect.txt new file mode 100644 index 0000000000..cce88e6df8 --- /dev/null +++ b/test/markup/python/false_positives.expect.txt @@ -0,0 +1,5 @@ +foo = _undef +bar + +booger = _unclass +burger diff --git a/test/markup/python/false_positives.txt b/test/markup/python/false_positives.txt new file mode 100644 index 0000000000..cce88e6df8 --- /dev/null +++ b/test/markup/python/false_positives.txt @@ -0,0 +1,5 @@ +foo = _undef +bar + +booger = _unclass +burger From 59c02d1725639b11da3182f49d34eabb0fa90d07 Mon Sep 17 00:00:00 2001 From: wkania Date: Mon, 29 Nov 2021 18:28:00 +0100 Subject: [PATCH 064/227] chore(php) Remove duplicated code from default.txt (#3404) --- test/detect/php/default.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/detect/php/default.txt b/test/detect/php/default.txt index 70ba114640..54a9edc624 100644 --- a/test/detect/php/default.txt +++ b/test/detect/php/default.txt @@ -56,14 +56,6 @@ enum Foo: string { case Test = 'test'; } -match ($key) { - 1 => 'Integer 1', - '1' => 'String 1', - true => 'Bool true', - [] => 'Empty array', - [1] => 'Array [1]', -}; - echo URI::ME . URI::$st1; __halt_compiler () ; datahere From 238e073ee8d9f1dc7d05cda2f5b5e5a5f6e78af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melvyn=20La=C3=AFly?= Date: Mon, 29 Nov 2021 22:30:46 +0100 Subject: [PATCH 065/227] enh(fsharp) myriad of fixes and improvements (#3357) - fix: Stop highlighting type names everywhere. Only match them in type annotations. - Since the names are not reserved and can be re-used for variable/binding names shadowing, it can be confusing and misleading. - enh: Highlight operators. Operators are a big part of F#, so highlighting them brings a lot of value for legibility, etc... - enh: Support quoted identifiers (` ``...`` `. They can contain pretty much anything inside the double backquotes) - fix: Fix type names and symbols matching * Type names can contain apostrophes. * Type symbols can contain quoted identifiers, but no apostrophes. - enh: Match attributes in more places (not just at the start of a line), and match more of the things they can contain (not just basic strings and numbers). --- CHANGES.md | 2 + src/languages/fsharp.js | 183 +++++++++++++++--- test/markup/fsharp/attributes.expect.txt | 6 +- test/markup/fsharp/bang-keywords.expect.txt | 2 +- test/markup/fsharp/bang-keywords.txt | 2 +- test/markup/fsharp/comments.expect.txt | 18 +- .../fsharp/computation-expressions.expect.txt | 10 +- .../fsharp/fsi-and-preprocessor.expect.txt | 6 +- test/markup/fsharp/generic-types.expect.txt | 43 ---- test/markup/fsharp/generic-types.txt | 43 ---- test/markup/fsharp/numbers.expect.txt | 10 +- test/markup/fsharp/operators.expect.txt | 95 ++++++--- test/markup/fsharp/operators.txt | 49 +++++ test/markup/fsharp/strings.expect.txt | 36 ++-- test/markup/fsharp/types.expect.txt | 143 ++++++++++++++ test/markup/fsharp/types.txt | 143 ++++++++++++++ 16 files changed, 605 insertions(+), 186 deletions(-) delete mode 100644 test/markup/fsharp/generic-types.expect.txt delete mode 100644 test/markup/fsharp/generic-types.txt create mode 100644 test/markup/fsharp/types.expect.txt create mode 100644 test/markup/fsharp/types.txt diff --git a/CHANGES.md b/CHANGES.md index 5ca677923e..6a8581edfd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Grammars: - fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][] - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] +- fix(fsharp) Highlight operators, match type names only in type annotations, support quoted identifiers, and other smaller fixes. [Melvyn Laïly][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] - fix(clojure) Several issues with Clojure highlighting (#3397) [Björn Ebbinghaus][] - fix(clojure) `comment` macro catches more than it should (#3395) @@ -22,6 +23,7 @@ Developer Tools: [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey +[Melvyn Laïly]: https://github.com/mlaily [Björn Ebbinghaus]: https://github.com/MrEbbinghaus [Josh Goebel]: https://github.com/joshgoebel diff --git a/src/languages/fsharp.js b/src/languages/fsharp.js index 81f30539d3..f130d0c71f 100644 --- a/src/languages/fsharp.js +++ b/src/languages/fsharp.js @@ -119,7 +119,9 @@ export default function(hljs) { "__SOURCE_FILE__" ]; - const TYPES = [ + // Since it's possible to re-bind/shadow names (e.g. let char = 'c'), + // these builtin types should only be matched when a type name is expected. + const KNOWN_TYPES = [ // basic types "bool", "byte", @@ -157,7 +159,9 @@ export default function(hljs) { "nativeptr", "obj", "outref", - "voidptr" + "voidptr", + // other important FSharp types + "Result" ]; const BUILTINS = [ @@ -172,6 +176,7 @@ export default function(hljs) { "dict", "readOnlyDict", "set", + "get", "enum", "sizeof", "typeof", @@ -201,7 +206,6 @@ export default function(hljs) { ]; const ALL_KEYWORDS = { - type: TYPES, keyword: KEYWORDS, literal: LITERALS, built_in: BUILTINS, @@ -221,16 +225,138 @@ export default function(hljs) { ] }; - // 'a or ^a + // Most identifiers can contain apostrophes + const IDENTIFIER_RE = /[a-zA-Z_](\w|')*/; + + const QUOTED_IDENTIFIER = { + scope: 'variable', + begin: /``/, + end: /``/ + }; + + // 'a or ^a where a can be a ``quoted identifier`` + const BEGIN_GENERIC_TYPE_SYMBOL_RE = /\B('|\^)/ const GENERIC_TYPE_SYMBOL = { - match: regex.concat(/('|\^)/, hljs.UNDERSCORE_IDENT_RE), scope: 'symbol', + variants: [ + // the type name is a quoted identifier: + { match: regex.concat(BEGIN_GENERIC_TYPE_SYMBOL_RE, /``.*?``/) }, + // the type name is a normal identifier (we don't use IDENTIFIER_RE because there cannot be another apostrophe here): + { match: regex.concat(BEGIN_GENERIC_TYPE_SYMBOL_RE, hljs.UNDERSCORE_IDENT_RE) } + ], relevance: 0 }; + const makeOperatorMode = function({ includeEqual }) { + // List or symbolic operator characters from the FSharp Spec 4.1, minus the dot, and with `?` added, used for nullable operators. + let allOperatorChars; + if (includeEqual) + allOperatorChars = "!%&*+-/<=>@^|~?"; + else + allOperatorChars = "!%&*+-/<>@^|~?"; + const OPERATOR_CHARS = Array.from(allOperatorChars); + const OPERATOR_CHAR_RE = regex.concat('[', ...OPERATOR_CHARS.map(regex.escape), ']'); + // The lone dot operator is special. It cannot be redefined, and we don't want to highlight it. It can be used as part of a multi-chars operator though. + const OPERATOR_CHAR_OR_DOT_RE = regex.either(OPERATOR_CHAR_RE, /\./); + // When a dot is present, it must be followed by another operator char: + const OPERATOR_FIRST_CHAR_OF_MULTIPLE_RE = regex.concat(OPERATOR_CHAR_OR_DOT_RE, regex.lookahead(OPERATOR_CHAR_OR_DOT_RE)); + const SYMBOLIC_OPERATOR_RE = regex.either( + regex.concat(OPERATOR_FIRST_CHAR_OF_MULTIPLE_RE, OPERATOR_CHAR_OR_DOT_RE, '*'), // Matches at least 2 chars operators + regex.concat(OPERATOR_CHAR_RE, '+'), // Matches at least one char operators + ); + return { + scope: 'operator', + match: regex.either( + // symbolic operators: + SYMBOLIC_OPERATOR_RE, + // other symbolic keywords: + // Type casting and conversion operators: + /:\?>/, + /:\?/, + /:>/, + /:=/, // Reference cell assignment + /::?/, // : or :: + /\$/), // A single $ can be used as an operator + relevance: 0 + }; + } + + const OPERATOR = makeOperatorMode({ includeEqual: true }); + // This variant is used when matching '=' should end a parent mode: + const OPERATOR_WITHOUT_EQUAL = makeOperatorMode({ includeEqual: false }); + + const makeTypeAnnotationMode = function(prefix, prefixScope) { + return { + begin: regex.concat( // a type annotation is a + prefix, // should be a colon or the 'of' keyword + regex.lookahead( // that has to be followed by + regex.concat( + /\s*/, // optional space + regex.either( // then either of: + /\w/, // word + /'/, // generic type name + /\^/, // generic type name + /#/, // flexible type name + /``/, // quoted type name + /\(/, // parens type expression + /{\|/, // anonymous type annotation + )))), + beginScope: prefixScope, + // BUG: because ending with \n is necessary for some cases, multi-line type annotations are not properly supported. + // Examples where \n is required at the end: + // - abstract member definitions in classes: abstract Property : int * string + // - return type annotations: let f f' = f' () : returnTypeAnnotation + // - record fields definitions: { A : int \n B : string } + end: regex.lookahead( + regex.either( + /\n/, + /=/)), + relevance: 0, + // we need the known types, and we need the type constraint keywords and literals. e.g.: when 'a : null + keywords: hljs.inherit(ALL_KEYWORDS, { type: KNOWN_TYPES }), + contains: [ + COMMENT, + GENERIC_TYPE_SYMBOL, + hljs.inherit(QUOTED_IDENTIFIER, { scope: null }), // match to avoid strange patterns inside that may break the parsing + OPERATOR_WITHOUT_EQUAL + ] + }; + } + + const TYPE_ANNOTATION = makeTypeAnnotationMode(/:/, 'operator'); + const DISCRIMINATED_UNION_TYPE_ANNOTATION = makeTypeAnnotationMode(/\bof\b/, 'keyword'); + + // type MyType<'a> = ... + const TYPE_DECLARATION = { + begin: [ + /(^|\s+)/, // prevents matching the following: `match s.stype with` + /type/, + /\s+/, + IDENTIFIER_RE + ], + beginScope: { + 2: 'keyword', + 4: 'title.class' + }, + end: regex.lookahead(/\(|=|$/), + keywords: ALL_KEYWORDS, // match keywords in type constraints. e.g.: when 'a : null + contains: [ + COMMENT, + hljs.inherit(QUOTED_IDENTIFIER, { scope: null }), // match to avoid strange patterns inside that may break the parsing + GENERIC_TYPE_SYMBOL, + { + // For visual consistency, highlight type brackets as operators. + scope: 'operator', + match: /<|>/ + }, + TYPE_ANNOTATION // generic types can have constraints, which are type annotations. e.g. type MyType<'T when 'T : delegate> = + ] + }; + const COMPUTATION_EXPRESSION = { // computation expressions: scope: 'computation-expression', + // BUG: might conflict with record deconstruction. e.g. let f { Name = name } = name // will highlight f match: /\b[_a-z]\w*(?=\s*\{)/ }; @@ -365,10 +491,13 @@ export default function(hljs) { CHAR_LITERAL, BANG_KEYWORD_MODE, COMMENT, + QUOTED_IDENTIFIER, + TYPE_ANNOTATION, COMPUTATION_EXPRESSION, PREPROCESSOR, NUMBER, - GENERIC_TYPE_SYMBOL + GENERIC_TYPE_SYMBOL, + OPERATOR ]; const STRING = { variants: [ @@ -397,42 +526,32 @@ export default function(hljs) { BANG_KEYWORD_MODE, STRING, COMMENT, + QUOTED_IDENTIFIER, + TYPE_DECLARATION, { - // type MyType<'a> = ... - begin: [ - /type/, - /\s+/, - hljs.UNDERSCORE_IDENT_RE - ], - beginScope: { - 1: 'keyword', - 3: 'title.class' - }, - end: regex.lookahead(/\(|=|$/), - contains: [ - GENERIC_TYPE_SYMBOL - ] - }, - { - // [] + // e.g. [] or [<``module``: MyCustomAttributeThatWorksOnModules>] + // or [] scope: 'meta', - begin: /^\s*\[\]/), + begin: /\[\]/, relevance: 2, contains: [ - { - scope: 'string', - begin: /"/, - end: /"/ - }, + QUOTED_IDENTIFIER, + // can contain any constant value + TRIPLE_QUOTED_STRING, + VERBATIM_STRING, + QUOTED_STRING, + CHAR_LITERAL, NUMBER ] }, + DISCRIMINATED_UNION_TYPE_ANNOTATION, + TYPE_ANNOTATION, COMPUTATION_EXPRESSION, PREPROCESSOR, NUMBER, - GENERIC_TYPE_SYMBOL + GENERIC_TYPE_SYMBOL, + OPERATOR ] }; } diff --git a/test/markup/fsharp/attributes.expect.txt b/test/markup/fsharp/attributes.expect.txt index 8543437864..5fb83bfcf3 100644 --- a/test/markup/fsharp/attributes.expect.txt +++ b/test/markup/fsharp/attributes.expect.txt @@ -1,4 +1,4 @@ // Strings and numbers are highlighted inside the attribute -[<Foo>] -[<Bar("bar"); Foo(1, 2)>] -let x () = () \ No newline at end of file +[<Foo>] +[<Bar("bar"); Foo(1, 2)>] +let x () = () \ No newline at end of file diff --git a/test/markup/fsharp/bang-keywords.expect.txt b/test/markup/fsharp/bang-keywords.expect.txt index 56aa58dc26..c47d939e94 100644 --- a/test/markup/fsharp/bang-keywords.expect.txt +++ b/test/markup/fsharp/bang-keywords.expect.txt @@ -1 +1 @@ -let! (result2 : byte[]) = stream.AsyncRead(bufferSize) +let! (result2 : byte[]) = stream.AsyncRead(bufferSize) \ No newline at end of file diff --git a/test/markup/fsharp/bang-keywords.txt b/test/markup/fsharp/bang-keywords.txt index 5824ca88db..796afd6609 100644 --- a/test/markup/fsharp/bang-keywords.txt +++ b/test/markup/fsharp/bang-keywords.txt @@ -1 +1 @@ -let! (result2 : byte[]) = stream.AsyncRead(bufferSize) +let! (result2 : byte[]) = stream.AsyncRead(bufferSize) diff --git a/test/markup/fsharp/comments.expect.txt b/test/markup/fsharp/comments.expect.txt index bd0f7d6a23..7d71bcbd14 100644 --- a/test/markup/fsharp/comments.expect.txt +++ b/test/markup/fsharp/comments.expect.txt @@ -14,12 +14,12 @@ asdf *) -let index = +let index = len - |> float - |> Operators.(*) 0.1 // (*) here is not comment - |> Operators.(+) 1 // (+) here is not comment - |> Operators.(-) len // (-) here is not comment + |> float + |> Operators.(*) 0.1 // (*) here is not comment + |> Operators.(+) 1 // (+) here is not comment + |> Operators.(-) len // (-) here is not comment // foobar @@ -34,11 +34,11 @@ asdf /// Longer comments can be associated with a type or member through /// the remarks tag. /// </remarks> -let x = () +let x = () // the next one is not a comment -(*) (*) +(*) (*) -/* +/* this one is not a valid comment either -*/ \ No newline at end of file +*/ \ No newline at end of file diff --git a/test/markup/fsharp/computation-expressions.expect.txt b/test/markup/fsharp/computation-expressions.expect.txt index a78a366724..76cb4486bd 100644 --- a/test/markup/fsharp/computation-expressions.expect.txt +++ b/test/markup/fsharp/computation-expressions.expect.txt @@ -3,21 +3,21 @@ open System.Threading.Tasks // Single line, and contains a capital letter -let unitTask = unitTask { return () } +let unitTask = unitTask { return () } -let work = +let work = async { - let delayTask () = + let delayTask () = // Nested computation task { printfn "Delay..." do! Task.Delay 1000 return 42 } - let! result = delayTask () |> Async.AwaitTask + let! result = delayTask () |> Async.AwaitTask printfn "Async F# sleep..." do! Async.Sleep 1000 return result } -let result = work |> Async.RunSynchronously \ No newline at end of file +let result = work |> Async.RunSynchronously \ No newline at end of file diff --git a/test/markup/fsharp/fsi-and-preprocessor.expect.txt b/test/markup/fsharp/fsi-and-preprocessor.expect.txt index 6889c0e9ef..181ff72bfb 100644 --- a/test/markup/fsharp/fsi-and-preprocessor.expect.txt +++ b/test/markup/fsharp/fsi-and-preprocessor.expect.txt @@ -7,7 +7,7 @@ #nowarn #if DEBUG // whitespace is allowed before -let x = 0 #if DEBUG // but the preprocessor directive must be the first non-whitespace +let x = 0 #if DEBUG // but the preprocessor directive must be the first non-whitespace #IF asdf // should not match wrongly cased keywords #iftest // should not match @@ -15,8 +15,8 @@ #r "file.dll";; // Reference (dynamically load) the given DLL #i "package source uri";; // Include package source uri when searching for packages #I "path";; // Add the given search path for referenced DLLs -#load "file.fs" ...;; // Load the given file(s) as if compiled and referenced -#time ["on"|"off"];; // Toggle timing on/off +#load "file.fs" ...;; // Load the given file(s) as if compiled and referenced +#time ["on"|"off"];; // Toggle timing on/off #help;; // Display help #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version diff --git a/test/markup/fsharp/generic-types.expect.txt b/test/markup/fsharp/generic-types.expect.txt deleted file mode 100644 index e1a5aa0414..0000000000 --- a/test/markup/fsharp/generic-types.expect.txt +++ /dev/null @@ -1,43 +0,0 @@ -// Primarily testing for generic parameters highlighting... - -type Ref<'a> = -{ mutable contents: 'a } - -type Bla<'a> = {X: string} -type Blah< - 'a - > = { x: 'a } -type Blah < - 'a - > = { x: 'a } -type Bla <'a> = {X: string} -let inline asdf x: Bla<'a> = {X = ""} - -let inline asdf x: Bla<^a> = {X = ""} -let inline asdf x: Bla< ^a > = {X = ""} - -let genericSumUnits ( x : float<'u>) (y: float<'u>) = x + y - -let inline konst x _ = x - -type CFunctor() = - static member inline fmap (f: ^a -> ^b, a: ^a list) = List.map f a - static member inline fmap (f: ^a -> ^b, a: ^a option) = - match a with - | None -> None - | Some x -> Some (f x) - - // default implementation of replace - static member inline replace< ^a, ^b, ^c, ^d, ^e when ^a :> CFunctor and (^a or ^d): (static member fmap: (^b -> ^c) * ^d -> ^e) > (a, f) = - ((^a or ^d) : (static member fmap : (^b -> ^c) * ^d -> ^e) (konst a, f)) - - // call overridden replace if present - static member inline replace< ^a, ^b, ^c when ^b: (static member replace: ^a * ^b -> ^c)>(a: ^a, f: ^b) = - (^b : (static member replace: ^a * ^b -> ^c) (a, f)) - -let inline replace_instance< ^a, ^b, ^c, ^d when (^a or ^c): (static member replace: ^b * ^c -> ^d)> (a: ^b, f: ^c) = - ((^a or ^c): (static member replace: ^b * ^c -> ^d) (a, f)) - -// Note the concrete type 'CFunctor' specified in the signature -let inline replace (a: ^a) (f: ^b): ^a0 when (CFunctor or ^b): (static member replace: ^a * ^b -> ^a0) = - replace_instance<CFunctor, _, _, _> (a, f) \ No newline at end of file diff --git a/test/markup/fsharp/generic-types.txt b/test/markup/fsharp/generic-types.txt deleted file mode 100644 index a700edc5be..0000000000 --- a/test/markup/fsharp/generic-types.txt +++ /dev/null @@ -1,43 +0,0 @@ -// Primarily testing for generic parameters highlighting... - -type Ref<'a> = -{ mutable contents: 'a } - -type Bla<'a> = {X: string} -type Blah< - 'a - > = { x: 'a } -type Blah < - 'a - > = { x: 'a } -type Bla <'a> = {X: string} -let inline asdf x: Bla<'a> = {X = ""} - -let inline asdf x: Bla<^a> = {X = ""} -let inline asdf x: Bla< ^a > = {X = ""} - -let genericSumUnits ( x : float<'u>) (y: float<'u>) = x + y - -let inline konst x _ = x - -type CFunctor() = - static member inline fmap (f: ^a -> ^b, a: ^a list) = List.map f a - static member inline fmap (f: ^a -> ^b, a: ^a option) = - match a with - | None -> None - | Some x -> Some (f x) - - // default implementation of replace - static member inline replace< ^a, ^b, ^c, ^d, ^e when ^a :> CFunctor and (^a or ^d): (static member fmap: (^b -> ^c) * ^d -> ^e) > (a, f) = - ((^a or ^d) : (static member fmap : (^b -> ^c) * ^d -> ^e) (konst a, f)) - - // call overridden replace if present - static member inline replace< ^a, ^b, ^c when ^b: (static member replace: ^a * ^b -> ^c)>(a: ^a, f: ^b) = - (^b : (static member replace: ^a * ^b -> ^c) (a, f)) - -let inline replace_instance< ^a, ^b, ^c, ^d when (^a or ^c): (static member replace: ^b * ^c -> ^d)> (a: ^b, f: ^c) = - ((^a or ^c): (static member replace: ^b * ^c -> ^d) (a, f)) - -// Note the concrete type 'CFunctor' specified in the signature -let inline replace (a: ^a) (f: ^b): ^a0 when (CFunctor or ^b): (static member replace: ^a * ^b -> ^a0) = - replace_instance (a, f) \ No newline at end of file diff --git a/test/markup/fsharp/numbers.expect.txt b/test/markup/fsharp/numbers.expect.txt index 2fa768f80d..77a1bd63d3 100644 --- a/test/markup/fsharp/numbers.expect.txt +++ b/test/markup/fsharp/numbers.expect.txt @@ -31,10 +31,10 @@ 9999999999999999999999999999I // Distance, meters. -[<Measure>] type m +[<Measure>] type m // Time, seconds. -[<Measure>] type s +[<Measure>] type s -let v1 = 3.1<m/s> -let x1 = 1.2<m> -let t1 = 1.0<s> \ No newline at end of file +let v1 = 3.1<m/s> +let x1 = 1.2<m> +let t1 = 1.0<s> \ No newline at end of file diff --git a/test/markup/fsharp/operators.expect.txt b/test/markup/fsharp/operators.expect.txt index 188baa2275..ac71ba62f3 100644 --- a/test/markup/fsharp/operators.expect.txt +++ b/test/markup/fsharp/operators.expect.txt @@ -1,28 +1,77 @@ - >= <= <> > < = + - * / % - >=? <=? <>? >? <? =? +? -? *? /? %? -?>=? ?<=? ?<>? ?>? ?<? ?=? ?+? ?-? ?*? ?/? ?%? -?>= ?<= ?<> ?> ?< ?= ?+ ?- ?* ?/ ?% - -** - -<- -> -.. -:: -:> :? :?> -<< >> -<<< >>> ~~~ ^^^ &&& ||| -| || -<| <|| <||| -|> ||> |||> -~~ ~- ~+ - -? ^ ! -!= == -& && + >= <= <> > < = + - * / % + >=? <=? <>? >? <? =? +? -? *? /? %? +?>=? ?<=? ?<>? ?>? ?<? ?=? ?+? ?-? ?*? ?/? ?%? +?>= ?<= ?<> ?> ?< ?= ?+ ?- ?* ?/ ?% + +** + +<- -> +.. +:: +:> :? :?> +<< >> +<<< >>> ~~~ ^^^ &&& ||| +| || +<| <|| <||| +|> ||> |||> +~~ ~- ~+ + +? ^ ! +!= == +& && + +let array = [| 0 |] +let anonymousRecord = {| x = 42 |} +let range = [ for i in 0..10 -> i ] + +// Custom operators + +let inline (+?) (x: int) (y: int) = x + 2*y +printf "%d" (10 +? 1) + +let inline (<!>) (f: 'T->'U) (x: '``Functor<'T>``) : '``Functor<'U>`` = Map.Invoke f x + +let inline (<<|) (f: 'T->'U) (x: '``Functor<'T>``) : '``Functor<'U>`` = Map.Invoke f x + +let inline (|>>) (x: '``Functor<'T>``) (f: 'T->'U) : '``Functor<'U>`` = Map.Invoke f x + +let inline (<*>) (f: '``Applicative<'T -> 'U>``) (x: '``Applicative<'T>``) : '``Applicative<'U>`` = Apply.Invoke f x + +let inline ( *>) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) : '``Applicative<'U>`` = ((fun (_: 'T) (k: 'U) -> k) <!> x : '``Applicative<'U->'U>``) <*> y + +let inline (<* ) (x: '``Applicative<'U>``) (y: '``Applicative<'T>``): '``Applicative<'U>`` = ((fun (k: 'U) (_: 'T) -> k ) <!> x : '``Applicative<'T->'U>``) <*> y + +let inline (<**>) (x: '``Applicative<'T>``) : '``Applicative<'T -> 'U>``->'``Applicative<'U>`` = flip (<*>) x + +let inline (>>=) (x: '``Monad<'T>``) (f: 'T->'``Monad<'U>``) : '``Monad<'U>`` = Bind.Invoke x f + +let inline (=<<) (f: 'T->'``Monad<'U>``) (x: '``Monad<'T>``) : '``Monad<'U>`` = Bind.Invoke x f + +let inline (>=>) (f: 'T->'``Monad<'U>``) (g: 'U->'``Monad<'V>``) : 'T -> '``Monad<'V>`` = fun x -> Bind.Invoke (f x) g + +let inline (<=<) (g: 'b->'``Monad<'V>``) (f: 'T->'``Monad<'U>``) : 'T -> '``Monad<'V>`` = fun x -> Bind.Invoke (f x) g + +let inline (++) (x: 'Monoid) (y: 'Monoid) : 'Monoid = Plus.Invoke x y + +let inline (<|>) (x: '``Functor<'T>``) (y: '``Functor<'T>``) : '``Functor<'T>`` = Append.Invoke x y + +let inline (=>>) (s: '``Comonad<'T>``) (g: '``Comonad<'T>``->'U) : '``Comonad<'U>`` = Extend.Invoke g s + +// Code quotation open Microsoft.FSharp.Quotations // A typed code quotation. -let expr : Expr<int> = <@ 1 + 1 @> +let expr : Expr<int> = <@ 1 + 1 @> // An untyped code quotation. -let expr2 : Expr = <@@ 1 + 1 @@> \ No newline at end of file +let expr2 : Expr = <@@ 1 + 1 @@> + +// Active patterns + +let (|Integer|_|) (str: string) = + let mutable intvalue = 0 + if System.Int32.TryParse(str, &intvalue) then Some(intvalue) + else None + +let (|Even|Odd|) input = if input % 2 = 0 then Even else Odd +// \ No newline at end of file diff --git a/test/markup/fsharp/operators.txt b/test/markup/fsharp/operators.txt index 97272294f8..503eb76295 100644 --- a/test/markup/fsharp/operators.txt +++ b/test/markup/fsharp/operators.txt @@ -21,8 +21,57 @@ != == & && +let array = [| 0 |] +let anonymousRecord = {| x = 42 |} +let range = [ for i in 0..10 -> i ] + +// Custom operators + +let inline (+?) (x: int) (y: int) = x + 2*y +printf "%d" (10 +? 1) + +let inline () (f: 'T->'U) (x: '``Functor<'T>``) : '``Functor<'U>`` = Map.Invoke f x + +let inline (<<|) (f: 'T->'U) (x: '``Functor<'T>``) : '``Functor<'U>`` = Map.Invoke f x + +let inline (|>>) (x: '``Functor<'T>``) (f: 'T->'U) : '``Functor<'U>`` = Map.Invoke f x + +let inline (<*>) (f: '``Applicative<'T -> 'U>``) (x: '``Applicative<'T>``) : '``Applicative<'U>`` = Apply.Invoke f x + +let inline ( *>) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) : '``Applicative<'U>`` = ((fun (_: 'T) (k: 'U) -> k) x : '``Applicative<'U->'U>``) <*> y + +let inline (<* ) (x: '``Applicative<'U>``) (y: '``Applicative<'T>``): '``Applicative<'U>`` = ((fun (k: 'U) (_: 'T) -> k ) x : '``Applicative<'T->'U>``) <*> y + +let inline (<**>) (x: '``Applicative<'T>``) : '``Applicative<'T -> 'U>``->'``Applicative<'U>`` = flip (<*>) x + +let inline (>>=) (x: '``Monad<'T>``) (f: 'T->'``Monad<'U>``) : '``Monad<'U>`` = Bind.Invoke x f + +let inline (=<<) (f: 'T->'``Monad<'U>``) (x: '``Monad<'T>``) : '``Monad<'U>`` = Bind.Invoke x f + +let inline (>=>) (f: 'T->'``Monad<'U>``) (g: 'U->'``Monad<'V>``) : 'T -> '``Monad<'V>`` = fun x -> Bind.Invoke (f x) g + +let inline (<=<) (g: 'b->'``Monad<'V>``) (f: 'T->'``Monad<'U>``) : 'T -> '``Monad<'V>`` = fun x -> Bind.Invoke (f x) g + +let inline (++) (x: 'Monoid) (y: 'Monoid) : 'Monoid = Plus.Invoke x y + +let inline (<|>) (x: '``Functor<'T>``) (y: '``Functor<'T>``) : '``Functor<'T>`` = Append.Invoke x y + +let inline (=>>) (s: '``Comonad<'T>``) (g: '``Comonad<'T>``->'U) : '``Comonad<'U>`` = Extend.Invoke g s + +// Code quotation + open Microsoft.FSharp.Quotations // A typed code quotation. let expr : Expr = <@ 1 + 1 @> // An untyped code quotation. let expr2 : Expr = <@@ 1 + 1 @@> + +// Active patterns + +let (|Integer|_|) (str: string) = + let mutable intvalue = 0 + if System.Int32.TryParse(str, &intvalue) then Some(intvalue) + else None + +let (|Even|Odd|) input = if input % 2 = 0 then Even else Odd +// \ No newline at end of file diff --git a/test/markup/fsharp/strings.expect.txt b/test/markup/fsharp/strings.expect.txt index fad7761fa2..75e6ceaf31 100644 --- a/test/markup/fsharp/strings.expect.txt +++ b/test/markup/fsharp/strings.expect.txt @@ -26,7 +26,7 @@ bar""" '\u0041' '\U0001F47D' -$"{1+1}" +$"{1+1}" "" // end "fo\"o" // end @@ -53,7 +53,7 @@ bar""" // end '\u0041' // end '\U0001F47D' // end -$"{1+1}" // end +$"{1+1}" // end 0 "string \'" // end @@ -71,15 +71,15 @@ string" // end string""" // end 5 $"interpola\ {{ -ted \' {1 + 1 // can contain comments and " in placeholders +ted \' {1 + 1 // can contain comments and " in placeholders }string" // end 6 $@"interpolated "" \' {{ -verbatim{1 + 1 // can contain comments and " in placeholders +verbatim{1 + 1 // can contain comments and " in placeholders }string" // end 7 @$"interpolated "" \' {{ -verbatim{1 + 1 // can contain comments and " in placeholders +verbatim{1 + 1 // can contain comments and " in placeholders }string" // end 8 $"""interpolated triple quoted " \' {{ { (sprintf "%d%s" 42) @@ -88,15 +88,15 @@ verbatim{1 + 9 $"""test { @"{it's not a placeholder!}" } asdf""" // end 10 -$"""test { $"but this is:{1+1}" } asdf""" // end +$"""test { $"but this is:{1+1}" } asdf""" // end 11 $"interpola\ {{ -ted \' {1 + 1 // can contain comments in placeholders +ted \' {1 + 1 // can contain comments in placeholders // placeholders cannot contain " }string" // end 12 $@"interpolated "" \' {{ -verbatim{1 + 1 // can contain comments in placeholders +verbatim{1 + 1 // can contain comments in placeholders // placeholders cannot contain " }string" // end 13 @@ -104,14 +104,14 @@ verbatim{1 + // and comments... }string""" // end 14 -let list = [1] -$"""test{ list |> List.map (fun x -> x + 1) }test""" // end +let list = [1] +$"""test{ list |> List.map (fun x -> x + 1) }test""" // end 15 $"test{1 (* " Does it break the string? " *) }test" // end 16 $"test\ { - let x = 42 // valid comment contains " quote " ... + let x = 42 // valid comment contains " quote " ... x (* " Does it break the string? " *) }test" // end 17 @@ -119,18 +119,18 @@ verbatim{1 + { #if DEBUG #endif - let asdf = "}" // """ does it break? - let x = $@"test{2+2 (* " what about double nesting? " *) }test" - let lit = 0 - let x = unitTask { return () } + let asdf = "}" // """ does it break? + let x = $@"test{2+2 (* " what about double nesting? " *) }test" + let lit = 0 + let x = unitTask { return () } asdf }test""" 18 -let list = [1] +let list = [1] $"""test { - let asdf = "}" - list |> List.map (fun x -> x + 1) + let asdf = "}" + list |> List.map (fun x -> x + 1) }test""" // end 19 \ No newline at end of file diff --git a/test/markup/fsharp/types.expect.txt b/test/markup/fsharp/types.expect.txt new file mode 100644 index 0000000000..0ad8b0c6a7 --- /dev/null +++ b/test/markup/fsharp/types.expect.txt @@ -0,0 +1,143 @@ +// Testing type definition and type annotation highlighting: + +let test'test = 15 // compiles +let bla = test'test // compiles +type test'test<'a> = Test<'a> // compiles + +let ``type`` = "hello" // compiles +let ``type` is a keyword but I can use it in my 'd funky \ \\ \n " ^d binding`` = "hello" // compiles + +// Type names (here with char) can be used to redefine bindings: +let char : char = + let char = box (char "a") + let result = unbox<char> char + try () + with | :? ArgumentException -> failwith "..." + result + +// All the following type annotation examples are valid F# +type ``my = type`` = {a:string} +let x : char array = [|'a'|] +let f f' = f' () : 'returnType // the type annotation should end now +and not color this as a type. let's end this with an end pattern: = +let f (a: int, (b: string)) = () +let f (a: int, b: string) = () +let anonymousRecordAnnotation : {| X: string; Y: int array * string |} = ... +let nested : {| X: string; Y: {| Nested: bool |} |} = () +let test (a: {| X: string; (* this is a comment *) Y: {| Nested: bool |} |}) = () +let f (a: (string[])) = a +let f (a: int -> (unit -> string) -> string) (b: ('a -> 'b -> _ -> ``my = type`` -> {| Prop: '``quoted``|}) -> 'a list -> 'b list) = a +let f (a: ('a -> 'b) -> 'a list -> 'b list -> (unit -> string) -> {| X: string |}) : _ * (int -> unit) = a, (fun x -> ()) +let f (a: ('a -> 'b) // multiline! (currently not supported) + -> {| X: (int -> {| Y: (string -> (unit (*this is getting*))(*really nested...*)); A: ``my = type`` |}) |} + -> 'b list -> (unit -> string) -> {| X: string |}) = a +let test : string (* this is a comment *) = ... +let f (a: 'a when 'a : null, b: string) = () +let iterate2 (f : unit -> #seq<int>) = + for e in f() do printfn "%d" e +type record = + { X: int -> ('a -> 'b) -> (unit -> string) -> 'a list -> 'b list // comment + Y: {| Bla: string (*comment*) array -> unit |} } +type record = + { X: string // comment + Y: {| + Bla: string (*comment*) array + -> unit |} } + +type FancyClass(thing:int, var2 : string -> string, ``ddzdz``: string list, extra) as xxx = + + let pf() = xxx.Test() + let mutable myInternalValue = null + + member xxx.Test() = "F#" + + // A read-only property. + member __.MyReadOnlyProperty = myInternalValue + // A write-only property. + member __.MyWriteOnlyProperty with set (value) = myInternalValue <- value + // A read-write property. + member __.MyReadWriteProperty + with get () = myInternalValue + and set (value) = myInternalValue <- value + + member __.ReadAndWriteWithSignature + with get (count : int) : string = string count + and set (value : int) : unit = failwith "" + + member __.MyReadWriteProperty with get () = myInternalValue + member __.MyReadWriteProperty with set (value) = myInternalValue <- value + + abstract Update : int * string * string option * obj -> FancyClass + default this.Update (thing:int, var2 : string, ``name with spaces``: string option, extra) = this + + member val Property1 = thing + member val Property2 = "" with get, set + +// Testing for generic parameters highlighting: + +type Ref<'a> = +{ mutable contents: 'a } + +type Bla<'a> = {X: string} +type Blah< + 'a + > = { x: 'a } +type Blah < + 'a + > = { x: 'a } +type Bla <'a> = {X: string} +let inline asdf x: Bla<'a> = {X = ""} + +let inline asdf x: Bla<^a> = {X = ""} +let inline asdf x: Bla< ^a > = {X = ""} + +let a : '``asdf``_asdf = () // This is not valid and should not be parsed as a single generic type symbol + +type MyType<'T when 'T : null> = ... +type MyType<'T when 'T : unmanaged> = ... +type MyType<'T when 'T : (member Method1 : 'T -> int)> = ... +type MyType<'T when 'T : delegate<obj * System.EventArgs, unit>> = ... + +let genericSumUnits ( x : float<'u>) (y: float<'u>) = x + y + +let inline konst x _ = x + +type CFunctor() = + static member inline fmap (f: ^a -> ^b, a: ^a list) = List.map f a + static member inline fmap (f: ^a -> ^b, a: ^a option) = + match a with + | None -> None + | Some x -> Some (f x) + + // default implementation of replace + static member inline replace< ^a, ^b, ^c, ^d, ^e when ^a :> CFunctor and (^a or ^d): (static member fmap: (^b -> ^c) * ^d -> ^e) > (a, f) = + ((^a or ^d) : (static member fmap : (^b -> ^c) * ^d -> ^e) (konst a, f)) + + // call overridden replace if present + static member inline replace< ^a, ^b, ^c when ^b: (static member replace: ^a * ^b -> ^c)>(a: ^a, f: ^b) = + (^b : (static member replace: ^a * ^b -> ^c) (a, f)) + +let inline replace_instance< ^a, ^b, ^c, ^d when (^a or ^c): (static member replace: ^b * ^c -> ^d)> (a: ^b, f: ^c) = + ((^a or ^c): (static member replace: ^b * ^c -> ^d) (a, f)) + +// Note the concrete type 'CFunctor' specified in the signature +let inline replace (a: ^a) (f: ^b): ^a0 when (CFunctor or ^b): (static member replace: ^a * ^b -> ^a0) = + replace_instance<CFunctor, _, _, _> (a, f) + +type DUType = + | CaseA + | CaseB of int + | CaseC of (int * (string * string) list) + | CaseD of name :string * age:int + | CaseE of client: Client + | CaseF of client: Client (*comment tests*) * (*comment tests*) string * port : int + | CaseG of (obj -> unit) + | CaseH of string * (obj -> unit) + // Check multiple declaration on one line + | CaseI of int | CaseJ of int + | CaseF2 of client: Client // * string * port : int + | FetchDomainsSuccess of Result<int list * ``type with spaces`` * int, ``type * with * spaces``> + | CaseK of ``var with spaces``: string + | CaseL of ``var with spaces``: ``type with spaces`` + | CaseM of v1 : ``type with spaces`` + | CaseN of ``type with spaces`` \ No newline at end of file diff --git a/test/markup/fsharp/types.txt b/test/markup/fsharp/types.txt new file mode 100644 index 0000000000..490afa4e46 --- /dev/null +++ b/test/markup/fsharp/types.txt @@ -0,0 +1,143 @@ +// Testing type definition and type annotation highlighting: + +let test'test = 15 // compiles +let bla = test'test // compiles +type test'test<'a> = Test<'a> // compiles + +let ``type`` = "hello" // compiles +let ``type` is a keyword but I can use it in my 'd funky \ \\ \n " ^d binding`` = "hello" // compiles + +// Type names (here with char) can be used to redefine bindings: +let char : char = + let char = box (char "a") + let result = unbox char + try () + with | :? ArgumentException -> failwith "..." + result + +// All the following type annotation examples are valid F# +type ``my = type`` = {a:string} +let x : char array = [|'a'|] +let f f' = f' () : 'returnType // the type annotation should end now +and not color this as a type. let's end this with an end pattern: = +let f (a: int, (b: string)) = () +let f (a: int, b: string) = () +let anonymousRecordAnnotation : {| X: string; Y: int array * string |} = ... +let nested : {| X: string; Y: {| Nested: bool |} |} = () +let test (a: {| X: string; (* this is a comment *) Y: {| Nested: bool |} |}) = () +let f (a: (string[])) = a +let f (a: int -> (unit -> string) -> string) (b: ('a -> 'b -> _ -> ``my = type`` -> {| Prop: '``quoted``|}) -> 'a list -> 'b list) = a +let f (a: ('a -> 'b) -> 'a list -> 'b list -> (unit -> string) -> {| X: string |}) : _ * (int -> unit) = a, (fun x -> ()) +let f (a: ('a -> 'b) // multiline! (currently not supported) + -> {| X: (int -> {| Y: (string -> (unit (*this is getting*))(*really nested...*)); A: ``my = type`` |}) |} + -> 'b list -> (unit -> string) -> {| X: string |}) = a +let test : string (* this is a comment *) = ... +let f (a: 'a when 'a : null, b: string) = () +let iterate2 (f : unit -> #seq) = + for e in f() do printfn "%d" e +type record = + { X: int -> ('a -> 'b) -> (unit -> string) -> 'a list -> 'b list // comment + Y: {| Bla: string (*comment*) array -> unit |} } +type record = + { X: string // comment + Y: {| + Bla: string (*comment*) array + -> unit |} } + +type FancyClass(thing:int, var2 : string -> string, ``ddzdz``: string list, extra) as xxx = + + let pf() = xxx.Test() + let mutable myInternalValue = null + + member xxx.Test() = "F#" + + // A read-only property. + member __.MyReadOnlyProperty = myInternalValue + // A write-only property. + member __.MyWriteOnlyProperty with set (value) = myInternalValue <- value + // A read-write property. + member __.MyReadWriteProperty + with get () = myInternalValue + and set (value) = myInternalValue <- value + + member __.ReadAndWriteWithSignature + with get (count : int) : string = string count + and set (value : int) : unit = failwith "" + + member __.MyReadWriteProperty with get () = myInternalValue + member __.MyReadWriteProperty with set (value) = myInternalValue <- value + + abstract Update : int * string * string option * obj -> FancyClass + default this.Update (thing:int, var2 : string, ``name with spaces``: string option, extra) = this + + member val Property1 = thing + member val Property2 = "" with get, set + +// Testing for generic parameters highlighting: + +type Ref<'a> = +{ mutable contents: 'a } + +type Bla<'a> = {X: string} +type Blah< + 'a + > = { x: 'a } +type Blah < + 'a + > = { x: 'a } +type Bla <'a> = {X: string} +let inline asdf x: Bla<'a> = {X = ""} + +let inline asdf x: Bla<^a> = {X = ""} +let inline asdf x: Bla< ^a > = {X = ""} + +let a : '``asdf``_asdf = () // This is not valid and should not be parsed as a single generic type symbol + +type MyType<'T when 'T : null> = ... +type MyType<'T when 'T : unmanaged> = ... +type MyType<'T when 'T : (member Method1 : 'T -> int)> = ... +type MyType<'T when 'T : delegate> = ... + +let genericSumUnits ( x : float<'u>) (y: float<'u>) = x + y + +let inline konst x _ = x + +type CFunctor() = + static member inline fmap (f: ^a -> ^b, a: ^a list) = List.map f a + static member inline fmap (f: ^a -> ^b, a: ^a option) = + match a with + | None -> None + | Some x -> Some (f x) + + // default implementation of replace + static member inline replace< ^a, ^b, ^c, ^d, ^e when ^a :> CFunctor and (^a or ^d): (static member fmap: (^b -> ^c) * ^d -> ^e) > (a, f) = + ((^a or ^d) : (static member fmap : (^b -> ^c) * ^d -> ^e) (konst a, f)) + + // call overridden replace if present + static member inline replace< ^a, ^b, ^c when ^b: (static member replace: ^a * ^b -> ^c)>(a: ^a, f: ^b) = + (^b : (static member replace: ^a * ^b -> ^c) (a, f)) + +let inline replace_instance< ^a, ^b, ^c, ^d when (^a or ^c): (static member replace: ^b * ^c -> ^d)> (a: ^b, f: ^c) = + ((^a or ^c): (static member replace: ^b * ^c -> ^d) (a, f)) + +// Note the concrete type 'CFunctor' specified in the signature +let inline replace (a: ^a) (f: ^b): ^a0 when (CFunctor or ^b): (static member replace: ^a * ^b -> ^a0) = + replace_instance (a, f) + +type DUType = + | CaseA + | CaseB of int + | CaseC of (int * (string * string) list) + | CaseD of name :string * age:int + | CaseE of client: Client + | CaseF of client: Client (*comment tests*) * (*comment tests*) string * port : int + | CaseG of (obj -> unit) + | CaseH of string * (obj -> unit) + // Check multiple declaration on one line + | CaseI of int | CaseJ of int + | CaseF2 of client: Client // * string * port : int + | FetchDomainsSuccess of Result + | CaseK of ``var with spaces``: string + | CaseL of ``var with spaces``: ``type with spaces`` + | CaseM of v1 : ``type with spaces`` + | CaseN of ``type with spaces`` From e1abb9b85646517dba60c70229c2aa2ede99e5e9 Mon Sep 17 00:00:00 2001 From: Samia <39127633+samiaab1990@users.noreply.github.com> Date: Tue, 30 Nov 2021 15:17:10 -0500 Subject: [PATCH 066/227] enh(themes) Tweak background color for Gradient Light and Gradient Dark (#3408) --- CHANGES.md | 8 +++++++- highlight.js | 1 + src/styles/gradient-dark.css | 4 ++-- src/styles/gradient-light.css | 7 ++++--- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 160000 highlight.js diff --git a/CHANGES.md b/CHANGES.md index 6a8581edfd..a0b1160598 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,11 +21,17 @@ Developer Tools: - (chore) add gzip size compression report (#3400) [Bradley Mackey][] +Themes: + +- Modified background color in css for Gradient Light and Gradient Dark themes [Samia Ali][] + [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey [Melvyn Laïly]: https://github.com/mlaily [Björn Ebbinghaus]: https://github.com/MrEbbinghaus [Josh Goebel]: https://github.com/joshgoebel +[Samia Ali]: https://github.com/samiaab1990 + ## Version 11.3.1 @@ -736,6 +742,7 @@ Parser Engine: - (fix) When ignoring a potential match highlighting can terminate early (#2649) [Josh Goebel][] + New themes: - *Gradient Light* by [Samia Ali]() @@ -771,7 +778,6 @@ Language Improvements: [eytienne]: https://github.com/eytienne [sirosen]: https://github.com/sirosen - ## Version 10.1.1 Fixes: diff --git a/highlight.js b/highlight.js new file mode 160000 index 0000000000..10b322dc43 --- /dev/null +++ b/highlight.js @@ -0,0 +1 @@ +Subproject commit 10b322dc436333b04df8295c9bdf4bad324849e0 diff --git a/src/styles/gradient-dark.css b/src/styles/gradient-dark.css index d9e42138c2..4fb49b2378 100644 --- a/src/styles/gradient-dark.css +++ b/src/styles/gradient-dark.css @@ -6,8 +6,8 @@ Gradient Dark (c) Samia Ali .hljs { -background: rgb(80,31,122); -background: linear-gradient(166deg, rgba(80,31,122,1) 0%, rgba(40,32,179,1) 80%); +background-color: #652487; +background-image: linear-gradient(160deg, #652487 0%, #443ac3 35%, #0174b7 68%, #04988e 100%); color:#e7e4eb; } diff --git a/src/styles/gradient-light.css b/src/styles/gradient-light.css index 574534cb56..a5c4f5edc2 100644 --- a/src/styles/gradient-light.css +++ b/src/styles/gradient-light.css @@ -6,8 +6,8 @@ Gradient Light (c) Samia Ali .hljs { -background: rgb(255,253,141); -background: linear-gradient(142deg, rgba(255,253,141,1) 0%, rgba(252,183,255,1) 35%, rgba(144,236,255,1) 100%); +background-color: #f9ccff; +background-image: linear-gradient(295deg, #f9ccff 0%, #e6bbf9 11%, #9ec6f9 32%, #55e6ee 60%, #91f5d1 74%, #f9ffbf 98%); color:#250482; } @@ -46,6 +46,7 @@ color:#01958B; .hljs-section, .hljs-meta .hljs-keyword, + .hljs-symbol, .hljs-type @@ -64,7 +65,7 @@ color:#01958B; .hljs-string { - color: #38c0ff; + color: #2681ab; } From b1990ceb2622c18f99c75b980dfd4ca8a0f0ed6c Mon Sep 17 00:00:00 2001 From: "Jan T. Sott" Date: Fri, 3 Dec 2021 18:51:42 +0100 Subject: [PATCH 067/227] enh(nsis) Update defines pattern to allow `!` (#3417) Defines can include `!`-characters, as seen in this example: https://nsis.sourceforge.io/Check_if_a_file_exists_at_compile_time --- CHANGES.md | 3 ++- src/languages/nsis.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a0b1160598..7d6636393f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ Grammars: - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] - fix(fsharp) Highlight operators, match type names only in type annotations, support quoted identifiers, and other smaller fixes. [Melvyn Laïly][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] +- enh(nsis) Update defines pattern to allow `!` (#3417) [idleberg][] - fix(clojure) Several issues with Clojure highlighting (#3397) [Björn Ebbinghaus][] - fix(clojure) `comment` macro catches more than it should (#3395) - fix(clojure) `$` in symbol breaks highlighting @@ -31,7 +32,7 @@ Themes: [Björn Ebbinghaus]: https://github.com/MrEbbinghaus [Josh Goebel]: https://github.com/joshgoebel [Samia Ali]: https://github.com/samiaab1990 - +[idleberg]: https://github.com/idleberg ## Version 11.3.1 diff --git a/src/languages/nsis.js b/src/languages/nsis.js index fa3b2e547f..fd64106d27 100644 --- a/src/languages/nsis.js +++ b/src/languages/nsis.js @@ -153,7 +153,7 @@ export default function(hljs) { const DEFINES = { // ${defines} className: 'variable', - begin: /\$+\{[\w.:-]+\}/ + begin: /\$+\{[\!\w.:-]+\}/ }; const VARIABLES = { From 9274b2d2c80dd73f804cdcba48a0d46479df764f Mon Sep 17 00:00:00 2001 From: "Jan T. Sott" Date: Fri, 3 Dec 2021 02:23:19 +0100 Subject: [PATCH 068/227] enh(nsis) Update variables pattern to include `.` --- CHANGES.md | 1 + src/languages/nsis.js | 2 +- test/markup/nsis/variables.expect.txt | 7 +++++++ test/markup/nsis/variables.txt | 7 +++++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/markup/nsis/variables.expect.txt create mode 100644 test/markup/nsis/variables.txt diff --git a/CHANGES.md b/CHANGES.md index 7d6636393f..9b44a09a05 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ Grammars: - enh(clojure) Add `regex` mode to regex literal - fix(clojure) Remove inconsistent/broken highlighting for metadata - enh(clojure) Add `punctuation` mode for commas. + - enh(nsis) Update variables pattern (#3416) [idleberg][] Developer Tools: diff --git a/src/languages/nsis.js b/src/languages/nsis.js index fd64106d27..570d13e0ff 100644 --- a/src/languages/nsis.js +++ b/src/languages/nsis.js @@ -159,7 +159,7 @@ export default function(hljs) { const VARIABLES = { // $variables className: 'variable', - begin: /\$+\w+/, + begin: /\$+\w[\w\.]*/, illegal: /\(\)\{\}/ }; diff --git a/test/markup/nsis/variables.expect.txt b/test/markup/nsis/variables.expect.txt new file mode 100644 index 0000000000..8af1046ba6 --- /dev/null +++ b/test/markup/nsis/variables.expect.txt @@ -0,0 +1,7 @@ +Var CustomVariable +StrCpy $CustomVariable "Hello World" +MessageBox MB_OK "$$CustomVariable is: $CustomVariable" + +Var Variable.With.Dots +StrCpy $Variable.With.Dots "Hello World" +MessageBox MB_OK "$$Variable.With.Dots is: $Variable.With.Dots" diff --git a/test/markup/nsis/variables.txt b/test/markup/nsis/variables.txt new file mode 100644 index 0000000000..a97f06c5ce --- /dev/null +++ b/test/markup/nsis/variables.txt @@ -0,0 +1,7 @@ +Var CustomVariable +StrCpy $CustomVariable "Hello World" +MessageBox MB_OK "$$CustomVariable is: $CustomVariable" + +Var Variable.With.Dots +StrCpy $Variable.With.Dots "Hello World" +MessageBox MB_OK "$$Variable.With.Dots is: $Variable.With.Dots" From b6bfd7edf58e0c27065a79bd1ab074f940e4a2ef Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 18:30:01 -0500 Subject: [PATCH 069/227] enh(nsis) support newer scope `char.escape` --- src/languages/nsis.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languages/nsis.js b/src/languages/nsis.js index 570d13e0ff..fbdfff32ea 100644 --- a/src/languages/nsis.js +++ b/src/languages/nsis.js @@ -184,9 +184,9 @@ export default function(hljs) { ) }; - const METACHARS = { + const ESCAPE_CHARS = { // $\n, $\r, $\t, $$ - className: 'meta', + className: 'char.escape', begin: /\$(\\[nrt]|\$)/ }; @@ -214,7 +214,7 @@ export default function(hljs) { ], illegal: /\n/, contains: [ - METACHARS, + ESCAPE_CHARS, CONSTANTS, DEFINES, VARIABLES, From 4a73506e68f189d7ec8d17464dc17d145ed40037 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 18:25:31 -0500 Subject: [PATCH 070/227] enh(nsis) Var mode, supports /GLOBAL param also --- src/languages/nsis.js | 21 +++++++++++++++++++-- test/markup/nsis/default.expect.txt | 4 ++-- test/markup/nsis/variables.expect.txt | 8 ++++---- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/languages/nsis.js b/src/languages/nsis.js index fbdfff32ea..aedc187ee9 100644 --- a/src/languages/nsis.js +++ b/src/languages/nsis.js @@ -8,6 +8,7 @@ Website: https://nsis.sourceforge.io/Main_Page import * as regex from '../lib/regex.js'; export default function(hljs) { + const regex = hljs.regex; const LANGUAGE_CONSTANTS = [ "ADMINTOOLS", "APPDATA", @@ -493,7 +494,7 @@ export default function(hljs) { "zlib" ]; - const FUNCTION_DEF = { + const FUNCTION_DEFINITION = { match: [ /Function/, /\s+/, @@ -505,6 +506,21 @@ export default function(hljs) { } }; + const VARIABLE_NAME_RE = regex.concat(hljs.IDENT_RE, "(\.", hljs.IDENT_RE, ")*"); + const VARIABLE_DEFINITION = { + match: [ + /Var/, + /\s+/, + /(?:\/GLOBAL\s+)?/, + VARIABLE_NAME_RE + ], + scope: { + 1: "keyword", + 3: "params", + 4: "variable" + } + }; + return { name: 'NSIS', case_insensitive: true, @@ -522,7 +538,8 @@ export default function(hljs) { relevance: 0 } ), - FUNCTION_DEF, + VARIABLE_DEFINITION, + FUNCTION_DEFINITION, { beginKeywords: 'Function PageEx Section SectionGroup FunctionEnd SectionEnd', }, diff --git a/test/markup/nsis/default.expect.txt b/test/markup/nsis/default.expect.txt index 9574047d8f..24c8e434a1 100644 --- a/test/markup/nsis/default.expect.txt +++ b/test/markup/nsis/default.expect.txt @@ -32,6 +32,6 @@ ; Functions Function .onInit DetailPrint "The install button reads $(^InstallBtn)" - DetailPrint 'Here comes a$\n$\rline-break!' - DetailPrint `Escape the dollar-sign: $$` + DetailPrint 'Here comes a$\n$\rline-break!' + DetailPrint `Escape the dollar-sign: $$` FunctionEnd diff --git a/test/markup/nsis/variables.expect.txt b/test/markup/nsis/variables.expect.txt index 8af1046ba6..7798d8b3d6 100644 --- a/test/markup/nsis/variables.expect.txt +++ b/test/markup/nsis/variables.expect.txt @@ -1,7 +1,7 @@ -Var CustomVariable +Var CustomVariable StrCpy $CustomVariable "Hello World" -MessageBox MB_OK "$$CustomVariable is: $CustomVariable" +MessageBox MB_OK "$$CustomVariable is: $CustomVariable" -Var Variable.With.Dots +Var Variable.With.Dots StrCpy $Variable.With.Dots "Hello World" -MessageBox MB_OK "$$Variable.With.Dots is: $Variable.With.Dots" +MessageBox MB_OK "$$Variable.With.Dots is: $Variable.With.Dots" From b46301e3184f885da56a27e14c638c1183672c00 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 18:53:56 -0500 Subject: [PATCH 071/227] (security) fix reDOS caught by tests --- src/languages/nsis.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/languages/nsis.js b/src/languages/nsis.js index aedc187ee9..40f359d731 100644 --- a/src/languages/nsis.js +++ b/src/languages/nsis.js @@ -506,7 +506,9 @@ export default function(hljs) { } }; - const VARIABLE_NAME_RE = regex.concat(hljs.IDENT_RE, "(\.", hljs.IDENT_RE, ")*"); + // Var Custom.Variable.Name.Item + // Var /GLOBAL Custom.Variable.Name.Item + const VARIABLE_NAME_RE = /[A-Za-z][\w.]*/; const VARIABLE_DEFINITION = { match: [ /Var/, From 91c522877af9c016fbb862fa3f429e35ef65f824 Mon Sep 17 00:00:00 2001 From: "Jan T. Sott" Date: Mon, 6 Dec 2021 21:50:30 +0100 Subject: [PATCH 072/227] enh(nsis) Update language string pattern (#3420) --- CHANGES.md | 1 + src/languages/nsis.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 9b44a09a05..78c9fbe6c7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ Grammars: - fix(fsharp) Highlight operators, match type names only in type annotations, support quoted identifiers, and other smaller fixes. [Melvyn Laïly][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] - enh(nsis) Update defines pattern to allow `!` (#3417) [idleberg][] +- enh(nsis) Update language strings pattern to allow `!` (#3420) [idleberg][] - fix(clojure) Several issues with Clojure highlighting (#3397) [Björn Ebbinghaus][] - fix(clojure) `comment` macro catches more than it should (#3395) - fix(clojure) `$` in symbol breaks highlighting diff --git a/src/languages/nsis.js b/src/languages/nsis.js index 40f359d731..17438c682d 100644 --- a/src/languages/nsis.js +++ b/src/languages/nsis.js @@ -167,7 +167,7 @@ export default function(hljs) { const LANGUAGES = { // $(language_strings) className: 'variable', - begin: /\$+\([\w^.:-]+\)/ + begin: /\$+\([\w^.:!-]+\)/ }; const PARAMETERS = { From b63b12d6918e0b3ed1f77e3183a2c5f02e7fefd8 Mon Sep 17 00:00:00 2001 From: Deepto Date: Tue, 7 Dec 2021 05:38:47 +0530 Subject: [PATCH 073/227] enh(MATLAB ) Removed backslashes as escape characters (#3354) * removed backslashes as escape characters * fixup tests Co-authored-by: Josh Goebel --- src/languages/matlab.js | 2 -- test/markup/matlab/transpose.expect.txt | 4 ++-- test/markup/matlab/transpose.txt | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/languages/matlab.js b/src/languages/matlab.js index 06f99fe23e..684b0c5188 100644 --- a/src/languages/matlab.js +++ b/src/languages/matlab.js @@ -80,7 +80,6 @@ export default function(hljs) { className: 'string', begin: '\'', end: '\'', contains: [ - hljs.BACKSLASH_ESCAPE, {begin: '\'\''}] }, { @@ -92,7 +91,6 @@ export default function(hljs) { className: 'string', begin: '"', end: '"', contains: [ - hljs.BACKSLASH_ESCAPE, {begin: '""'} ], starts: TRANSPOSE diff --git a/test/markup/matlab/transpose.expect.txt b/test/markup/matlab/transpose.expect.txt index 996c83bdac..c19049c508 100644 --- a/test/markup/matlab/transpose.expect.txt +++ b/test/markup/matlab/transpose.expect.txt @@ -31,9 +31,9 @@ c2 = {'a',& s = ['a','bc']'; % you can transpose vectors of strings (they are really 'char' arrays) s = s'; % and transpose back % (s')' is a double transpose of a string -x = [(s')', ' xyz ', 'a single quote in a string'', escape \', two quotes in a string''''']; +x = [(s')', ' xyz ', 'a single quote in a string'', two quotes in a string''''']; -s2 = "abc\"def""ghi"; % newer versions of MATLAB support double quoted strings +s2 = "abcdef""ghi"; % newer versions of MATLAB support double quoted strings s3 = (["abc", "defg"]')'; % transpose a vectors of quoted string twice s4 = "abc"!; % transpose a quoted string diff --git a/test/markup/matlab/transpose.txt b/test/markup/matlab/transpose.txt index d1da28e3df..9f69a0cc9f 100644 --- a/test/markup/matlab/transpose.txt +++ b/test/markup/matlab/transpose.txt @@ -31,9 +31,9 @@ c2 = {'a','bc'}'; % transpose of a cell of strings s = ['a','bc']'; % you can transpose vectors of strings (they are really 'char' arrays) s = s'; % and transpose back % (s')' is a double transpose of a string -x = [(s')', ' xyz ', 'a single quote in a string'', escape \', two quotes in a string''''']; +x = [(s')', ' xyz ', 'a single quote in a string'', two quotes in a string''''']; -s2 = "abc\"def""ghi"; % newer versions of MATLAB support double quoted strings +s2 = "abcdef""ghi"; % newer versions of MATLAB support double quoted strings s3 = (["abc", "defg"]')'; % transpose a vectors of quoted string twice s4 = "abc"!; % transpose a quoted string From 5c8c87660ab7c7919cbcccf8a51ce07040562ef5 Mon Sep 17 00:00:00 2001 From: MrYamous Date: Tue, 7 Dec 2021 21:28:58 +0100 Subject: [PATCH 074/227] enh(twig): update keywords list (#3415) * enh(twig): update keywords list * chore(twig) major twig refatoring, add new functionality (Josh) Co-authored-by: Josh Goebel --- CHANGES.md | 2 + src/languages/twig.js | 219 ++++++++++++++---- .../clojure/globals_definition.expect.txt | 2 +- .../markup/clojure/symbols-numbers.expect.txt | 2 +- test/markup/fsharp/bang-keywords.expect.txt | 2 +- .../fsharp/computation-expressions.expect.txt | 2 +- test/markup/fsharp/types.expect.txt | 2 +- .../twig/filter_with_underscore.expect.txt | 2 +- test/markup/twig/template_tags.expect.txt | 12 +- tools/checkAutoDetect.js | 2 +- 10 files changed, 195 insertions(+), 52 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 78c9fbe6c7..de2488e9ea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- enh(twig) update keywords list (#3415) [Matthieu Lempereur][] - fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][] - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] @@ -34,6 +35,7 @@ Themes: [Björn Ebbinghaus]: https://github.com/MrEbbinghaus [Josh Goebel]: https://github.com/joshgoebel [Samia Ali]: https://github.com/samiaab1990 +[Matthieu Lempereur]: https://github.com/MrYamous [idleberg]: https://github.com/idleberg ## Version 11.3.1 diff --git a/src/languages/twig.js b/src/languages/twig.js index 4ea7bd041a..3e4a26257d 100644 --- a/src/languages/twig.js +++ b/src/languages/twig.js @@ -8,67 +8,208 @@ Category: template */ export default function(hljs) { - var PARAMS = { - className: 'params', - begin: '\\(', end: '\\)' + const regex = hljs.regex; + const FUNCTION_NAMES = [ + "attribute", + "block", + "constant", + "country_timezones", + "cycle", + "date", + "dump", + "html_classes", + "include", + "max", + "min", + "parent", + "random", + "range", + "source", + "template_from_string" + ]; + + const FILTERS = [ + "abs", + "batch", + "capitalize", + "column", + "convert_encoding", + "country_name", + "currency_name", + "currency_symbol", + "data_uri", + "date", + "date_modify", + "default", + "escape", + "filter", + "first", + "format", + "format_currency", + "format_date", + "format_datetime", + "format_number", + "format_time", + "html_to_markdown", + "inky_to_html", + "inline_css", + "join", + "json_encode", + "keys", + "language_name", + "last", + "length", + "locale_name", + "lower", + "map", + "markdown", + "markdown_to_html", + "merge", + "nl2br", + "number_format", + "raw", + "reduce", + "replace", + "reverse", + "round", + "slice", + "slug", + "sort", + "spaceless", + "split", + "striptags", + "timezone_name", + "title", + "trim", + "u|0", + "upper", + "url_encode" + ]; + + let TAG_NAMES = [ + "apply", + "autoescape", + "block", + "cache", + "deprecated", + "do", + "embed", + "extends", + "filter", + "flush", + "for", + "from", + "if", + "import", + "include", + "macro", + "sandbox", + "set", + "use", + "verbatim", + "with" + ]; + + TAG_NAMES = TAG_NAMES.concat(TAG_NAMES.map(t => `end${t}`)); + + const STRING = { + scope: 'string', + variants: [ + { + begin: /'/, + end: /'/ + }, + { + begin: /"/, + end: /"/ + }, + ] }; - var FUNCTION_NAMES = 'attribute block constant cycle date dump include ' + - 'max min parent random range source template_from_string'; + const NUMBER = { + scope: "number", + match: /\d+/ + }; - var FUNCTIONS = { - beginKeywords: FUNCTION_NAMES, - keywords: {name: FUNCTION_NAMES}, - relevance: 0, + const PARAMS = { + begin: /\(/, + end: /\)/, + excludeBegin: true, + excludeEnd: true, contains: [ - PARAMS + STRING, + NUMBER ] }; - var FILTER = { - begin: /\|[A-Za-z_]+:?/, - keywords: - 'abs batch capitalize column convert_encoding date date_modify default ' + - 'escape filter first format inky_to_html inline_css join json_encode keys last ' + - 'length lower map markdown merge nl2br number_format raw reduce replace ' + - 'reverse round slice sort spaceless split striptags title trim upper url_encode', + + const FUNCTIONS = { + beginKeywords: FUNCTION_NAMES.join(" "), + keywords: { name: FUNCTION_NAMES }, + relevance: 0, + contains: [ PARAMS ] + }; + + const FILTER = { + match: /\|(?=[A-Za-z_]+:?)/, + beginScope: "punctuation", + relevance: 0, contains: [ - FUNCTIONS + { + match: /[A-Za-z_]+:?/, + keywords: FILTERS + }, ] }; - var TAGS = 'apply autoescape block deprecated do embed extends filter flush for from ' + - 'if import include macro sandbox set use verbatim with'; + const tagNamed = (tagnames, {relevance}) => { + return { + beginScope: { + 1: 'template-tag', + 3: 'name' + }, + relevance: relevance || 2, + endScope: 'template-tag', + begin: [ + /\{%/, + /\s*/, + regex.either(...tagnames) + ], + end: /%\}/, + keywords: "in", + contains: [ + FILTER, + FUNCTIONS, + STRING, + NUMBER + ] + }; + }; - TAGS = TAGS + ' ' + TAGS.split(' ').map(function(t){return 'end' + t}).join(' '); + const CUSTOM_TAG_RE = /[a-z_]+/; + const TAG = tagNamed(TAG_NAMES, { relevance: 2 }); + const CUSTOM_TAG = tagNamed([ CUSTOM_TAG_RE ], { relevance: 1 }); return { name: 'Twig', - aliases: ['craftcms'], + aliases: [ 'craftcms' ], case_insensitive: true, subLanguage: 'xml', contains: [ hljs.COMMENT(/\{#/, /#\}/), + TAG, + CUSTOM_TAG, { - className: 'template-tag', - begin: /\{%/, end: /%\}/, + className: 'template-variable', + begin: /\{\{/, + end: /\}\}/, contains: [ - { - className: 'name', - begin: /\w+/, - keywords: TAGS, - starts: { - endsWithParent: true, - contains: [FILTER, FUNCTIONS], - relevance: 0 - } - } + 'self', + FILTER, + FUNCTIONS, + STRING, + NUMBER ] - }, - { - className: 'template-variable', - begin: /\{\{/, end: /\}\}/, - contains: ['self', FILTER, FUNCTIONS] } ] }; diff --git a/test/markup/clojure/globals_definition.expect.txt b/test/markup/clojure/globals_definition.expect.txt index 832e283cd4..efc8a15c9a 100644 --- a/test/markup/clojure/globals_definition.expect.txt +++ b/test/markup/clojure/globals_definition.expect.txt @@ -69,4 +69,4 @@ string" ;; create a couple shapes and get their area (def myCircle (Circle. 10)) -(def mySquare (Square. 5 11)) \ No newline at end of file +(def mySquare (Square. 5 11)) diff --git a/test/markup/clojure/symbols-numbers.expect.txt b/test/markup/clojure/symbols-numbers.expect.txt index 7813d22876..2808223dcc 100644 --- a/test/markup/clojure/symbols-numbers.expect.txt +++ b/test/markup/clojure/symbols-numbers.expect.txt @@ -1,4 +1,4 @@ (def +x [(a 1) +2 -3.0 y-5]) (System/getProperty "java.vm.version") (.getEnclosingClass java.util.Map$Entry) -(java.util.Map$Entry. .getEnclosingClass) +(java.util.Map$Entry. .getEnclosingClass) \ No newline at end of file diff --git a/test/markup/fsharp/bang-keywords.expect.txt b/test/markup/fsharp/bang-keywords.expect.txt index c47d939e94..f681697fdf 100644 --- a/test/markup/fsharp/bang-keywords.expect.txt +++ b/test/markup/fsharp/bang-keywords.expect.txt @@ -1 +1 @@ -let! (result2 : byte[]) = stream.AsyncRead(bufferSize) \ No newline at end of file +let! (result2 : byte[]) = stream.AsyncRead(bufferSize) diff --git a/test/markup/fsharp/computation-expressions.expect.txt b/test/markup/fsharp/computation-expressions.expect.txt index 76cb4486bd..af296f3f2c 100644 --- a/test/markup/fsharp/computation-expressions.expect.txt +++ b/test/markup/fsharp/computation-expressions.expect.txt @@ -20,4 +20,4 @@ return result } -let result = work |> Async.RunSynchronously \ No newline at end of file +let result = work |> Async.RunSynchronously diff --git a/test/markup/fsharp/types.expect.txt b/test/markup/fsharp/types.expect.txt index 0ad8b0c6a7..e48881af06 100644 --- a/test/markup/fsharp/types.expect.txt +++ b/test/markup/fsharp/types.expect.txt @@ -140,4 +140,4 @@ | CaseK of ``var with spaces``: string | CaseL of ``var with spaces``: ``type with spaces`` | CaseM of v1 : ``type with spaces`` - | CaseN of ``type with spaces`` \ No newline at end of file + | CaseN of ``type with spaces`` diff --git a/test/markup/twig/filter_with_underscore.expect.txt b/test/markup/twig/filter_with_underscore.expect.txt index 72c93fd877..9d2928531a 100644 --- a/test/markup/twig/filter_with_underscore.expect.txt +++ b/test/markup/twig/filter_with_underscore.expect.txt @@ -1 +1 @@ -{{ "string with spaces"|url_encode }} \ No newline at end of file +{{ "string with spaces"|url_encode }} \ No newline at end of file diff --git a/test/markup/twig/template_tags.expect.txt b/test/markup/twig/template_tags.expect.txt index 410fb24347..0127a33510 100644 --- a/test/markup/twig/template_tags.expect.txt +++ b/test/markup/twig/template_tags.expect.txt @@ -1,12 +1,12 @@ -{% if posts|length %} - {% for article in articles %} +{% if posts|length %} + {% for article in articles %} &lt;div&gt; - {{ article.title|upper() }} + {{ article.title|upper() }} {# outputs 'WELCOME' #} &lt;/div&gt; - {% endfor %} -{% endif %} + {% endfor %} +{% endif %} -{% set user = json_encode(user) %} +{% set user = json_encode(user) %} \ No newline at end of file diff --git a/tools/checkAutoDetect.js b/tools/checkAutoDetect.js index 0a725985a8..0da66c8dfd 100755 --- a/tools/checkAutoDetect.js +++ b/tools/checkAutoDetect.js @@ -2,7 +2,7 @@ 'use strict'; const fs = require('fs'); -const hljs = require('../build.js'); +const hljs = require('../build/lib/index.js'); const path = require('path'); const utility = require('../test/utility.js'); const Table = require('cli-table'); From 0bf3adeecd5ba76cef8ee843e38722089b232da1 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 8 Dec 2021 18:40:50 -0500 Subject: [PATCH 075/227] (docs) Make example 100% explicit regarding minified files --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96a8ca1c06..19a7ae0c88 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ The bare minimum for using highlight.js on a web page is linking to the library along with one of the themes and calling [`highlightAll`][1]: ```html - + ``` From 4ddfbe4bd469d582c7577e73f859d56334361bde Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 10:40:17 -0500 Subject: [PATCH 076/227] enh(js/ts) fix => async function title highlights (#3414) --- CHANGES.md | 1 + src/languages/javascript.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index de2488e9ea..262bc2100a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- enh(js/ts) fix => async function title highlights (#3405) [Josh Goebel][] - enh(twig) update keywords list (#3415) [Matthieu Lempereur][] - fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][] - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] diff --git a/src/languages/javascript.js b/src/languages/javascript.js index b09065dd85..b3282e1725 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -406,8 +406,10 @@ export default function(hljs) { /const|var|let/, /\s+/, IDENT_RE, /\s*/, /=\s*/, + /(async\s*)?/, // async is optional regex.lookahead(FUNC_LEAD_IN_RE) ], + keywords: "async", className: { 1: "keyword", 3: "title.function" From c37ef5b7b906bf0c757b94d2aae4947857b527f7 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 10:52:21 -0500 Subject: [PATCH 077/227] (enh) improve default theme accessibility (#3402) * first pass at accessibility report in checkTheme * resolve CSS color names when necessary * (enh) default Dark theme is WCAG AAA wrt contrast * (enh) improve accessibility of default theme --- CHANGES.md | 9 ++++- package-lock.json | 55 ++++++++++++++++++++++++++++- package.json | 4 ++- src/styles/dark.css | 4 +-- src/styles/default.css | 10 +++--- tools/checkTheme.js | 78 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 150 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 262bc2100a..fc60632dd1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,11 @@ -## Version 11.3.2 (most likely) +## Version 11.4 (most likely) + +Themes: + +- `Default` is now much closer WCAG AA (contrast) (#3402) [Josh Goebel] +- `Dark` now meets WCAG AA (contrast) (#3402) [Josh Goebel] + +These changes should be for the better and should not be super noticeable but if you're super picky about your colors you may want to intervene here or copy over the older themes from 11.3 or prior. Grammars: diff --git a/package-lock.json b/package-lock.json index 877b12bf68..55b90dec9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "colors": "^1.1.2", "commander": "8.2", "css": "^3.0.0", + "css-color-names": "^1.0.1", "deep-freeze-es6": "^1.4.1", "del": "^6.0.0", "dependency-resolver": "^2.0.1", @@ -38,7 +39,8 @@ "should": "^13.2.3", "terser": "^5.7.0", "tiny-worker": "^2.3.0", - "typescript": "^4.4.4" + "typescript": "^4.4.4", + "wcag-contrast": "^3.0.0" }, "engines": { "node": ">=12.0.0" @@ -1042,6 +1044,15 @@ "source-map-resolve": "^0.6.0" } }, + "node_modules/css-color-names": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-1.0.1.tgz", + "integrity": "sha512-/loXYOch1qU1biStIFsHH8SxTmOseh1IJqFvy8IujXOm1h+QjUdDhkzOrR5HG8K8mlxREj0yfi8ewCHx0eMxzA==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -3358,6 +3369,15 @@ "node": ">=8" } }, + "node_modules/relative-luminance": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/relative-luminance/-/relative-luminance-2.0.1.tgz", + "integrity": "sha512-wFuITNthJilFPwkK7gNJcULxXBcfFZvZORsvdvxeOdO44wCeZnuQkf3nFFzOR/dpJNxYsdRZJLsepWbyKhnMww==", + "dev": true, + "dependencies": { + "esm": "^3.0.84" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4075,6 +4095,15 @@ "node": ">=12" } }, + "node_modules/wcag-contrast": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/wcag-contrast/-/wcag-contrast-3.0.0.tgz", + "integrity": "sha512-RWbpg/S7FOXDCwqC2oFhN/vh8dHzj0OS6dpyOSDHyQFSmqmR+lAUStV/ziTT1GzDqL9wol+nZQB4vCi5yEak+w==", + "dev": true, + "dependencies": { + "relative-luminance": "^2.0.0" + } + }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -5111,6 +5140,12 @@ "source-map-resolve": "^0.6.0" } }, + "css-color-names": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-1.0.1.tgz", + "integrity": "sha512-/loXYOch1qU1biStIFsHH8SxTmOseh1IJqFvy8IujXOm1h+QjUdDhkzOrR5HG8K8mlxREj0yfi8ewCHx0eMxzA==", + "dev": true + }, "cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -6839,6 +6874,15 @@ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, + "relative-luminance": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/relative-luminance/-/relative-luminance-2.0.1.tgz", + "integrity": "sha512-wFuITNthJilFPwkK7gNJcULxXBcfFZvZORsvdvxeOdO44wCeZnuQkf3nFFzOR/dpJNxYsdRZJLsepWbyKhnMww==", + "dev": true, + "requires": { + "esm": "^3.0.84" + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -7399,6 +7443,15 @@ "xml-name-validator": "^4.0.0" } }, + "wcag-contrast": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/wcag-contrast/-/wcag-contrast-3.0.0.tgz", + "integrity": "sha512-RWbpg/S7FOXDCwqC2oFhN/vh8dHzj0OS6dpyOSDHyQFSmqmR+lAUStV/ziTT1GzDqL9wol+nZQB4vCi5yEak+w==", + "dev": true, + "requires": { + "relative-luminance": "^2.0.0" + } + }, "webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", diff --git a/package.json b/package.json index a6376bd740..985b47fdd6 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "colors": "^1.1.2", "commander": "8.2", "css": "^3.0.0", + "css-color-names": "^1.0.1", "deep-freeze-es6": "^1.4.1", "del": "^6.0.0", "dependency-resolver": "^2.0.1", @@ -84,6 +85,7 @@ "should": "^13.2.3", "terser": "^5.7.0", "tiny-worker": "^2.3.0", - "typescript": "^4.4.4" + "typescript": "^4.4.4", + "wcag-contrast": "^3.0.0" } } diff --git a/src/styles/dark.css b/src/styles/dark.css index 34708897f3..052dbc94f1 100644 --- a/src/styles/dark.css +++ b/src/styles/dark.css @@ -6,7 +6,7 @@ Dark style from softwaremaniacs.org (c) Ivan Sagalaev Math.round(x*100)/100; + +class CSSRule { + constructor(rule, body) { + this.rule = rule; + if (rule.declarations) { + this.bg = rule.declarations.find(x => x.property =="background")?.value; + this.fg = rule.declarations.find(x => x.property =="color")?.value; + + if (this.bg) { + this.bg = csscolors[this.bg] || this.bg; + } + if (this.fg) { + this.fg = csscolors[this.fg] || this.fg; + } + + // inherit from body if we're missing fg or bg + if (this.hasColor) { + if (!this.bg) this.bg = body.background; + if (!this.fg) this.fg = body.foreground; + } + } + } + get background() { + return this.bg + } + + get foreground() { + return this.fg + } + get hasColor() { + if (!this.rule.declarations) return false; + return this.fg || this.bg; + } + toString() { + return ` ${this.foreground} on ${this.background}` + } + + contrastRatio() { + if (!this.foreground) return "unknown (no fg)" + if (!this.background) return "unknown (no bg)" + return round2(wcagContrast.hex(this.foreground, this.background)); + } +} + +function contrast_report(rules) { + console.log("Accessibility Report".yellow); + + var hljs = rules.find (x => x.selectors && x.selectors.includes(".hljs")); + var body = new CSSRule(hljs); + const table = new Table({ + chars: {'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': ''}, + head: ['ratio', 'selector', 'fg', 'bg'], + colWidths: [7, 40, 10, 10], + style: { + head: ['grey'] + } + }); + + rules.forEach(rule => { + var color = new CSSRule(rule, body); + if (!color.hasColor) return; + table.push([ + color.contrastRatio(), + rule.selectors, + color.foreground, + color.background + ]) + // console.log(r.selectors[0], color.contrastRatio(), color.toString()); + }) + console.log(table.toString()) +} + function validate(data) { const rules = data.stylesheet.rules; @@ -195,6 +271,8 @@ function validate(data) { check_group(CODE, rules); check_group(OTHER, rules); check_group(HIGH_FIDELITY, rules); + + contrast_report(rules); } process.argv.shift(); From 84719c17a51d7bb045f2df441b9c00f871f7c063 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 10:53:24 -0500 Subject: [PATCH 078/227] (chore) es6 via CDN (#3412) --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 19a7ae0c88..05d926f528 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,9 @@ detection. - [ES6 Modules / `import`](#es6-modules--import) - [Getting the Library](#getting-the-library) - [Fetch via CDN](#fetch-via-cdn) + - [cdnjs (link)](#cdnjs-link) + - [jsdelivr (link)](#jsdelivr-link) + - [unpkg (link)](#unpkg-link) - [Download prebuilt CDN assets](#download-prebuilt-cdn-assets) - [Download from our website](#download-from-our-website) - [Install via NPM package](#install-via-npm-package) @@ -268,13 +271,16 @@ const highlightedCode = hljs.highlight('Hello World!', {language: ' ### ES6 Modules / `import` +*Note: You can also import directly from fully static URLs, such as our very own pre-built +ES6 Module CDN resources. See [Fetch via CDN](#fetch-via-cdn) for specific examples.* + The default import will register all languages: ```js import hljs from 'highlight.js'; ``` - It is more efficient to import only the library and register the languages you need: +It is more efficient to import only the library and register the languages you need: ```js import hljs from 'highlight.js/lib/core'; @@ -317,7 +323,9 @@ A prebuilt version of Highlight.js bundled with many common languages is hosted When using Highlight.js via CDN you can use Subresource Integrity for additional security. For details see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md). -**cdnjs** ([link](https://cdnjs.com/libraries/highlight.js)) +#### cdnjs ([link](https://cdnjs.com/libraries/highlight.js)) + +##### Common JS ```html @@ -326,7 +334,23 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md ``` -**jsdelivr** ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) +##### ES6 Modules + +````html + + + +```` + + +#### jsdelivr ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) + +##### Common JS ```html @@ -335,7 +359,21 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md ``` -**unpkg** ([link](https://unpkg.com/browse/@highlightjs/cdn-assets/)) +##### ES6 Modules + +```html + + +``` + +#### unpkg ([link](https://unpkg.com/browse/@highlightjs/cdn-assets/)) + +##### Common JS ```html @@ -344,6 +382,19 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md ``` +##### ES6 Modules + +```html + + +``` + + **Note:** *The CDN-hosted `highlight.min.js` package doesn't bundle every language.* It would be very large. You can find our list of "common" languages that we bundle by default on our [download page][5]. From ba806ed60fb027bd911aad5e2e0d6529099fcd13 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 13:26:06 -0500 Subject: [PATCH 079/227] enh(js/ts) improve CLASS_REFERENCE (#3411) --- CHANGES.md | 1 + src/languages/javascript.js | 12 ++++++++---- test/markup/javascript/class.expect.txt | 5 +++++ test/markup/javascript/class.txt | 5 +++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fc60632dd1..b2294ae731 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Grammars: - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] - fix(fsharp) Highlight operators, match type names only in type annotations, support quoted identifiers, and other smaller fixes. [Melvyn Laïly][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] +- enh(js/ts) improve `CLASS_REFERENCE` (#3411) [Josh Goebel][] - enh(nsis) Update defines pattern to allow `!` (#3417) [idleberg][] - enh(nsis) Update language strings pattern to allow `!` (#3420) [idleberg][] - fix(clojure) Several issues with Clojure highlighting (#3397) [Björn Ebbinghaus][] diff --git a/src/languages/javascript.js b/src/languages/javascript.js index b3282e1725..9b748eb1f7 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -290,10 +290,14 @@ export default function(hljs) { regex.either( // Hard coded exceptions /\bJSON/, - // Float32Array - /\b[A-Z][a-z]+([A-Z][a-z]+|\d)*/, - // CSSFactory - /\b[A-Z]{2,}([A-Z][a-z]+|\d)+/, + // Float32Array, OutT + /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/, + // CSSFactory, CSSFactoryT + /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*|\d)*/, + // FPs, FPsT + /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*|\d)*/, + // P + // single letters are not highlighted // BLAH // this will be flagged as a UPPER_CASE_CONSTANT instead ), diff --git a/test/markup/javascript/class.expect.txt b/test/markup/javascript/class.expect.txt index 3ef253c364..7e1dd67c80 100644 --- a/test/markup/javascript/class.expect.txt +++ b/test/markup/javascript/class.expect.txt @@ -33,3 +33,8 @@ CSSParser Float32Array BigInt64Array +FPs +OutT +InT +CSSParserT +IResponseTsS diff --git a/test/markup/javascript/class.txt b/test/markup/javascript/class.txt index bebfe77f90..4badef7377 100644 --- a/test/markup/javascript/class.txt +++ b/test/markup/javascript/class.txt @@ -33,3 +33,8 @@ SelfDrivingTruck CSSParser Float32Array BigInt64Array +FPs +OutT +InT +CSSParserT +IResponseTsS From 9e33f830558e77a4938bab661836780761d834d2 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 13:31:58 -0500 Subject: [PATCH 080/227] (chore) fix regex backtracking from prior PR --- src/languages/javascript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 9b748eb1f7..e3ec15a04c 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -293,9 +293,9 @@ export default function(hljs) { // Float32Array, OutT /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/, // CSSFactory, CSSFactoryT - /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*|\d)*/, + /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/, // FPs, FPsT - /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*|\d)*/, + /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/, // P // single letters are not highlighted // BLAH From c06463af7087f29c1ad5d95c700ad038d3f33613 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 18:29:13 -0500 Subject: [PATCH 081/227] chore(php) rewrite keyword lists to arrays --- src/languages/php.js | 204 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 189 insertions(+), 15 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index ce0af400a8..b051c266b5 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -71,36 +71,210 @@ export default function(hljs) { ], relevance: 0 }; - const KEYWORDS = { - keyword: + const LITERALS = [ + "false", + "null", + "true" + ]; + const KWS = [ // Magic constants: // - '__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ ' + + "__CLASS__", + "__DIR__", + "__FILE__", + "__FUNCTION__", + "__LINE__", + "__METHOD__", + "__NAMESPACE__", + "__TRAIT__", // Function that look like language construct or language construct that look like function: // List of keywords that may not require parenthesis - 'die echo exit include include_once print require require_once ' + + "die", + "echo", + "exit", + "include", + "include_once", + "print", + "require", + "require_once", // These are not language construct (function) but operate on the currently-executing function and can access the current symbol table // 'compact extract func_get_arg func_get_args func_num_args get_called_class get_parent_class ' + // Other keywords: // // - 'array abstract and as binary bool boolean break callable case catch class clone const continue declare ' + - 'default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends ' + - 'final finally float for foreach from global goto if implements instanceof insteadof int integer interface ' + - 'isset iterable list match|0 mixed new object or private protected public real return string switch throw trait ' + - 'try unset use var void while xor yield', - literal: 'false null true', - built_in: + "array", + "abstract", + "and", + "as", + "binary", + "bool", + "boolean", + "break", + "callable", + "case", + "catch", + "class", + "clone", + "const", + "continue", + "declare", + "default", + "do", + "double", + "else", + "elseif", + "empty", + "enddeclare", + "endfor", + "endforeach", + "endif", + "endswitch", + "endwhile", + "enum", + "eval", + "extends", + "final", + "finally", + "float", + "for", + "foreach", + "from", + "global", + "goto", + "if", + "implements", + "instanceof", + "insteadof", + "int", + "integer", + "interface", + "isset", + "iterable", + "list", + "match|0", + "mixed", + "new", + "object", + "or", + "private", + "protected", + "public", + "real", + "return", + "string", + "switch", + "throw", + "trait", + "try", + "unset", + "use", + "var", + "void", + "while", + "xor", + "yield" + ]; + + const BUILT_INS = [ // Standard PHP library: // - 'Error|0 ' + // error is too common a name esp since PHP is case in-sensitive - 'AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ' + + "Error|0", + "AppendIterator", + "ArgumentCountError", + "ArithmeticError", + "ArrayIterator", + "ArrayObject", + "AssertionError", + "BadFunctionCallException", + "BadMethodCallException", + "CachingIterator", + "CallbackFilterIterator", + "CompileError", + "Countable", + "DirectoryIterator", + "DivisionByZeroError", + "DomainException", + "EmptyIterator", + "ErrorException", + "Exception", + "FilesystemIterator", + "FilterIterator", + "GlobIterator", + "InfiniteIterator", + "InvalidArgumentException", + "IteratorIterator", + "LengthException", + "LimitIterator", + "LogicException", + "MultipleIterator", + "NoRewindIterator", + "OutOfBoundsException", + "OutOfRangeException", + "OuterIterator", + "OverflowException", + "ParentIterator", + "ParseError", + "RangeException", + "RecursiveArrayIterator", + "RecursiveCachingIterator", + "RecursiveCallbackFilterIterator", + "RecursiveDirectoryIterator", + "RecursiveFilterIterator", + "RecursiveIterator", + "RecursiveIteratorIterator", + "RecursiveRegexIterator", + "RecursiveTreeIterator", + "RegexIterator", + "RuntimeException", + "SeekableIterator", + "SplDoublyLinkedList", + "SplFileInfo", + "SplFileObject", + "SplFixedArray", + "SplHeap", + "SplMaxHeap", + "SplMinHeap", + "SplObjectStorage", + "SplObserver", + "SplObserver", + "SplPriorityQueue", + "SplQueue", + "SplStack", + "SplSubject", + "SplSubject", + "SplTempFileObject", + "TypeError", + "UnderflowException", + "UnexpectedValueException", + "UnhandledMatchError", // Reserved interfaces: // - 'ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap ' + + "ArrayAccess", + "Closure", + "Generator", + "Iterator", + "IteratorAggregate", + "Serializable", + "Stringable", + "Throwable", + "Traversable", + "WeakReference", + "WeakMap", // Reserved classes: // - 'Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass' + "Directory", + "__PHP_Incomplete_Class", + "parent", + "php_user_filter", + "self", + "static", + "stdClass" + ]; + + const KEYWORDS = { + keyword: KWS, + literal: LITERALS, + built_in: BUILT_INS }; return { case_insensitive: true, From 8d6265b0406aa4ad6d8808282c75f185371cd63f Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 18:38:58 -0500 Subject: [PATCH 082/227] enh(php) improve namespace/use highlighting --- src/languages/php.js | 17 +++++++++++++++-- test/markup/php/namespace.expect.txt | 8 ++++++++ test/markup/php/namespace.txt | 8 ++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 test/markup/php/namespace.expect.txt create mode 100644 test/markup/php/namespace.txt diff --git a/src/languages/php.js b/src/languages/php.js index b051c266b5..2e9c8c318d 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -355,18 +355,31 @@ export default function(hljs) { hljs.UNDERSCORE_TITLE_MODE ] }, + // both use and namespace still use "old style" rules (vs multi-match) + // because the namespace name can include `\` and we still want each + // element to be treated as it's own *individual* title { beginKeywords: 'namespace', relevance: 0, end: ';', illegal: /[.']/, - contains: [hljs.UNDERSCORE_TITLE_MODE] + contains: [ + hljs.inherit(hljs.UNDERSCORE_TITLE_MODE, { scope: "title.class" }) + ] }, { beginKeywords: 'use', relevance: 0, end: ';', - contains: [hljs.UNDERSCORE_TITLE_MODE] + contains: [ + // TODO: title.function vs title.class + { + match: /\b(as|const|function)\b/, + scope: "keyword" + }, + // TODO: could be title.class or title.function + hljs.UNDERSCORE_TITLE_MODE + ] }, STRING, NUMBER diff --git a/test/markup/php/namespace.expect.txt b/test/markup/php/namespace.expect.txt new file mode 100644 index 0000000000..8b907e1873 --- /dev/null +++ b/test/markup/php/namespace.expect.txt @@ -0,0 +1,8 @@ +namespace Location\Web; +namespace foo; +use My\Full\Classname as Another; +use My\Full\NSname; +use ArrayObject; +use function My\Full\functionName; +use function My\Full\functionName as func; +use const My\Full\CONSTANT; diff --git a/test/markup/php/namespace.txt b/test/markup/php/namespace.txt new file mode 100644 index 0000000000..cbb313094b --- /dev/null +++ b/test/markup/php/namespace.txt @@ -0,0 +1,8 @@ +namespace Location\Web; +namespace foo; +use My\Full\Classname as Another; +use My\Full\NSname; +use ArrayObject; +use function My\Full\functionName; +use function My\Full\functionName as func; +use const My\Full\CONSTANT; From 531cbfb70b741840a82136217e7c4748d13090e6 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 18:57:05 -0500 Subject: [PATCH 083/227] chore(php) comments should not care about pre-processor - this should be handled by php-template level (not php) --- src/languages/php.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/php.js b/src/languages/php.js index 2e9c8c318d..96e2aec158 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -281,7 +281,7 @@ export default function(hljs) { keywords: KEYWORDS, contains: [ hljs.HASH_COMMENT_MODE, - hljs.COMMENT('//', '$', {contains: [PREPROCESSOR]}), + hljs.COMMENT('//', '$'), hljs.COMMENT( '/\\*', '\\*/', From 8ddadca61d5c70dcdec752a2810eaa5c1b9f5f3b Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 19:09:08 -0500 Subject: [PATCH 084/227] chore(php) remove dead contains rule This rule wasn't even being used since each of the variants already has it's own contains, so this one would never have a change to be "default". --- src/languages/php.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index 96e2aec158..1fd109a844 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -47,13 +47,14 @@ export default function(hljs) { }); const STRING = { className: 'string', - contains: [hljs.BACKSLASH_ESCAPE, PREPROCESSOR], variants: [ hljs.inherit(SINGLE_QUOTED, { - begin: "b'", end: "'", + begin: "b'", + end: "'", }), hljs.inherit(DOUBLE_QUOTED, { - begin: 'b"', end: '"', + begin: 'b"', + end: '"', }), DOUBLE_QUOTED, SINGLE_QUOTED, From 38f58972c19c42398b372de4f6b0ccdf063e851e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 19:12:45 -0500 Subject: [PATCH 085/227] enh(php) $this is a variable.language --- src/languages/php.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languages/php.js b/src/languages/php.js index 1fd109a844..4b04e71acb 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -305,7 +305,8 @@ export default function(hljs) { ), PREPROCESSOR, { - className: 'keyword', begin: /\$this\b/ + className: 'variable.language', + begin: /\$this\b/ }, VARIABLE, { From 417446cb8fe4a3e7bd25e3b28a9d2936d6092480 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 19:34:09 -0500 Subject: [PATCH 086/227] chore(php) no binary strings, was a 6.0 only thing --- src/languages/php.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index 4b04e71acb..97f8e8d048 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -48,14 +48,6 @@ export default function(hljs) { const STRING = { className: 'string', variants: [ - hljs.inherit(SINGLE_QUOTED, { - begin: "b'", - end: "'", - }), - hljs.inherit(DOUBLE_QUOTED, { - begin: 'b"', - end: '"', - }), DOUBLE_QUOTED, SINGLE_QUOTED, HEREDOC From 6dd5cde9d828f86380118222da64da5a58137279 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 19:48:48 -0500 Subject: [PATCH 087/227] enh(php) add __COMPILER_HALT_OFFSET__ --- src/languages/php.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languages/php.js b/src/languages/php.js index 97f8e8d048..e835d2feec 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -76,6 +76,7 @@ export default function(hljs) { "__DIR__", "__FILE__", "__FUNCTION__", + "__COMPILER_HALT_OFFSET__", "__LINE__", "__METHOD__", "__NAMESPACE__", @@ -289,7 +290,7 @@ export default function(hljs) { ), hljs.COMMENT( '__halt_compiler.+?;', - false, + null, { endsWithParent: true, keywords: '__halt_compiler' From a289f24f4a1b5c4f1f1f987ac7d37de4bdb8f31c Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 20:23:43 -0500 Subject: [PATCH 088/227] chore(php) more correct __halt_compiler(); --- src/languages/php.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index e835d2feec..66d1a94f73 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -288,14 +288,21 @@ export default function(hljs) { ] } ), - hljs.COMMENT( - '__halt_compiler.+?;', - null, - { - endsWithParent: true, - keywords: '__halt_compiler' + { + match: /__halt_compiler\(\);/, + keywords: '__halt_compiler', + starts: { + scope: "comment", + end: hljs.MATCH_NOTHING_RE, + contains: [ + { + match: /\?>/, + scope: "meta", + endsParent: true + } + ] } - ), + }, PREPROCESSOR, { className: 'variable.language', From c4d30d1af99a6313714c06d744a61ba7c7f813b9 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 10 Dec 2021 12:39:47 -0500 Subject: [PATCH 089/227] chore(php) add changelog for PHP improvements --- CHANGES.md | 3 +++ src/languages/php.js | 2 -- test/markup/php/namespace.expect.txt | 1 + test/markup/php/namespace.txt | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b2294ae731..6bafdafe09 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,9 @@ These changes should be for the better and should not be super noticeable but if Grammars: +- enh(php) improve `namespace` and `use` highlighting (#3427) [Josh Goebel][] +- enh(php) `$this` is a `variable.language` now (#3427) [Josh Goebel][] +- enh(php) add `__COMPILER_HALT_OFFSET__` (#3427) [Josh Goebel][] - enh(js/ts) fix => async function title highlights (#3405) [Josh Goebel][] - enh(twig) update keywords list (#3415) [Matthieu Lempereur][] - fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][] diff --git a/src/languages/php.js b/src/languages/php.js index 66d1a94f73..b0736a2014 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -230,12 +230,10 @@ export default function(hljs) { "SplMinHeap", "SplObjectStorage", "SplObserver", - "SplObserver", "SplPriorityQueue", "SplQueue", "SplStack", "SplSubject", - "SplSubject", "SplTempFileObject", "TypeError", "UnderflowException", diff --git a/test/markup/php/namespace.expect.txt b/test/markup/php/namespace.expect.txt index 8b907e1873..338c6d38a8 100644 --- a/test/markup/php/namespace.expect.txt +++ b/test/markup/php/namespace.expect.txt @@ -6,3 +6,4 @@ use function My\Full\functionName; use function My\Full\functionName as func; use const My\Full\CONSTANT; +use Example\{ClassA, ClassB, ClassC as C}; diff --git a/test/markup/php/namespace.txt b/test/markup/php/namespace.txt index cbb313094b..c2f16b7f01 100644 --- a/test/markup/php/namespace.txt +++ b/test/markup/php/namespace.txt @@ -6,3 +6,4 @@ use ArrayObject; use function My\Full\functionName; use function My\Full\functionName as func; use const My\Full\CONSTANT; +use Example\{ClassA, ClassB, ClassC as C}; From e1d3a316579640b26565e7d2843e8cc1c67eac0c Mon Sep 17 00:00:00 2001 From: jeyllani <87556224+jeyllani@users.noreply.github.com> Date: Sun, 12 Dec 2021 20:10:33 +0100 Subject: [PATCH 090/227] (enh) New 3rd party Language Grammar: Pine Script (#3428) --- CHANGES.md | 5 +++++ SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 6bafdafe09..208041d3f8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ ## Version 11.4 (most likely) +New Language: + +- Added 3rd party Pine Script grammar to SUPPORTED_LANGUAGES [Jeylani B][] + Themes: - `Default` is now much closer WCAG AA (contrast) (#3402) [Josh Goebel] @@ -41,6 +45,7 @@ Themes: - Modified background color in css for Gradient Light and Gradient Dark themes [Samia Ali][] +[Jeylani B]: https://github.com/jeyllani [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey [Melvyn Laïly]: https://github.com/mlaily diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index aa6db49636..ed4382692a 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -146,6 +146,7 @@ The table below shows the full list of languages (and corresponding classes/alia | Papyrus | papyrus, psc |[highlightjs-papyrus](https://github.com/Pickysaurus/highlightjs-papyrus) | | Parser3 | parser3 | | | Perl | perl, pl, pm | | +| Pine Script | pine, pinescript | [highlightjs-pine](https://github.com/jeyllani/highlightjs-pine) | | Plaintext | plaintext, txt, text | | | Pony | pony | | | PostgreSQL & PL/pgSQL | pgsql, postgres, postgresql | | From 585be0285137eb93c061ac6257da79ebdc05149c Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Tue, 14 Dec 2021 17:28:45 -0500 Subject: [PATCH 091/227] enh(stan) Update Stan for version 2.28 (#3413) Version 2.28 related: * complex and array types * complex numbers * added all new functions and distributions Other Improvements: * highlighting of constants * highlighting for user defined distributions * highlighting for truncation Co-authored-by: Josh Goebel --- CHANGES.md | 3 +- src/languages/stan.js | 392 ++++++++++++---------------- test/detect/stan/default.txt | 63 ++--- test/markup/stan/default.expect.txt | 63 ++--- test/markup/stan/default.txt | 63 ++--- 5 files changed, 263 insertions(+), 321 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 208041d3f8..a15582a946 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,8 @@ Grammars: - enh(js/ts) improve `CLASS_REFERENCE` (#3411) [Josh Goebel][] - enh(nsis) Update defines pattern to allow `!` (#3417) [idleberg][] - enh(nsis) Update language strings pattern to allow `!` (#3420) [idleberg][] +- fix(stan) Updated for Stan 2.28 and other misc. improvements (#3410) +- enh(nsis) Update variables pattern (#3416) [idleberg][] - fix(clojure) Several issues with Clojure highlighting (#3397) [Björn Ebbinghaus][] - fix(clojure) `comment` macro catches more than it should (#3395) - fix(clojure) `$` in symbol breaks highlighting @@ -35,7 +37,6 @@ Grammars: - enh(clojure) Add `regex` mode to regex literal - fix(clojure) Remove inconsistent/broken highlighting for metadata - enh(clojure) Add `punctuation` mode for commas. - - enh(nsis) Update variables pattern (#3416) [idleberg][] Developer Tools: diff --git a/src/languages/stan.js b/src/languages/stan.js index 3bd657282b..1636359f22 100644 --- a/src/languages/stan.js +++ b/src/languages/stan.js @@ -1,12 +1,13 @@ /* Language: Stan Description: The Stan probabilistic programming language -Author: Jeffrey B. Arnold +Author: Sean Pinkney Website: http://mc-stan.org/ Category: scientific */ export default function(hljs) { + const regex = hljs.regex; // variable names cannot conflict with block identifiers const BLOCKS = [ 'functions', @@ -17,6 +18,7 @@ export default function(hljs) { 'transformed', 'generated' ]; + const STATEMENTS = [ 'for', 'in', @@ -27,16 +29,10 @@ export default function(hljs) { 'continue', 'return' ]; - const SPECIAL_FUNCTIONS = [ - 'print', - 'reject', - 'increment_log_prob|10', - 'integrate_ode|10', - 'integrate_ode_rk45|10', - 'integrate_ode_bdf|10', - 'algebra_solver' - ]; - const VAR_TYPES = [ + + const TYPES = [ + 'array', + 'complex', 'int', 'real', 'vector', @@ -52,13 +48,24 @@ export default function(hljs) { 'cov_matrix|10', 'void' ]; + + // to get the functions list + // clone the [stan-docs repo](https://github.com/stan-dev/docs) + // then cd into it and run this bash script https://gist.github.com/joshgoebel/dcd33f82d4059a907c986049893843cf + // + // the output files are + // distributions_quoted.txt + // functions_quoted.txt + const FUNCTIONS = [ 'Phi', 'Phi_approx', 'abs', 'acos', 'acosh', + 'add_diag', 'algebra_solver', + 'algebra_solver_newton', 'append_array', 'append_col', 'append_row', @@ -67,56 +74,21 @@ export default function(hljs) { 'atan', 'atan2', 'atanh', - 'bernoulli_cdf', - 'bernoulli_lccdf', - 'bernoulli_lcdf', - 'bernoulli_logit_lpmf', - 'bernoulli_logit_rng', - 'bernoulli_lpmf', - 'bernoulli_rng', 'bessel_first_kind', 'bessel_second_kind', - 'beta_binomial_cdf', - 'beta_binomial_lccdf', - 'beta_binomial_lcdf', - 'beta_binomial_lpmf', - 'beta_binomial_rng', - 'beta_cdf', - 'beta_lccdf', - 'beta_lcdf', - 'beta_lpdf', - 'beta_rng', 'binary_log_loss', - 'binomial_cdf', 'binomial_coefficient_log', - 'binomial_lccdf', - 'binomial_lcdf', - 'binomial_logit_lpmf', - 'binomial_lpmf', - 'binomial_rng', 'block', - 'categorical_logit_lpmf', - 'categorical_logit_rng', - 'categorical_lpmf', - 'categorical_rng', - 'cauchy_cdf', - 'cauchy_lccdf', - 'cauchy_lcdf', - 'cauchy_lpdf', - 'cauchy_rng', 'cbrt', 'ceil', - 'chi_square_cdf', - 'chi_square_lccdf', - 'chi_square_lcdf', - 'chi_square_lpdf', - 'chi_square_rng', + 'chol2inv', 'cholesky_decompose', 'choose', 'col', 'cols', 'columns_dot_product', 'columns_dot_self', + 'conj', 'cos', 'cosh', 'cov_exp_quad', @@ -134,34 +106,16 @@ export default function(hljs) { 'diagonal', 'digamma', 'dims', - 'dirichlet_lpdf', - 'dirichlet_rng', 'distance', 'dot_product', 'dot_self', - 'double_exponential_cdf', - 'double_exponential_lccdf', - 'double_exponential_lcdf', - 'double_exponential_lpdf', - 'double_exponential_rng', - 'e', 'eigenvalues_sym', 'eigenvectors_sym', 'erf', 'erfc', 'exp', 'exp2', - 'exp_mod_normal_cdf', - 'exp_mod_normal_lccdf', - 'exp_mod_normal_lcdf', - 'exp_mod_normal_lpdf', - 'exp_mod_normal_rng', 'expm1', - 'exponential_cdf', - 'exponential_lccdf', - 'exponential_lcdf', - 'exponential_lpdf', - 'exponential_rng', 'fabs', 'falling_factorial', 'fdim', @@ -170,94 +124,68 @@ export default function(hljs) { 'fmax', 'fmin', 'fmod', - 'frechet_cdf', - 'frechet_lccdf', - 'frechet_lcdf', - 'frechet_lpdf', - 'frechet_rng', - 'gamma_cdf', - 'gamma_lccdf', - 'gamma_lcdf', - 'gamma_lpdf', 'gamma_p', 'gamma_q', - 'gamma_rng', - 'gaussian_dlm_obs_lpdf', + 'generalized_inverse', + 'get_imag', 'get_lp', - 'gumbel_cdf', - 'gumbel_lccdf', - 'gumbel_lcdf', - 'gumbel_lpdf', - 'gumbel_rng', + 'get_real', 'head', - 'hypergeometric_lpmf', - 'hypergeometric_rng', + 'hmm_hidden_state_prob', + 'hmm_marginal', 'hypot', + 'identity_matrix', 'inc_beta', 'int_step', + 'integrate_1d', 'integrate_ode', + 'integrate_ode_adams', 'integrate_ode_bdf', 'integrate_ode_rk45', 'inv', 'inv_Phi', - 'inv_chi_square_cdf', - 'inv_chi_square_lccdf', - 'inv_chi_square_lcdf', - 'inv_chi_square_lpdf', - 'inv_chi_square_rng', 'inv_cloglog', - 'inv_gamma_cdf', - 'inv_gamma_lccdf', - 'inv_gamma_lcdf', - 'inv_gamma_lpdf', - 'inv_gamma_rng', 'inv_logit', 'inv_sqrt', 'inv_square', - 'inv_wishart_lpdf', - 'inv_wishart_rng', 'inverse', 'inverse_spd', 'is_inf', 'is_nan', + 'lambert_w0', + 'lambert_wm1', 'lbeta', 'lchoose', + 'ldexp', 'lgamma', - 'lkj_corr_cholesky_lpdf', - 'lkj_corr_cholesky_rng', - 'lkj_corr_lpdf', - 'lkj_corr_rng', + 'linspaced_array', + 'linspaced_int_array', + 'linspaced_row_vector', + 'linspaced_vector', 'lmgamma', 'lmultiply', 'log', - 'log10', 'log1m', 'log1m_exp', 'log1m_inv_logit', 'log1p', 'log1p_exp', - 'log2', 'log_determinant', 'log_diff_exp', 'log_falling_factorial', 'log_inv_logit', + 'log_inv_logit_diff', 'log_mix', + 'log_modified_bessel_first_kind', 'log_rising_factorial', 'log_softmax', 'log_sum_exp', - 'logistic_cdf', - 'logistic_lccdf', - 'logistic_lcdf', - 'logistic_lpdf', - 'logistic_rng', 'logit', - 'lognormal_cdf', - 'lognormal_lccdf', - 'lognormal_lcdf', - 'lognormal_lpdf', - 'lognormal_rng', 'machine_precision', + 'map_rect', 'matrix_exp', + 'matrix_exp_multiply', + 'matrix_power', 'max', 'mdivide_left_spd', 'mdivide_left_tri_low', @@ -267,120 +195,80 @@ export default function(hljs) { 'min', 'modified_bessel_first_kind', 'modified_bessel_second_kind', - 'multi_gp_cholesky_lpdf', - 'multi_gp_lpdf', - 'multi_normal_cholesky_lpdf', - 'multi_normal_cholesky_rng', - 'multi_normal_lpdf', - 'multi_normal_prec_lpdf', - 'multi_normal_rng', - 'multi_student_t_lpdf', - 'multi_student_t_rng', - 'multinomial_lpmf', - 'multinomial_rng', 'multiply_log', 'multiply_lower_tri_self_transpose', - 'neg_binomial_2_cdf', - 'neg_binomial_2_lccdf', - 'neg_binomial_2_lcdf', - 'neg_binomial_2_log_lpmf', - 'neg_binomial_2_log_rng', - 'neg_binomial_2_lpmf', - 'neg_binomial_2_rng', - 'neg_binomial_cdf', - 'neg_binomial_lccdf', - 'neg_binomial_lcdf', - 'neg_binomial_lpmf', - 'neg_binomial_rng', 'negative_infinity', - 'normal_cdf', - 'normal_lccdf', - 'normal_lcdf', - 'normal_lpdf', - 'normal_rng', + 'norm', 'not_a_number', 'num_elements', - 'ordered_logistic_lpmf', - 'ordered_logistic_rng', + 'ode_adams', + 'ode_adams_tol', + 'ode_adjoint_tol_ctl', + 'ode_bdf', + 'ode_bdf_tol', + 'ode_ckrk', + 'ode_ckrk_tol', + 'ode_rk45', + 'ode_rk45_tol', + 'one_hot_array', + 'one_hot_int_array', + 'one_hot_row_vector', + 'one_hot_vector', + 'ones_array', + 'ones_int_array', + 'ones_row_vector', + 'ones_vector', 'owens_t', - 'pareto_cdf', - 'pareto_lccdf', - 'pareto_lcdf', - 'pareto_lpdf', - 'pareto_rng', - 'pareto_type_2_cdf', - 'pareto_type_2_lccdf', - 'pareto_type_2_lcdf', - 'pareto_type_2_lpdf', - 'pareto_type_2_rng', - 'pi', - 'poisson_cdf', - 'poisson_lccdf', - 'poisson_lcdf', - 'poisson_log_lpmf', - 'poisson_log_rng', - 'poisson_lpmf', - 'poisson_rng', + 'polar', 'positive_infinity', 'pow', 'print', 'prod', + 'proj', 'qr_Q', 'qr_R', + 'qr_thin_Q', + 'qr_thin_R', 'quad_form', 'quad_form_diag', 'quad_form_sym', + 'quantile', 'rank', - 'rayleigh_cdf', - 'rayleigh_lccdf', - 'rayleigh_lcdf', - 'rayleigh_lpdf', - 'rayleigh_rng', + 'reduce_sum', 'reject', 'rep_array', 'rep_matrix', 'rep_row_vector', 'rep_vector', + 'reverse', 'rising_factorial', 'round', 'row', 'rows', 'rows_dot_product', 'rows_dot_self', - 'scaled_inv_chi_square_cdf', - 'scaled_inv_chi_square_lccdf', - 'scaled_inv_chi_square_lcdf', - 'scaled_inv_chi_square_lpdf', - 'scaled_inv_chi_square_rng', + 'scale_matrix_exp_multiply', 'sd', 'segment', 'sin', 'singular_values', 'sinh', 'size', - 'skew_normal_cdf', - 'skew_normal_lccdf', - 'skew_normal_lcdf', - 'skew_normal_lpdf', - 'skew_normal_rng', 'softmax', 'sort_asc', 'sort_desc', 'sort_indices_asc', 'sort_indices_desc', 'sqrt', - 'sqrt2', 'square', 'squared_distance', 'step', - 'student_t_cdf', - 'student_t_lccdf', - 'student_t_lcdf', - 'student_t_lpdf', - 'student_t_rng', 'sub_col', 'sub_row', 'sum', + 'svd_U', + 'svd_V', + 'symmetrize_from_lower_tri', 'tail', 'tan', 'tanh', @@ -389,6 +277,7 @@ export default function(hljs) { 'tgamma', 'to_array_1d', 'to_array_2d', + 'to_complex', 'to_matrix', 'to_row_vector', 'to_vector', @@ -397,35 +286,29 @@ export default function(hljs) { 'trace_quad_form', 'trigamma', 'trunc', - 'uniform_cdf', - 'uniform_lccdf', - 'uniform_lcdf', - 'uniform_lpdf', - 'uniform_rng', + 'uniform_simplex', 'variance', - 'von_mises_lpdf', - 'von_mises_rng', - 'weibull_cdf', - 'weibull_lccdf', - 'weibull_lcdf', - 'weibull_lpdf', - 'weibull_rng', - 'wiener_lpdf', - 'wishart_lpdf', - 'wishart_rng' + 'zeros_array', + 'zeros_int_array', + 'zeros_row_vector' ]; + const DISTRIBUTIONS = [ 'bernoulli', 'bernoulli_logit', + 'bernoulli_logit_glm', 'beta', 'beta_binomial', + 'beta_proportion', 'binomial', 'binomial_logit', 'categorical', 'categorical_logit', + 'categorical_logit_glm', 'cauchy', 'chi_square', 'dirichlet', + 'discrete_range', 'double_exponential', 'exp_mod_normal', 'exponential', @@ -433,6 +316,7 @@ export default function(hljs) { 'gamma', 'gaussian_dlm_obs', 'gumbel', + 'hmm_latent', 'hypergeometric', 'inv_chi_square', 'inv_gamma', @@ -448,18 +332,26 @@ export default function(hljs) { 'multi_normal_prec', 'multi_student_t', 'multinomial', + 'multinomial_logit', 'neg_binomial', 'neg_binomial_2', 'neg_binomial_2_log', + 'neg_binomial_2_log_glm', 'normal', + 'normal_id_glm', 'ordered_logistic', + 'ordered_logistic_glm', + 'ordered_probit', 'pareto', 'pareto_type_2', 'poisson', 'poisson_log', + 'poisson_log_glm', 'rayleigh', 'scaled_inv_chi_square', + 'skew_double_exponential', 'skew_normal', + 'std_normal', 'student_t', 'uniform', 'von_mises', @@ -475,7 +367,7 @@ export default function(hljs) { relevance: 0, contains: [ { - className: 'doctag', + scope: 'doctag', match: /@(return|param)/ } ] @@ -483,27 +375,33 @@ export default function(hljs) { ); const INCLUDE = { - className: 'meta', - begin: /^#include\b/, + scope: 'meta', + begin: /#include\b/, end: /$/, - relevance: 0, // relevance comes from keywords - keywords: "include", contains: [ { - match: /[a-z][a-z-.]+/, - className: "string" + match: /[a-z][a-z-._]+/, + scope: 'string' }, hljs.C_LINE_COMMENT_MODE ] }; + const RANGE_CONSTRAINTS = [ + "lower", + "upper", + "offset", + "multiplier" + ]; + return { name: 'Stan', aliases: [ 'stanfuncs' ], keywords: { $pattern: hljs.IDENT_RE, title: BLOCKS, - keyword: STATEMENTS.concat(VAR_TYPES).concat(SPECIAL_FUNCTIONS), + type: TYPES, + keyword: STATEMENTS, built_in: FUNCTIONS }, contains: [ @@ -512,41 +410,81 @@ export default function(hljs) { hljs.HASH_COMMENT_MODE, BLOCK_COMMENT, { - // hack: in range constraints, lower must follow "<" - begin: /<\s*lower\s*=/, - keywords: 'lower' + scope: 'built_in', + match: /\s(pi|e|sqrt2|log2|log10)(?=\()/, + relevance: 0 + }, + { + match: regex.concat(/[<,]\s*/, regex.either(...RANGE_CONSTRAINTS), /\s*=/), + keywords: RANGE_CONSTRAINTS }, { - // hack: in range constraints, upper must follow either , or < - // or - begin: /[<,]\s*upper\s*=/, - keywords: 'upper' + scope: 'keyword', + match: /\btarget(?=\s*\+=)/, }, { - className: 'keyword', - begin: /\btarget\s*\+=/ + // highlights the 'T' in T[,] for only Stan language distributrions + match: [ + /~\s*/, + regex.either(...DISTRIBUTIONS), + /(?:\(\))/, + /\s*T(?=\s*\[)/ + ], + scope: { + 2: "built_in", + 4: "keyword" + } }, { - begin: '~\\s*(' + hljs.IDENT_RE + ')\\s*\\(', - keywords: DISTRIBUTIONS + // highlights distributions that end with special endings + scope: 'built_in', + keywords: DISTRIBUTIONS, + begin: regex.concat(/\w*/, regex.either(...DISTRIBUTIONS), /(_lpdf|_lupdf|_lpmf|_cdf|_lcdf|_lccdf|_qf)(?=\s*[\(.*\)])/) }, { - className: 'number', - variants: [ - { - begin: /\b\d+(?:\.\d*)?(?:[eE][+-]?\d+)?/ - }, - { - begin: /\.\d+(?:[eE][+-]?\d+)?\b/ - } + // highlights distributions after ~ + begin: [ + /~/, + /\s*/, + regex.concat(regex.either(...DISTRIBUTIONS), /(?=\s*[\(.*\)])/) ], - relevance: 0 + scope: { 3: "built_in" } + }, + { + // highlights user defined distributions after ~ + begin: [ + /~/, + /\s*\w+(?=\s*[\(.*\)])/, + '(?!.*/\b(' + regex.either(...DISTRIBUTIONS) + ')\b)' + ], + scope: { 2: "title.function" } + }, + { + // highlights user defined distributions with special endings + scope: 'title.function', + begin: /\w*(_lpdf|_lupdf|_lpmf|_cdf|_lcdf|_lccdf|_qf)(?=\s*[\(.*\)])/ }, { - className: 'string', - begin: '"', - end: '"', + scope: 'number', + match: regex.concat( + // Comes from @RunDevelopment accessed 11/29/2021 at + // https://github.com/PrismJS/prism/blob/c53ad2e65b7193ab4f03a1797506a54bbb33d5a2/components/prism-stan.js#L56 + + // start of big noncapture group which + // 1. gets numbers that are by themselves + // 2. numbers that are separated by _ + // 3. numbers that are separted by . + /(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)/, + // grabs scientific notation + // grabs complex numbers with i + /(?:[eE][+-]?\d+(?:_\d+)*)?i?(?!\w)/ + ), relevance: 0 + }, + { + scope: 'string', + begin: /"/, + end: /"/ } ] }; diff --git a/test/detect/stan/default.txt b/test/detect/stan/default.txt index 99e56c45ec..a4b42f332e 100644 --- a/test/detect/stan/default.txt +++ b/test/detect/stan/default.txt @@ -1,39 +1,40 @@ -// Multivariate Regression Example -// Taken from stan-reference-2.8.0.pdf p.66 - +functions { + #include normal_copula.stanfunctions +} data { - int N; // num individuals - int K; // num ind predictors - int J; // num groups - int L; // num group predictors - int jj[N]; // group for individual - matrix[N,K] x; // individual predictors - row_vector[L] u[J]; // group predictors - vector[N] y; // outcomes + int N; + int K; + matrix[N, K] x; } +transformed data { + complex zi = 1+3.14i; + zi = zi * 0i; + complex yi = to_complex(0, 1.1) + to_complex(0.0, 2.2) + to_complex(); + real x = get_real(3i - 40e-3i + 1e10i); +}› parameters { - corr_matrix[K] Omega; // prior correlation - vector[K] tau; // prior scale - matrix[L,K] gamma; // group coeffs - vector[K] beta[J]; // indiv coeffs by group - real sigma; // prediction error scale + array[K - 1] real mu; + array[K + 1] real sigma; + cholesky_factor_corr[K] L; } model { - tau ~ cauchy(0,2.5); - Omega ~ lkj_corr(2); - to_vector(gamma) ~ normal(0, 5); - { - row_vector[K] u_gamma[J]; - for (j in 1:J) - u_gamma[j] <- u[j] * gamma; - beta ~ multi_normal(u_gamma, quad_form_diag(Omega, tau)); - } + target += normal_lpdf(x[ : , 1] | mu[1], sigma[1]); + target += gumbel_lpdf(x[ : , 2] | mu[2], sigma[2]); + target += lognormal_lpdf(x[ : , 3] | mu[3], sigma[3]); + target += weibull_lpdf(x[ : , 4] | sigma[4], sigma[5]); + { - vector[N] x_beta_jj; - for (n in 1:N) - x_beta_jj[n] <- x[n] * beta[jj[n]]; - y ~ normal(x_beta_jj, sigma); + matrix[K, N] y; + for (n in 1 : N) { + y[1, n] = inv_Phi(normal_cdf(x[n, 1] | mu[1], sigma[1])); + y[2, n] = inv_Phi(gumbel_cdf(x[n, 2] | mu[2], sigma[2])); + y[3, n] = inv_Phi(lognormal_cdf(x[n, 3] | mu[3], sigma[3])); + y[4, n] = inv_Phi(weibull_cdf(x[n, 4] | sigma[4], sigma[5])); + } + y ~ multi_normal(L); + } } - -# Note: Octothorpes indicate comments, too! +generated quantities { + matrix[K, K] Sigma = multiply_lower_tri_self_transpose(L); +} \ No newline at end of file diff --git a/test/markup/stan/default.expect.txt b/test/markup/stan/default.expect.txt index 6a32c43433..aeb9552aa5 100644 --- a/test/markup/stan/default.expect.txt +++ b/test/markup/stan/default.expect.txt @@ -1,39 +1,40 @@ -// Multivariate Regression Example -// Taken from stan-reference-2.8.0.pdf p.66 - +functions { + #include normal_copula.stanfunctions +} data { - int<lower=0> N; // num individuals - int<lower=1> K; // num ind predictors - int<lower=1> J; // num groups - int<lower=1> L; // num group predictors - int<lower=1,upper=J> jj[N]; // group for individual - matrix[N,K] x; // individual predictors - row_vector[L] u[J]; // group predictors - vector[N] y; // outcomes + int<lower=0> N; + int K; + matrix[N, K] x; } +transformed data { + complex zi = 1+3.14i; + zi = zi * 0i; + complex yi = to_complex(0, 1.1) + to_complex(0.0, 2.2) + to_complex(); + real x = get_real(3i - 40e-3i + 1e10i); +}› parameters { - corr_matrix[K] Omega; // prior correlation - vector<lower=0>[K] tau; // prior scale - matrix[L,K] gamma; // group coeffs - vector[K] beta[J]; // indiv coeffs by group - real<lower=0> sigma; // prediction error scale + array[K - 1] real mu; + array[K + 1] real<lower=0> sigma; + cholesky_factor_corr[K] L; } model { - tau ~ cauchy(0,2.5); - Omega ~ lkj_corr(2); - to_vector(gamma) ~ normal(0, 5); - { - row_vector[K] u_gamma[J]; - for (j in 1:J) - u_gamma[j] <- u[j] * gamma; - beta ~ multi_normal(u_gamma, quad_form_diag(Omega, tau)); - } + target += normal_lpdf(x[ : , 1] | mu[1], sigma[1]); + target += gumbel_lpdf(x[ : , 2] | mu[2], sigma[2]); + target += lognormal_lpdf(x[ : , 3] | mu[3], sigma[3]); + target += weibull_lpdf(x[ : , 4] | sigma[4], sigma[5]); + { - vector[N] x_beta_jj; - for (n in 1:N) - x_beta_jj[n] <- x[n] * beta[jj[n]]; - y ~ normal(x_beta_jj, sigma); + matrix[K, N] y; + for (n in 1 : N) { + y[1, n] = inv_Phi(normal_cdf(x[n, 1] | mu[1], sigma[1])); + y[2, n] = inv_Phi(gumbel_cdf(x[n, 2] | mu[2], sigma[2])); + y[3, n] = inv_Phi(lognormal_cdf(x[n, 3] | mu[3], sigma[3])); + y[4, n] = inv_Phi(weibull_cdf(x[n, 4] | sigma[4], sigma[5])); + } + y ~ multi_normal(L); + } } - -# Note: Octothorpes indicate comments, too! +generated quantities { + matrix[K, K] Sigma = multiply_lower_tri_self_transpose(L); +} \ No newline at end of file diff --git a/test/markup/stan/default.txt b/test/markup/stan/default.txt index 99e56c45ec..a4b42f332e 100644 --- a/test/markup/stan/default.txt +++ b/test/markup/stan/default.txt @@ -1,39 +1,40 @@ -// Multivariate Regression Example -// Taken from stan-reference-2.8.0.pdf p.66 - +functions { + #include normal_copula.stanfunctions +} data { - int N; // num individuals - int K; // num ind predictors - int J; // num groups - int L; // num group predictors - int jj[N]; // group for individual - matrix[N,K] x; // individual predictors - row_vector[L] u[J]; // group predictors - vector[N] y; // outcomes + int N; + int K; + matrix[N, K] x; } +transformed data { + complex zi = 1+3.14i; + zi = zi * 0i; + complex yi = to_complex(0, 1.1) + to_complex(0.0, 2.2) + to_complex(); + real x = get_real(3i - 40e-3i + 1e10i); +}› parameters { - corr_matrix[K] Omega; // prior correlation - vector[K] tau; // prior scale - matrix[L,K] gamma; // group coeffs - vector[K] beta[J]; // indiv coeffs by group - real sigma; // prediction error scale + array[K - 1] real mu; + array[K + 1] real sigma; + cholesky_factor_corr[K] L; } model { - tau ~ cauchy(0,2.5); - Omega ~ lkj_corr(2); - to_vector(gamma) ~ normal(0, 5); - { - row_vector[K] u_gamma[J]; - for (j in 1:J) - u_gamma[j] <- u[j] * gamma; - beta ~ multi_normal(u_gamma, quad_form_diag(Omega, tau)); - } + target += normal_lpdf(x[ : , 1] | mu[1], sigma[1]); + target += gumbel_lpdf(x[ : , 2] | mu[2], sigma[2]); + target += lognormal_lpdf(x[ : , 3] | mu[3], sigma[3]); + target += weibull_lpdf(x[ : , 4] | sigma[4], sigma[5]); + { - vector[N] x_beta_jj; - for (n in 1:N) - x_beta_jj[n] <- x[n] * beta[jj[n]]; - y ~ normal(x_beta_jj, sigma); + matrix[K, N] y; + for (n in 1 : N) { + y[1, n] = inv_Phi(normal_cdf(x[n, 1] | mu[1], sigma[1])); + y[2, n] = inv_Phi(gumbel_cdf(x[n, 2] | mu[2], sigma[2])); + y[3, n] = inv_Phi(lognormal_cdf(x[n, 3] | mu[3], sigma[3])); + y[4, n] = inv_Phi(weibull_cdf(x[n, 4] | sigma[4], sigma[5])); + } + y ~ multi_normal(L); + } } - -# Note: Octothorpes indicate comments, too! +generated quantities { + matrix[K, K] Sigma = multiply_lower_tri_self_transpose(L); +} \ No newline at end of file From 384cd17098f740f34d6d0bb762527a4b5766b2ad Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 15 Dec 2021 15:57:03 -0500 Subject: [PATCH 092/227] chore(security) link to wiki security article now --- src/highlight.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/highlight.js b/src/highlight.js index 6f546e6ccc..ed0e187fd5 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -734,7 +734,8 @@ const HLJS = function(hljs) { if (element.children.length > 0) { if (!options.ignoreUnescapedHTML) { console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."); - console.warn("https://github.com/highlightjs/highlight.js/issues/2886"); + console.warn("https://github.com/highlightjs/highlight.js/wiki/security"); + console.warn("The element with unescaped HTML:"); console.warn(element); } if (options.throwUnescapedHTML) { From db3f36b8217fcf7164a73cdba2f5f13f6463e033 Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Thu, 9 Dec 2021 22:33:04 +0100 Subject: [PATCH 093/227] enh(php) Switch highlighter to partially case-insensitive --- src/languages/php.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index b0736a2014..4656a8ef79 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -56,11 +56,11 @@ export default function(hljs) { const NUMBER = { className: 'number', variants: [ - { begin: `\\b0b[01]+(?:_[01]+)*\\b` }, // Binary w/ underscore support - { begin: `\\b0o[0-7]+(?:_[0-7]+)*\\b` }, // Octals w/ underscore support - { begin: `\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b` }, // Hex w/ underscore support + { begin: `\\b0[bB][01]+(?:_[01]+)*\\b` }, // Binary w/ underscore support + { begin: `\\b0[oO][0-7]+(?:_[0-7]+)*\\b` }, // Octals w/ underscore support + { begin: `\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b` }, // Hex w/ underscore support // Decimals w/ underscore support, with optional fragments and scientific exponent (e) suffix. - { begin: `(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?` } + { begin: `(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?` } ], relevance: 0 }; @@ -269,7 +269,7 @@ export default function(hljs) { built_in: BUILT_INS }; return { - case_insensitive: true, + case_insensitive: false, keywords: KEYWORDS, contains: [ hljs.HASH_COMMENT_MODE, From ac9f29431cedaaef8a362425d9450fdb5780d7a2 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 10 Dec 2021 13:33:37 -0500 Subject: [PATCH 094/227] chore(php) support dual-cased literals --- src/languages/php.js | 23 ++++++++++++++++++++++- test/markup/php/case.expect.txt | 8 ++++++++ test/markup/php/case.txt | 8 ++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 test/markup/php/case.expect.txt create mode 100644 test/markup/php/case.txt diff --git a/src/languages/php.js b/src/languages/php.js index 4656a8ef79..9d38213f8f 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -263,9 +263,30 @@ export default function(hljs) { "stdClass" ]; + /** Dual-case keywords + * + * ["then","FILE"] => + * ["then", "THEN", "FILE", "file"] + * + * @param {string[]} items */ + const dualCase = (items) => { + /** @type string[] */ + const result = []; + items.forEach(item => { + if (item.toLowerCase() === item) { + result.push(item); + result.push(item.toUpperCase()); + } else { + result.push(item); + result.push(item.toLowerCase()); + } + }); + return result; + }; + const KEYWORDS = { keyword: KWS, - literal: LITERALS, + literal: dualCase(LITERALS), built_in: BUILT_INS }; return { diff --git a/test/markup/php/case.expect.txt b/test/markup/php/case.expect.txt new file mode 100644 index 0000000000..e75606fd72 --- /dev/null +++ b/test/markup/php/case.expect.txt @@ -0,0 +1,8 @@ +$test = true +$test = TRUE + +$a = false +$a = FALSE + +$b = null +$b = NULL diff --git a/test/markup/php/case.txt b/test/markup/php/case.txt new file mode 100644 index 0000000000..079112129e --- /dev/null +++ b/test/markup/php/case.txt @@ -0,0 +1,8 @@ +$test = true +$test = TRUE + +$a = false +$a = FALSE + +$b = null +$b = NULL From 8214035f5cb60f57c3d0156019828e6bf4527383 Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Sat, 11 Dec 2021 22:59:35 +0100 Subject: [PATCH 095/227] enh(php) support function invoke --- src/languages/php.js | 33 +++++++++++++++++++++------- test/markup/php/functions.expect.txt | 10 +++++++++ test/markup/php/functions.txt | 10 +++++++++ test/markup/php/strings.expect.txt | 4 ++-- 4 files changed, 47 insertions(+), 10 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index 9d38213f8f..baf64f5d9f 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -11,6 +11,7 @@ Category: common * @returns {LanguageDetail} * */ export default function(hljs) { + const regex = hljs.regex; const VARIABLE = { className: 'variable', begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' + @@ -145,7 +146,6 @@ export default function(hljs) { "isset", "iterable", "list", - "match|0", "mixed", "new", "object", @@ -172,7 +172,6 @@ export default function(hljs) { const BUILT_INS = [ // Standard PHP library: // - "Error|0", "AppendIterator", "ArgumentCountError", "ArithmeticError", @@ -273,11 +272,10 @@ export default function(hljs) { /** @type string[] */ const result = []; items.forEach(item => { + result.push(item); if (item.toLowerCase() === item) { - result.push(item); result.push(item.toUpperCase()); } else { - result.push(item); result.push(item.toLowerCase()); } }); @@ -285,9 +283,23 @@ export default function(hljs) { }; const KEYWORDS = { - keyword: KWS, + keyword: KWS.concat([ "match|0" ]), literal: dualCase(LITERALS), - built_in: BUILT_INS + built_in: BUILT_INS.concat([ "Error|0" ]), + }; + + const FUNCTION_INVOKE = { + relevance: 0, + match: [ + /(?:->|::|\s|\(|\\)/, + regex.concat("(?!fn\\b|function\\b|match\\b|", KWS.join("\\b|"), "|", BUILT_INS.join("\\b|"), "\\b)"), + /\w+/, + /\s*/, + regex.lookahead(/(?=\()/) + ], + scope: { + 3: "function.title.invoke", + } }; return { case_insensitive: false, @@ -328,9 +340,14 @@ export default function(hljs) { begin: /\$this\b/ }, VARIABLE, + FUNCTION_INVOKE, { // swallow composed identifiers to avoid parsing them as keywords - begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ + begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?!\()/ + }, + { + // swallow create object + begin: /new\s\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\s?\(/ }, { className: 'function', @@ -378,7 +395,7 @@ export default function(hljs) { }, // both use and namespace still use "old style" rules (vs multi-match) // because the namespace name can include `\` and we still want each - // element to be treated as it's own *individual* title + // element to be treated as its own *individual* title { beginKeywords: 'namespace', relevance: 0, diff --git a/test/markup/php/functions.expect.txt b/test/markup/php/functions.expect.txt index d161e753f4..ba14faad0b 100644 --- a/test/markup/php/functions.expect.txt +++ b/test/markup/php/functions.expect.txt @@ -6,3 +6,13 @@ $fn2 = function ($x) use ($y) { return $x + $y; }; + +/** + * Function invoke + */ +$date = new DateTimeImmutable (); +$date->format('Y-m-d'); + +DateTimeImmutable::createFromMutable(new \DateTime()); + +str_contains (\strtoupper(substr('abcdef', -2), 'f')); diff --git a/test/markup/php/functions.txt b/test/markup/php/functions.txt index 2eec171beb..525442d0bf 100644 --- a/test/markup/php/functions.txt +++ b/test/markup/php/functions.txt @@ -6,3 +6,13 @@ $fn1 = fn($x) => $x + $y; $fn2 = function ($x) use ($y) { return $x + $y; }; + +/** + * Function invoke + */ +$date = new DateTimeImmutable (); +$date->format('Y-m-d'); + +DateTimeImmutable::createFromMutable(new \DateTime()); + +str_contains (\strtoupper(substr('abcdef', -2), 'f')); diff --git a/test/markup/php/strings.expect.txt b/test/markup/php/strings.expect.txt index a547757933..56f3428e3b 100644 --- a/test/markup/php/strings.expect.txt +++ b/test/markup/php/strings.expect.txt @@ -12,12 +12,12 @@ MSG); // heredoc syntax -var_dump(<<<SQL +var_dump(<<<SQL SELECT * FROM table SQL); -var_dump(<<<SQL +var_dump(<<<SQL SELECT * FROM table SQL); From 4b1dc30a5b0b828a77cc1fadba77fc6d5f278b64 Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Sun, 12 Dec 2021 19:11:43 +0100 Subject: [PATCH 096/227] enh(php) support class constructor call --- CHANGES.md | 3 +++ src/languages/php.js | 30 ++++++++++++++++++++++------ test/markup/php/functions.expect.txt | 23 +++++++++++++++++++-- test/markup/php/functions.txt | 21 ++++++++++++++++++- 4 files changed, 68 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a15582a946..c0e510146f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,9 @@ These changes should be for the better and should not be super noticeable but if Grammars: +- enh(php) support class constructor call (#3427) [Wojciech Kania][] +- enh(php) support function invoke (#3427) [Wojciech Kania][] +- enh(php) Switch highlighter to partially case-insensitive (#3427) [Wojciech Kania][] - enh(php) improve `namespace` and `use` highlighting (#3427) [Josh Goebel][] - enh(php) `$this` is a `variable.language` now (#3427) [Josh Goebel][] - enh(php) add `__COMPILER_HALT_OFFSET__` (#3427) [Josh Goebel][] diff --git a/src/languages/php.js b/src/languages/php.js index baf64f5d9f..d37403ff99 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -288,11 +288,31 @@ export default function(hljs) { built_in: BUILT_INS.concat([ "Error|0" ]), }; + const CONSTRUCTOR_CALL = { + variants: [ + { + match: [ + /new/, + /\s+/, + // to prevent built ins from being confused as the class constructor call + regex.concat("(?!", BUILT_INS.join("\\b|"), "\\b)"), + /\\?\w+/, + /\s*\(/, + ], + scope: { + 1: "keyword", + 4: "title.class", + }, + } + ] + }; + const FUNCTION_INVOKE = { relevance: 0, match: [ /(?:->|::|\s|\(|\\)/, - regex.concat("(?!fn\\b|function\\b|match\\b|", KWS.join("\\b|"), "|", BUILT_INS.join("\\b|"), "\\b)"), + // to prevent keywords from being confused as the function title + regex.concat("(?!fn\\b|function\\b|match\\b|Error\\b|", KWS.join("\\b|"), "|", BUILT_INS.join("\\b|"), "\\b)"), /\w+/, /\s*/, regex.lookahead(/(?=\()/) @@ -301,6 +321,7 @@ export default function(hljs) { 3: "function.title.invoke", } }; + return { case_insensitive: false, keywords: KEYWORDS, @@ -343,12 +364,9 @@ export default function(hljs) { FUNCTION_INVOKE, { // swallow composed identifiers to avoid parsing them as keywords - begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?!\()/ - }, - { - // swallow create object - begin: /new\s\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\s?\(/ + begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ }, + CONSTRUCTOR_CALL, { className: 'function', relevance: 0, diff --git a/test/markup/php/functions.expect.txt b/test/markup/php/functions.expect.txt index ba14faad0b..2302fa6297 100644 --- a/test/markup/php/functions.expect.txt +++ b/test/markup/php/functions.expect.txt @@ -10,9 +10,28 @@ /** * Function invoke */ -$date = new DateTimeImmutable (); +$date = new DateTimeImmutable (); $date->format('Y-m-d'); -DateTimeImmutable::createFromMutable(new \DateTime()); +DateTimeImmutable::createFromMutable(new \DateTime('now')); str_contains (\strtoupper(substr('abcdef', -2), 'f')); + +/** + * Function declaration + */ +function testMe(string|int $name): int +{ + if (empty($name)) { + return 0; + } elseif ($name === 1) { + return (int) $name; + } + + switch($name) { + case '2': + return 2; + default: + throw new \Exception('error'); + } +} diff --git a/test/markup/php/functions.txt b/test/markup/php/functions.txt index 525442d0bf..077283afeb 100644 --- a/test/markup/php/functions.txt +++ b/test/markup/php/functions.txt @@ -13,6 +13,25 @@ $fn2 = function ($x) use ($y) { $date = new DateTimeImmutable (); $date->format('Y-m-d'); -DateTimeImmutable::createFromMutable(new \DateTime()); +DateTimeImmutable::createFromMutable(new \DateTime('now')); str_contains (\strtoupper(substr('abcdef', -2), 'f')); + +/** + * Function declaration + */ +function testMe(string|int $name): int +{ + if (empty($name)) { + return 0; + } elseif ($name === 1) { + return (int) $name; + } + + switch($name) { + case '2': + return 2; + default: + throw new \Exception('error'); + } +} From 323652a227549980ef54e0d942bd24a09559669c Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Mon, 13 Dec 2021 20:24:40 +0100 Subject: [PATCH 097/227] chore(php) normalize keywords --- src/languages/php.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index d37403ff99..e5339e0eb1 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -146,6 +146,7 @@ export default function(hljs) { "isset", "iterable", "list", + "match|0", "mixed", "new", "object", @@ -172,6 +173,7 @@ export default function(hljs) { const BUILT_INS = [ // Standard PHP library: // + "Error|0", "AppendIterator", "ArgumentCountError", "ArithmeticError", @@ -283,9 +285,17 @@ export default function(hljs) { }; const KEYWORDS = { - keyword: KWS.concat([ "match|0" ]), + keyword: KWS, literal: dualCase(LITERALS), - built_in: BUILT_INS.concat([ "Error|0" ]), + built_in: BUILT_INS, + }; + + /** + * @param {string[]} items */ + const normalizeKeywords = (items) => { + return items.map(item => { + return item.replace(/\|\d+$/, ""); + }); }; const CONSTRUCTOR_CALL = { @@ -295,7 +305,7 @@ export default function(hljs) { /new/, /\s+/, // to prevent built ins from being confused as the class constructor call - regex.concat("(?!", BUILT_INS.join("\\b|"), "\\b)"), + regex.concat("(?!", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), /\\?\w+/, /\s*\(/, ], @@ -312,7 +322,7 @@ export default function(hljs) { match: [ /(?:->|::|\s|\(|\\)/, // to prevent keywords from being confused as the function title - regex.concat("(?!fn\\b|function\\b|match\\b|Error\\b|", KWS.join("\\b|"), "|", BUILT_INS.join("\\b|"), "\\b)"), + regex.concat("(?!fn\\b|function\\b|", normalizeKeywords(KWS).join("\\b|"), "|", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), /\w+/, /\s*/, regex.lookahead(/(?=\()/) From 622dfd2425e5ee0f5c9e5791d375626dd88ad029 Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Tue, 14 Dec 2021 18:26:17 +0100 Subject: [PATCH 098/227] enh(php) support First-class Callable Syntax --- CHANGES.md | 2 ++ src/languages/php.js | 11 ++++++----- test/markup/php/functions.expect.txt | 6 ++++++ test/markup/php/functions.txt | 6 ++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c0e510146f..05034fcaea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ These changes should be for the better and should not be super noticeable but if Grammars: +- enh(php) support First-class Callable Syntax (#3427) [Wojciech Kania][] - enh(php) support class constructor call (#3427) [Wojciech Kania][] - enh(php) support function invoke (#3427) [Wojciech Kania][] - enh(php) Switch highlighter to partially case-insensitive (#3427) [Wojciech Kania][] @@ -49,6 +50,7 @@ Themes: - Modified background color in css for Gradient Light and Gradient Dark themes [Samia Ali][] +[Wojciech Kania]: https://github.com/wkania [Jeylani B]: https://github.com/jeyllani [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey diff --git a/src/languages/php.js b/src/languages/php.js index e5339e0eb1..f88609e1b0 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -303,11 +303,11 @@ export default function(hljs) { { match: [ /new/, - /\s+/, + / +/, // to prevent built ins from being confused as the class constructor call regex.concat("(?!", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), /\\?\w+/, - /\s*\(/, + / *\(/, ], scope: { 1: "keyword", @@ -320,11 +320,11 @@ export default function(hljs) { const FUNCTION_INVOKE = { relevance: 0, match: [ - /(?:->|::|\s|\(|\\)/, + /\b/, // to prevent keywords from being confused as the function title regex.concat("(?!fn\\b|function\\b|", normalizeKeywords(KWS).join("\\b|"), "|", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), /\w+/, - /\s*/, + / */, regex.lookahead(/(?=\()/) ], scope: { @@ -374,7 +374,8 @@ export default function(hljs) { FUNCTION_INVOKE, { // swallow composed identifiers to avoid parsing them as keywords - begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ + begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?! *\()(?![a-zA-Z0-9_\x7f-\xff])/, + // scope:"wrong" }, CONSTRUCTOR_CALL, { diff --git a/test/markup/php/functions.expect.txt b/test/markup/php/functions.expect.txt index 2302fa6297..946c41bd67 100644 --- a/test/markup/php/functions.expect.txt +++ b/test/markup/php/functions.expect.txt @@ -35,3 +35,9 @@ DateTimeImmutable::createFromMutable throw new \Exception('error'); } } + +/** + * First-class Callable Syntax + */ +$fun = mb_strlen(); +$fun(); diff --git a/test/markup/php/functions.txt b/test/markup/php/functions.txt index 077283afeb..86f7fd48a4 100644 --- a/test/markup/php/functions.txt +++ b/test/markup/php/functions.txt @@ -35,3 +35,9 @@ function testMe(string|int $name): int throw new \Exception('error'); } } + +/** + * First-class Callable Syntax + */ +$fun = mb_strlen(); +$fun(); From ceb070f820a333390f233a6c19772d468e59823c Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Wed, 15 Dec 2021 22:38:14 +0100 Subject: [PATCH 099/227] chore(php) add list of valid whitespaces --- src/languages/php.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index f88609e1b0..4832f88d71 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -46,6 +46,8 @@ export default function(hljs) { end: /[ \t]*(\w+)\b/, contains: hljs.QUOTE_STRING_MODE.contains.concat(SUBST), }); + // list of valid whitespaces because non-breaking space might be part of a name + const WHITESPACE = '[ \t\n]'; const STRING = { className: 'string', variants: [ @@ -303,11 +305,11 @@ export default function(hljs) { { match: [ /new/, - / +/, + regex.concat(WHITESPACE, "+"), // to prevent built ins from being confused as the class constructor call regex.concat("(?!", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), /\\?\w+/, - / *\(/, + regex.concat(WHITESPACE, "*\\("), ], scope: { 1: "keyword", @@ -324,7 +326,7 @@ export default function(hljs) { // to prevent keywords from being confused as the function title regex.concat("(?!fn\\b|function\\b|", normalizeKeywords(KWS).join("\\b|"), "|", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), /\w+/, - / */, + regex.concat(WHITESPACE, "*"), regex.lookahead(/(?=\()/) ], scope: { @@ -374,7 +376,11 @@ export default function(hljs) { FUNCTION_INVOKE, { // swallow composed identifiers to avoid parsing them as keywords - begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?! *\()(?![a-zA-Z0-9_\x7f-\xff])/, + match: regex.concat( + /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/, + regex.concat("(?!", WHITESPACE, "*\\()"), + /(?![a-zA-Z0-9_\x7f-\xff])/ + ), // scope:"wrong" }, CONSTRUCTOR_CALL, From 248b109ac477a2a529ba4c8fb65d5063a4deb0f5 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 15 Dec 2021 17:43:39 -0500 Subject: [PATCH 100/227] fix: correct parent scope is `title` - also add `title.function.invoke` to the official list (Rust was already using) --- docs/css-classes-reference.rst | 2 ++ src/languages/php.js | 2 +- test/markup/php/functions.expect.txt | 8 ++++---- test/markup/php/strings.expect.txt | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/css-classes-reference.rst b/docs/css-classes-reference.rst index 70d45e4dc4..9cea743642 100644 --- a/docs/css-classes-reference.rst +++ b/docs/css-classes-reference.rst @@ -70,6 +70,8 @@ in mind so a better choice (for best theme support) might possibly be ``string`` +--------------------------+-------------------------------------------------------------+ | title.function | name of a function | +--------------------------+-------------------------------------------------------------+ +| title.function.invoke | name of a function (when being invoked) | ++--------------------------+-------------------------------------------------------------+ | params | block of function arguments (parameters) at the | | | place of declaration | +--------------------------+-------------------------------------------------------------+ diff --git a/src/languages/php.js b/src/languages/php.js index 4832f88d71..371ef2ae78 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -330,7 +330,7 @@ export default function(hljs) { regex.lookahead(/(?=\()/) ], scope: { - 3: "function.title.invoke", + 3: "title.function.invoke", } }; diff --git a/test/markup/php/functions.expect.txt b/test/markup/php/functions.expect.txt index 946c41bd67..f6bc43f49a 100644 --- a/test/markup/php/functions.expect.txt +++ b/test/markup/php/functions.expect.txt @@ -11,11 +11,11 @@ * Function invoke */ $date = new DateTimeImmutable (); -$date->format('Y-m-d'); +$date->format('Y-m-d'); -DateTimeImmutable::createFromMutable(new \DateTime('now')); +DateTimeImmutable::createFromMutable(new \DateTime('now')); -str_contains (\strtoupper(substr('abcdef', -2), 'f')); +str_contains (\strtoupper(substr('abcdef', -2), 'f')); /** * Function declaration @@ -39,5 +39,5 @@ DateTimeImmutable::createFromMutable /** * First-class Callable Syntax */ -$fun = mb_strlen(); +$fun = mb_strlen(); $fun(); diff --git a/test/markup/php/strings.expect.txt b/test/markup/php/strings.expect.txt index 56f3428e3b..8a9c4dd8f5 100644 --- a/test/markup/php/strings.expect.txt +++ b/test/markup/php/strings.expect.txt @@ -12,12 +12,12 @@ MSG); // heredoc syntax -var_dump(<<<SQL +var_dump(<<<SQL SELECT * FROM table SQL); -var_dump(<<<SQL +var_dump(<<<SQL SELECT * FROM table SQL); From b1d8b85985d1aea0ff2e62333cc26a4953200e5e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 13:28:13 -0500 Subject: [PATCH 101/227] (chore) title.class for CoffeeScript --- src/languages/coffeescript.js | 40 ++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/languages/coffeescript.js b/src/languages/coffeescript.js index fd333c4c2b..51bf00cd05 100644 --- a/src/languages/coffeescript.js +++ b/src/languages/coffeescript.js @@ -155,6 +155,30 @@ export default function(hljs) { }] }; + const CLASS_DEFINITION = { + variants: [ + { + match: [ + /class\s+/, + JS_IDENT_RE, + /\s+extends\s+/, + JS_IDENT_RE + ] + }, + { + match: [ + /class\s+/, + JS_IDENT_RE + ] + } + ], + scope: { + 2: "title.class", + 4: "title.class.inherited" + }, + keywords: KEYWORDS + }; + return { name: 'CoffeeScript', aliases: [ @@ -190,21 +214,7 @@ export default function(hljs) { contains: [PARAMS] }] }, - { - className: 'class', - beginKeywords: 'class', - end: '$', - illegal: /[:="\[\]]/, - contains: [ - { - beginKeywords: 'extends', - endsWithParent: true, - illegal: /[:="\[\]]/, - contains: [TITLE] - }, - TITLE - ] - }, + CLASS_DEFINITION, { begin: JS_IDENT_RE + ':', end: ':', From d681045da395b32df8a7f3c985a799c74271977b Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 13:36:10 -0500 Subject: [PATCH 102/227] (chore) title.class for Livescript --- src/languages/livescript.js | 40 ++++++++++++++--------- test/markup/livescript/default.expect.txt | 2 +- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/languages/livescript.js b/src/languages/livescript.js index 21efa6f576..f55e004731 100644 --- a/src/languages/livescript.js +++ b/src/languages/livescript.js @@ -176,6 +176,30 @@ export default function(hljs) { begin: '(#=>|=>|\\|>>|-?->|!->)' }; + const CLASS_DEFINITION = { + variants: [ + { + match: [ + /class\s+/, + JS_IDENT_RE, + /\s+extends\s+/, + JS_IDENT_RE + ] + }, + { + match: [ + /class\s+/, + JS_IDENT_RE + ] + } + ], + scope: { + 2: "title.class", + 4: "title.class.inherited" + }, + keywords: KEYWORDS + }; + return { name: 'LiveScript', aliases: ['ls'], @@ -207,21 +231,7 @@ export default function(hljs) { } ] }, - { - className: 'class', - beginKeywords: 'class', - end: '$', - illegal: /[:="\[\]]/, - contains: [ - { - beginKeywords: 'extends', - endsWithParent: true, - illegal: /[:="\[\]]/, - contains: [TITLE] - }, - TITLE - ] - }, + CLASS_DEFINITION, { begin: JS_IDENT_RE + ':', end: ':', diff --git a/test/markup/livescript/default.expect.txt b/test/markup/livescript/default.expect.txt index 253ee2843f..bbf6630265 100644 --- a/test/markup/livescript/default.expect.txt +++ b/test/markup/livescript/default.expect.txt @@ -40,7 +40,7 @@ last-three [1 tofunction add x, y @result = x + y -class A +class A (num) -> @x = num property: 1 From 2b679bc65518236d9caf4cd649c63ca6123b51fe Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 13:49:09 -0500 Subject: [PATCH 103/227] (chore) title.class for protobuf --- src/languages/protobuf.js | 56 ++++++++++++++----- .../protobuf/message-message.expect.txt | 8 +-- test/markup/protobuf/rpc.expect.txt | 2 +- 3 files changed, 47 insertions(+), 19 deletions(-) diff --git a/src/languages/protobuf.js b/src/languages/protobuf.js index 13c88426ee..7cae0a4a24 100644 --- a/src/languages/protobuf.js +++ b/src/languages/protobuf.js @@ -7,29 +7,57 @@ Category: protocols */ export default function(hljs) { + const KEYWORDS = [ + "package", + "import", + "option", + "optional", + "required", + "repeated", + "group", + "oneof" + ]; + const TYPES = [ + "double", + "float", + "int32", + "int64", + "uint32", + "uint64", + "sint32", + "sint64", + "fixed32", + "fixed64", + "sfixed32", + "sfixed64", + "bool", + "string", + "bytes" + ]; + const CLASS_DEFINITION = { + match: [ + /(message|enum|service)\s+/, + hljs.IDENT_RE + ], + scope: { + 1: "keyword", + 2: "title.class" + } + }; + return { name: 'Protocol Buffers', keywords: { - keyword: 'package import option optional required repeated group oneof', - built_in: 'double float int32 int64 uint32 uint64 sint32 sint64 ' + - 'fixed32 fixed64 sfixed32 sfixed64 bool string bytes', - literal: 'true false' + keyword: KEYWORDS, + type: TYPES, + literal: ['true', 'false'] }, contains: [ hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, - { - className: 'class', - beginKeywords: 'message enum service', end: /\{/, - illegal: /\n/, - contains: [ - hljs.inherit(hljs.TITLE_MODE, { - starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title - }) - ] - }, + CLASS_DEFINITION, { className: 'function', beginKeywords: 'rpc', diff --git a/test/markup/protobuf/message-message.expect.txt b/test/markup/protobuf/message-message.expect.txt index 0243879d38..fcf7712b80 100644 --- a/test/markup/protobuf/message-message.expect.txt +++ b/test/markup/protobuf/message-message.expect.txt @@ -1,10 +1,10 @@ // A Container message -message Container { - message Message { - required int64 id = 1; +message Container { + message Message { + required int64 id = 1; } repeated Message messages = 1; - optional int32 number = 2; + optional int32 number = 2; } /* diff --git a/test/markup/protobuf/rpc.expect.txt b/test/markup/protobuf/rpc.expect.txt index a09ce497c0..6fdb5e5c47 100644 --- a/test/markup/protobuf/rpc.expect.txt +++ b/test/markup/protobuf/rpc.expect.txt @@ -1,4 +1,4 @@ -service Greeter { +service Greeter { // Sends a greeting rpc SayHello (HelloRequest) returns (HelloReply) {} } From 710ab05cc4c73ca72b212cd92f2bd4c0fa8a529e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 13:59:04 -0500 Subject: [PATCH 104/227] (chore) title.class and cleanup RSL --- src/languages/rsl.js | 130 +++++++++++++++++++++++++---- test/markup/rsl/default.expect.txt | 6 +- 2 files changed, 118 insertions(+), 18 deletions(-) diff --git a/src/languages/rsl.js b/src/languages/rsl.js index d5de88eab1..01cae371ac 100644 --- a/src/languages/rsl.js +++ b/src/languages/rsl.js @@ -7,19 +7,123 @@ Category: graphics */ export default function(hljs) { + const BUILT_INS = [ + "abs", + "acos", + "ambient", + "area", + "asin", + "atan", + "atmosphere", + "attribute", + "calculatenormal", + "ceil", + "cellnoise", + "clamp", + "comp", + "concat", + "cos", + "degrees", + "depth", + "Deriv", + "diffuse", + "distance", + "Du", + "Dv", + "environment", + "exp", + "faceforward", + "filterstep", + "floor", + "format", + "fresnel", + "incident", + "length", + "lightsource", + "log", + "match", + "max", + "min", + "mod", + "noise", + "normalize", + "ntransform", + "opposite", + "option", + "phong", + "pnoise", + "pow", + "printf", + "ptlined", + "radians", + "random", + "reflect", + "refract", + "renderinfo", + "round", + "setcomp", + "setxcomp", + "setycomp", + "setzcomp", + "shadow", + "sign", + "sin", + "smoothstep", + "specular", + "specularbrdf", + "spline", + "sqrt", + "step", + "tan", + "texture", + "textureinfo", + "trace", + "transform", + "vtransform", + "xcomp", + "ycomp", + "zcomp" + ]; + + const TYPES = [ + "matrix", + "float", + "color", + "point", + "normal", + "vector" + ]; + + const KEYWORDS = [ + "while", + "for", + "if", + "do", + "return", + "else", + "break", + "extern", + "continue" + ]; + + const CLASS_DEFINITION = { + match: [ + /(surface|displacement|light|volume|imager)/, + /\s+/, + hljs.IDENT_RE, + ], + scope: { + 1: "keyword", + 3: "title.class", + } + }; + return { name: 'RenderMan RSL', keywords: { - keyword: - 'float color point normal vector matrix while for if do return else break extern continue', - built_in: - 'abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise ' + - 'clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp ' + - 'faceforward filterstep floor format fresnel incident length lightsource log match ' + - 'max min mod noise normalize ntransform opposite option phong pnoise pow printf ' + - 'ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp ' + - 'setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan ' + - 'texture textureinfo trace transform vtransform xcomp ycomp zcomp' + keyword: KEYWORDS, + built_in: BUILT_INS, + type: TYPES }, illegal: ' -surface plastic (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1; - color specularcolor = 1;) { - normal Nf = faceforward (normalize(N),I); +surface plastic (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1; + color specularcolor = 1;) { + normal Nf = faceforward (normalize(N),I); Ci = Cs * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * Ks * specular(Nf,-normalize(I),roughness); Oi = Os; From 38a6701c6e5423082b7002ff9c37309f32ae963e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 14:07:02 -0500 Subject: [PATCH 105/227] (chore) improve oxgene - remove unnecessary `class` scope - add `;` as punctuation - remove deprecated `function` scope - use `title.function` for function names --- src/languages/oxygene.js | 25 +++++------- test/markup/oxygene/default.expect.txt | 56 +++++++++++++------------- 2 files changed, 37 insertions(+), 44 deletions(-) diff --git a/src/languages/oxygene.js b/src/languages/oxygene.js index 6eaef0d295..77c919e585 100644 --- a/src/languages/oxygene.js +++ b/src/languages/oxygene.js @@ -47,12 +47,11 @@ export default function(hljs) { begin: '(#\\d+)+' }; const FUNCTION = { - className: 'function', beginKeywords: 'function constructor destructor procedure method', end: '[:;]', keywords: 'function constructor|10 destructor|10 procedure|10 method|10', contains: [ - hljs.TITLE_MODE, + hljs.inherit(hljs.TITLE_MODE, {scope: "title.function" }), { className: 'params', begin: '\\(', @@ -67,6 +66,13 @@ export default function(hljs) { PAREN_COMMENT ] }; + + const SEMICOLON = { + scope: "punctuation", + match: /;/, + relevance: 0 + }; + return { name: 'Oxygene', case_insensitive: true, @@ -80,20 +86,7 @@ export default function(hljs) { CHAR_STRING, hljs.NUMBER_MODE, FUNCTION, - { - className: 'class', - begin: '=\\bclass\\b', - end: 'end;', - keywords: OXYGENE_KEYWORDS, - contains: [ - STRING, - CHAR_STRING, - CURLY_COMMENT, - PAREN_COMMENT, - hljs.C_LINE_COMMENT_MODE, - FUNCTION - ] - } + SEMICOLON ] }; } diff --git a/test/markup/oxygene/default.expect.txt b/test/markup/oxygene/default.expect.txt index ed31804143..187d068e41 100644 --- a/test/markup/oxygene/default.expect.txt +++ b/test/markup/oxygene/default.expect.txt @@ -1,56 +1,56 @@ -namespace LinkedList; +namespace LinkedList; interface uses - System.Text; + System.Text; type List<T> = public class - where T is Object; + where T is Object; private - method AppendToString(aBuilder: StringBuilder); + method AppendToString(aBuilder: StringBuilder); public - constructor(aData: T); - constructor(aData: T; aNext: List<T>); - property Next: List<T>; - property Data: T; + constructor(aData: T); + constructor(aData: T; aNext: List<T>); + property Next: List<T>; + property Data: T; - method ToString: string; override; - end; + method ToString: string; override; + end; implementation -constructor List<T>(aData: T); +constructor List<T>(aData: T); begin - Data := aData; -end; + Data := aData; +end; -constructor List<T>(aData: T; aNext: List<T>); +constructor List<T>(aData: T; aNext: List<T>); begin - constructor(aData); - Next := aNext; -end; + constructor(aData); + Next := aNext; +end; -method List<T>.ToString: string; +method List<T>.ToString: string; begin with lBuilder := new StringBuilder do begin - AppendToString(lBuilder); - result := lBuilder.ToString(); - end; -end; + AppendToString(lBuilder); + result := lBuilder.ToString(); + end; +end; -method List<T>.AppendToString(aBuilder: StringBuilder); +method List<T>.AppendToString(aBuilder: StringBuilder); begin if assigned(Data) then aBuilder.Append(Data.ToString) else - aBuilder.Append('nil'); + aBuilder.Append('nil'); if assigned(Next) then begin - aBuilder.Append(', '); - Next.AppendToString(aBuilder); - end; -end; + aBuilder.Append(', '); + Next.AppendToString(aBuilder); + end; +end; end. From df3db6b82f1858eebf9b00290d0b18fd844506cd Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 14:22:49 -0500 Subject: [PATCH 106/227] (chore) title.class for capnproto --- src/languages/capnproto.js | 50 ++++++++++---------- test/markup/capnproto/default.expect.txt | 58 ++++++++++++------------ 2 files changed, 53 insertions(+), 55 deletions(-) diff --git a/src/languages/capnproto.js b/src/languages/capnproto.js index 9986f7292a..5fa4ec5577 100644 --- a/src/languages/capnproto.js +++ b/src/languages/capnproto.js @@ -27,7 +27,7 @@ export default function(hljs) { "from", "fixed" ]; - const BUILT_INS = [ + const TYPES = [ "Void", "Bool", "Int8", @@ -51,12 +51,33 @@ export default function(hljs) { "true", "false" ]; + const CLASS_DEFINITION = { + variants: [ + { + match: [ + /(struct|enum|interface)/, /\s+/, + hljs.IDENT_RE + ] + }, + { + match: [ + /extends/, /\s*\(/, + hljs.IDENT_RE, + /\s*\)/ + ] + } + ], + scope: { + 1: "keyword", + 3: "title.class" + } + }; return { name: 'Cap’n Proto', aliases: ['capnp'], keywords: { keyword: KEYWORDS, - built_in: BUILT_INS, + type: TYPES, literal: LITERALS }, contains: [ @@ -72,30 +93,7 @@ export default function(hljs) { className: 'symbol', begin: /@\d+\b/ }, - { - className: 'class', - beginKeywords: 'struct enum', - end: /\{/, - illegal: /\n/, - contains: [hljs.inherit(hljs.TITLE_MODE, { - starts: { - endsWithParent: true, - excludeEnd: true - } // hack: eating everything after the first title - })] - }, - { - className: 'class', - beginKeywords: 'interface', - end: /\{/, - illegal: /\n/, - contains: [hljs.inherit(hljs.TITLE_MODE, { - starts: { - endsWithParent: true, - excludeEnd: true - } // hack: eating everything after the first title - })] - } + CLASS_DEFINITION ] }; } diff --git a/test/markup/capnproto/default.expect.txt b/test/markup/capnproto/default.expect.txt index b516975696..a62a9928aa 100644 --- a/test/markup/capnproto/default.expect.txt +++ b/test/markup/capnproto/default.expect.txt @@ -1,17 +1,17 @@ @0xdbb9ad1f14bf0b36; # unique file ID, generated by `capnp id` -struct Person { - name @0 :Text; +struct Person { + name @0 :Text; birthdate @3 :Date; - email @1 :Text; - phones @2 :List(PhoneNumber); + email @1 :Text; + phones @2 :List(PhoneNumber); - struct PhoneNumber { - number @0 :Text; + struct PhoneNumber { + number @0 :Text; type @1 :Type; - enum Type { + enum Type { mobile @0; home @1; work @2; @@ -19,37 +19,37 @@ } } -struct Date { - year @0 :Int16; - month @1 :UInt8; - day @2 :UInt8; - flags @3 :List(Bool) = [ true, false, false, true ]; +struct Date { + year @0 :Int16; + month @1 :UInt8; + day @2 :UInt8; + flags @3 :List(Bool) = [ true, false, false, true ]; } -interface Node { - isDirectory @0 () -> (result :Bool); +interface Node { + isDirectory @0 () -> (result :Bool); } -interface Directory extends(Node) { - list @0 () -> (list: List(Entry)); - struct Entry { - name @0 :Text; +interface Directory extends(Node) { + list @0 () -> (list: List(Entry)); + struct Entry { + name @0 :Text; node @1 :Node; } - create @1 (name :Text) -> (file :File); - mkdir @2 (name :Text) -> (directory :Directory) - open @3 (name :Text) -> (node :Node); - delete @4 (name :Text); - link @5 (name :Text, node :Node); + create @1 (name :Text) -> (file :File); + mkdir @2 (name :Text) -> (directory :Directory) + open @3 (name :Text) -> (node :Node); + delete @4 (name :Text); + link @5 (name :Text, node :Node); } -interface File extends(Node) { - size @0 () -> (size: UInt64); - read @1 (startAt :UInt64 = 0, amount :UInt64 = 0xffffffffffffffff) - -> (data: Data); +interface File extends(Node) { + size @0 () -> (size: UInt64); + read @1 (startAt :UInt64 = 0, amount :UInt64 = 0xffffffffffffffff) + -> (data: Data); # Default params = read entire file. - write @2 (startAt :UInt64, data :Data); - truncate @3 (size :UInt64); + write @2 (startAt :UInt64, data :Data); + truncate @3 (size :UInt64); } \ No newline at end of file From e609be9024184d88eefd3cd6a19f9366341f3ccd Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 14:35:11 -0500 Subject: [PATCH 107/227] (chore) title.class and other groovy cleanups --- src/languages/groovy.js | 90 ++++++++++++++++++++------- test/markup/groovy/default.expect.txt | 14 ++--- 2 files changed, 76 insertions(+), 28 deletions(-) diff --git a/src/languages/groovy.js b/src/languages/groovy.js index 99aefed333..04e3d3f4ed 100644 --- a/src/languages/groovy.js +++ b/src/languages/groovy.js @@ -66,19 +66,78 @@ export default function(hljs) { } ); + const CLASS_DEFINITION = { + match: [ + /(class|interface|trait|enum|extends|implements)/, + /\s+/, + hljs.UNDERSCORE_IDENT_RE + ], + scope: { + 1: "keyword", + 3: "title.class", + } + }; + const TYPES = [ + "byte", + "short", + "char", + "int", + "long", + "boolean", + "float", + "double", + "void" + ]; + const KEYWORDS = [ + // groovy specific keywords + "def", + "as", + "in", + "assert", + "trait", + // common keywords with Java + "abstract", + "static", + "volatile", + "transient", + "public", + "private", + "protected", + "synchronized", + "final", + "class", + "interface", + "enum", + "if", + "else", + "for", + "while", + "switch", + "case", + "break", + "default", + "continue", + "throw", + "throws", + "try", + "catch", + "finally", + "implements", + "extends", + "new", + "import", + "package", + "return", + "instanceof" + ]; + return { name: 'Groovy', keywords: { - built_in: 'this super', + "variable.language": 'this super', literal: 'true false null', - keyword: - 'byte short char int long boolean float double void ' + - // groovy specific keywords - 'def as in assert trait ' + - // common keywords with Java - 'abstract static volatile transient public private protected synchronized final ' + - 'class interface enum if else for while switch case break default continue ' + - 'throw throws try catch finally implements extends new import package return instanceof' + type: TYPES, + keyword: KEYWORDS }, contains: [ hljs.SHEBANG({ @@ -89,18 +148,7 @@ export default function(hljs) { STRING, REGEXP, NUMBER, - { - className: 'class', - beginKeywords: 'class interface trait enum', - end: /\{/, - illegal: ':', - contains: [ - { - beginKeywords: 'extends implements' - }, - hljs.UNDERSCORE_TITLE_MODE - ] - }, + CLASS_DEFINITION, { className: 'meta', begin: '@[A-Za-z]+', diff --git a/test/markup/groovy/default.expect.txt b/test/markup/groovy/default.expect.txt index 5962db4897..acaa4cc323 100644 --- a/test/markup/groovy/default.expect.txt +++ b/test/markup/groovy/default.expect.txt @@ -4,15 +4,15 @@ import groovy.transform.CompileStatic import java.util.List as MyList -trait Distributable { - void distribute(String version) {} +trait Distributable { + void distribute(String version) {} } @CompileStatic -class Distribution implements Distributable { - double number = 1234.234 / 567 +class Distribution implements Distributable { + double number = 1234.234 / 567 def otherNumber = 3 / 4 - boolean archivable = condition ?: true + boolean archivable = condition ?: true def ternary = a ? b : c String name = "Guillaume" Closure description = null @@ -30,9 +30,9 @@ * description method * @param cl the closure */ - void description(Closure cl) { this.description = cl } + void description(Closure cl) { this.description = cl } - void version(String name, Closure versionSpec) { + void version(String name, Closure versionSpec) { def closure = { println "hi" } as Runnable MyList ml = [1, 2, [a: 1, b:2,c :3]] From 1758dcaf0e4ac8df63fbe0ec0289c5e458c676db Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 3 Dec 2021 15:09:20 -0500 Subject: [PATCH 108/227] (chore) title.class and other monkey cleanup --- src/languages/monkey.js | 168 +++++++++++++++++++++----- test/markup/monkey/default.expect.txt | 10 +- 2 files changed, 141 insertions(+), 37 deletions(-) diff --git a/src/languages/monkey.js b/src/languages/monkey.js index 915fa20c98..2d64a442af 100644 --- a/src/languages/monkey.js +++ b/src/languages/monkey.js @@ -16,20 +16,137 @@ export default function(hljs) { hljs.NUMBER_MODE ] }; + const FUNC_DEFINITION = { + variants: [ + { + match: [ + /(function|method)/, + /\s+/, + hljs.UNDERSCORE_IDENT_RE, + ] + }, + ], + scope: { + 1: "keyword", + 3: "title.function" + } + }; + const CLASS_DEFINITION = { + variants: [ + { + match: [ + /(class|interface|extends|implements)/, + /\s+/, + hljs.UNDERSCORE_IDENT_RE, + ] + }, + ], + scope: { + 1: "keyword", + 3: "title.class" + } + }; + const BUILT_INS = [ + "DebugLog", + "DebugStop", + "Error", + "Print", + "ACos", + "ACosr", + "ASin", + "ASinr", + "ATan", + "ATan2", + "ATan2r", + "ATanr", + "Abs", + "Abs", + "Ceil", + "Clamp", + "Clamp", + "Cos", + "Cosr", + "Exp", + "Floor", + "Log", + "Max", + "Max", + "Min", + "Min", + "Pow", + "Sgn", + "Sgn", + "Sin", + "Sinr", + "Sqrt", + "Tan", + "Tanr", + "Seed", + "PI", + "HALFPI", + "TWOPI" + ]; + const LITERALS = [ + "true", + "false", + "null" + ]; + const KEYWORDS = [ + "public", + "private", + "property", + "continue", + "exit", + "extern", + "new", + "try", + "catch", + "eachin", + "not", + "abstract", + "final", + "select", + "case", + "default", + "const", + "local", + "global", + "field", + "end", + "if", + "then", + "else", + "elseif", + "endif", + "while", + "wend", + "repeat", + "until", + "forever", + "for", + "to", + "step", + "next", + "return", + "module", + "inline", + "throw", + "import", + // not positive, but these are not literals + "and", + "or", + "shl", + "shr", + "mod" + ]; return { name: 'Monkey', case_insensitive: true, keywords: { - keyword: 'public private property continue exit extern new try catch ' + - 'eachin not abstract final select case default const local global field ' + - 'end if then else elseif endif while wend repeat until forever for ' + - 'to step next return module inline throw import', - - built_in: 'DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil ' + - 'Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI', - - literal: 'true false null and or shl shr mod' + keyword: KEYWORDS, + built_in: BUILT_INS, + literal: LITERALS }, illegal: /\/\*/, contains: [ @@ -41,39 +158,26 @@ export default function(hljs) { relevance: 0 } ), + FUNC_DEFINITION, + CLASS_DEFINITION, { - className: 'function', - beginKeywords: 'function method', - end: '[(=:]|$', - illegal: /\n/, - contains: [ hljs.UNDERSCORE_TITLE_MODE ] - }, - { - className: 'class', - beginKeywords: 'class interface', - end: '$', - contains: [ - { - beginKeywords: 'extends implements' - }, - hljs.UNDERSCORE_TITLE_MODE - ] - }, - { - className: 'built_in', - begin: '\\b(self|super)\\b' + className: 'variable.language', + begin: /\b(self|super)\b/ }, { className: 'meta', - begin: '\\s*#', + begin: /\s*#/, end: '$', keywords: { keyword: 'if else elseif endif end then' } }, { - className: 'meta', - begin: '^\\s*strict\\b' + match: [ + /^\s*/, + /strict\b/ + ], + scope: { 2: "meta" } }, { beginKeywords: 'alias', diff --git a/test/markup/monkey/default.expect.txt b/test/markup/monkey/default.expect.txt index 8dfd03e961..5228c24cc4 100644 --- a/test/markup/monkey/default.expect.txt +++ b/test/markup/monkey/default.expect.txt @@ -6,18 +6,18 @@ Import mojo ' The main class which expends Mojo's 'App' class: -Class GameApp Extends App +Class GameApp Extends App Field player:Player - Method OnCreate:Int() + Method OnCreate:Int() Local img:Image = LoadImage("player.png") - Self.player = New Player() + Self.player = New Player() SetUpdateRate(60) Return 0 End - Method OnUpdate:Int() + Method OnUpdate:Int() player.x += HALFPI If (player.x > 100) Then @@ -27,7 +27,7 @@ Return 0 End - Method OnRender:Int() + Method OnRender:Int() Cls(32, 64, 128) player.Draw() From 61146b169caca6f8fb4eb70bee90e3c99946874b Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 7 Dec 2021 13:48:06 -0500 Subject: [PATCH 109/227] (chore) fix checkautodetect, fix elixir autodetect conflict --- src/languages/elixir.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/languages/elixir.js b/src/languages/elixir.js index c43101ad5e..c9b08a9570 100644 --- a/src/languages/elixir.js +++ b/src/languages/elixir.js @@ -262,10 +262,8 @@ export default function(hljs) { { className: 'variable', begin: '(\\$\\W)|((\\$|@@?)(\\w+))' - }, - { - begin: '->' } + // -> has been removed, capnproto always uses this grammar construct ]; SUBST.contains = ELIXIR_DEFAULT_CONTAINS; From 06c57ce3eb0faed01ea4af8f622b7f849e339236 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 7 Dec 2021 13:53:58 -0500 Subject: [PATCH 110/227] enh(x++) title.class.inherited for X++ --- src/languages/axapta.js | 39 ++++++++++++++++++--------- test/markup/axapta/default.expect.txt | 2 +- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/languages/axapta.js b/src/languages/axapta.js index f5768bddd9..90edecc6f6 100644 --- a/src/languages/axapta.js +++ b/src/languages/axapta.js @@ -8,6 +8,7 @@ Category: enterprise /** @type LanguageFn */ export default function(hljs) { + const IDENT_RE = hljs.UNDERSCORE_IDENT_RE; const BUILT_IN_KEYWORDS = [ 'anytype', 'boolean', @@ -144,6 +145,30 @@ export default function(hljs) { literal: LITERAL_KEYWORDS }; + const CLASS_DEFINITION = { + variants: [ + { + match: [ + /(class|interface)\s+/, + IDENT_RE, + /\s+(extends|implements)\s+/, + IDENT_RE + ] + }, + { + match: [ + /class\s+/, + IDENT_RE + ] + } + ], + scope: { + 2: "title.class", + 4: "title.class.inherited" + }, + keywords: KEYWORDS + }; + return { name: 'X++', aliases: ['x++'], @@ -159,19 +184,7 @@ export default function(hljs) { begin: '#', end: '$' }, - { - className: 'class', - beginKeywords: 'class interface', - end: /\{/, - excludeEnd: true, - illegal: ':', - contains: [ - { - beginKeywords: 'extends implements' - }, - hljs.UNDERSCORE_TITLE_MODE - ] - } + CLASS_DEFINITION ] }; } diff --git a/test/markup/axapta/default.expect.txt b/test/markup/axapta/default.expect.txt index dc645bb496..4ce35197d3 100644 --- a/test/markup/axapta/default.expect.txt +++ b/test/markup/axapta/default.expect.txt @@ -1,4 +1,4 @@ -class ExchRateLoadBatch extends RunBaseBatch { +class ExchRateLoadBatch extends RunBaseBatch { ExchRateLoad rbc; container currencies; boolean actual; From 4284811b743c4515598b41c61f301304125e2d72 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 7 Dec 2021 14:21:58 -0500 Subject: [PATCH 111/227] enh(cal) simplify using multi-matchers --- src/languages/cal.js | 97 ++++++++++++++++++++++++------ test/detect/cal/default.txt | 9 ++- test/markup/cal/default.expect.txt | 18 +++--- 3 files changed, 96 insertions(+), 28 deletions(-) diff --git a/src/languages/cal.js b/src/languages/cal.js index 94cee44a0c..bcbbecc822 100644 --- a/src/languages/cal.js +++ b/src/languages/cal.js @@ -7,9 +7,35 @@ Website: https://docs.microsoft.com/en-us/dynamics-nav/programming-in-c-al /** @type LanguageFn */ export default function(hljs) { - const KEYWORDS = - 'div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to ' + - 'until while with var'; + const regex = hljs.regex; + const KEYWORDS = [ + "div", + "mod", + "in", + "and", + "or", + "not", + "xor", + "asserterror", + "begin", + "case", + "do", + "downto", + "else", + "end", + "exit", + "for", + "local", + "if", + "of", + "repeat", + "then", + "to", + "until", + "while", + "with", + "var" + ]; const LITERALS = 'false true'; const COMMENT_MODES = [ hljs.C_LINE_COMMENT_MODE, @@ -52,12 +78,17 @@ export default function(hljs) { }; const PROCEDURE = { - className: 'function', - beginKeywords: 'procedure', - end: /[:;]/, - keywords: 'procedure|10', + match: [ + /procedure/, + /\s+/, + /[a-zA-Z_][\w@]*/, + /\s*/ + ], + scope: { + 1: "keyword", + 3: "title.function" + }, contains: [ - hljs.TITLE_MODE, { className: 'params', begin: /\(/, @@ -65,20 +96,49 @@ export default function(hljs) { keywords: KEYWORDS, contains: [ STRING, - CHAR_STRING + CHAR_STRING, + hljs.NUMBER_MODE ] - } - ].concat(COMMENT_MODES) + }, + ...COMMENT_MODES + ] }; + const OBJECT_TYPES = [ + "Table", + "Form", + "Report", + "Dataport", + "Codeunit", + "XMLport", + "MenuSuite", + "Page", + "Query" + ]; const OBJECT = { - className: 'class', - begin: 'OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)', - returnBegin: true, - contains: [ - hljs.TITLE_MODE, - PROCEDURE - ] + match: [ + /OBJECT/, + /\s+/, + regex.either(...OBJECT_TYPES), + /\s+/, + /\d+/, + /\s+(?=[^\s])/, + /.*/, + /$/ + ], + relevance: 3, + scope: { + 1: "keyword", + 3: "type", + 5: "number", + 7: "title" + } + }; + + const PROPERTY = { + match: /[\w]+(?=\=)/, + scope: "attribute", + relevance: 0 }; return { @@ -90,6 +150,7 @@ export default function(hljs) { }, illegal: /\/\*/, contains: [ + PROPERTY, STRING, CHAR_STRING, DATE, diff --git a/test/detect/cal/default.txt b/test/detect/cal/default.txt index 5eec86caf0..eb65b97364 100644 --- a/test/detect/cal/default.txt +++ b/test/detect/cal/default.txt @@ -1,4 +1,11 @@ -OBJECT Codeunit 11 Gen. Jnl.-Check Line +OBJECT Table 12 something +{ +} +OBJECT XMLport 3000 something.other +{ +} + +OBJECT Codeunit 11 Gen. Jnl.-Chck Line { OBJECT-PROPERTIES { diff --git a/test/markup/cal/default.expect.txt b/test/markup/cal/default.expect.txt index 20f52bece3..6041808c0a 100644 --- a/test/markup/cal/default.expect.txt +++ b/test/markup/cal/default.expect.txt @@ -1,16 +1,16 @@ -OBJECT Codeunit 11 Gen. Jnl.-Check Line +OBJECT Codeunit 11 Gen. Jnl.-Check Line { OBJECT-PROPERTIES { - Date=09-09-14; - Time=12:00:00; - Version List=NAVW18.00; + Date=09-09-14; + Time=12:00:00; + Version List=NAVW18.00; } PROPERTIES { - TableNo=81; - Permissions=TableData 252=rimd; - OnRun=BEGIN + TableNo=81; + Permissions=TableData 252=rimd; + OnRun=BEGIN GLSetup.GET; RunCheck(Rec); END; @@ -22,12 +22,12 @@ Text000@1000 : TextConst 'ENU=can only be a closing date for G/L entries'; Text001@1001 : TextConst 'ENU=is not within your range of allowed posting dates'; - PROCEDURE ErrorIfPositiveAmt@2(GenJnlLine@1000 : Record 81); + PROCEDURE ErrorIfPositiveAmt@2(GenJnlLine@1000 : Record 81); BEGIN IF GenJnlLine.Amount > 0 THEN GenJnlLine.FIELDERROR(Amount,Text008); END; - LOCAL PROCEDURE CheckGenJnlLineDocType@7(GenJnlLine@1001 : Record 81); + LOCAL PROCEDURE CheckGenJnlLineDocType@7(GenJnlLine@1001 : Record 81); } } From bc5a10f1cae3aa725251b2fc5c88bb1492b6fe4a Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Thu, 16 Dec 2021 21:32:28 +0100 Subject: [PATCH 112/227] enh(php) add PHP 8.1 keywords --- CHANGES.md | 1 + src/languages/php.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 05034fcaea..a463fbb50c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ These changes should be for the better and should not be super noticeable but if Grammars: +- enh(php) add PHP 8.1 keywords [Wojciech Kania][] - enh(php) support First-class Callable Syntax (#3427) [Wojciech Kania][] - enh(php) support class constructor call (#3427) [Wojciech Kania][] - enh(php) support function invoke (#3427) [Wojciech Kania][] diff --git a/src/languages/php.js b/src/languages/php.js index 371ef2ae78..387abd8adc 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -151,11 +151,13 @@ export default function(hljs) { "match|0", "mixed", "new", + "never", "object", "or", "private", "protected", "public", + "readonly", "real", "return", "string", @@ -245,7 +247,9 @@ export default function(hljs) { // Reserved interfaces: // "ArrayAccess", + "BackedEnum", "Closure", + "Fiber", "Generator", "Iterator", "IteratorAggregate", @@ -253,6 +257,7 @@ export default function(hljs) { "Stringable", "Throwable", "Traversable", + "UnitEnum", "WeakReference", "WeakMap", // Reserved classes: From 093b67f829dc52b387527705ecf3c8990c437e14 Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Thu, 16 Dec 2021 21:45:59 +0100 Subject: [PATCH 113/227] (chore) Replace className with scope and use match --- src/languages/php.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/languages/php.js b/src/languages/php.js index 387abd8adc..728e744720 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -13,14 +13,14 @@ Category: common export default function(hljs) { const regex = hljs.regex; const VARIABLE = { - className: 'variable', - begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' + + scope: 'variable', + match: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' + // negative look-ahead tries to avoid matching patterns that are not // Perl at all like $ident$, @ident@, etc. `(?![A-Za-z0-9])(?![$])` }; const PREPROCESSOR = { - className: 'meta', + scope: 'meta', variants: [ { begin: /<\?php/, relevance: 10 }, // boost for obvious PHP { begin: /<\?[=]?/ }, @@ -28,7 +28,7 @@ export default function(hljs) { ] }; const SUBST = { - className: 'subst', + scope: 'subst', variants: [ { begin: /\$\w+/ }, { begin: /\{\$/, end: /\}/ } @@ -49,7 +49,7 @@ export default function(hljs) { // list of valid whitespaces because non-breaking space might be part of a name const WHITESPACE = '[ \t\n]'; const STRING = { - className: 'string', + scope: 'string', variants: [ DOUBLE_QUOTED, SINGLE_QUOTED, @@ -57,7 +57,7 @@ export default function(hljs) { ] }; const NUMBER = { - className: 'number', + scope: 'number', variants: [ { begin: `\\b0[bB][01]+(?:_[01]+)*\\b` }, // Binary w/ underscore support { begin: `\\b0[oO][0-7]+(?:_[0-7]+)*\\b` }, // Octals w/ underscore support @@ -374,8 +374,8 @@ export default function(hljs) { }, PREPROCESSOR, { - className: 'variable.language', - begin: /\$this\b/ + scope: 'variable.language', + match: /\$this\b/ }, VARIABLE, FUNCTION_INVOKE, @@ -390,7 +390,7 @@ export default function(hljs) { }, CONSTRUCTOR_CALL, { - className: 'function', + scope: 'function', relevance: 0, beginKeywords: 'fn function', end: /[;{]/, excludeEnd: true, illegal: '[$%\\[]', @@ -404,7 +404,7 @@ export default function(hljs) { endsParent: true }, { - className: 'params', + scope: 'params', begin: '\\(', end: '\\)', excludeBegin: true, excludeEnd: true, @@ -420,7 +420,7 @@ export default function(hljs) { ] }, { - className: 'class', + scope: 'class', variants: [ { beginKeywords: "enum", illegal: /[($"]/ }, { beginKeywords: "class interface trait", illegal: /[:($"]/ } From 413425d4c74a272ac841e2870336ccce098fd64e Mon Sep 17 00:00:00 2001 From: Angelo Verlain <37999241+vixalien@users.noreply.github.com> Date: Sat, 18 Dec 2021 15:23:11 +0200 Subject: [PATCH 114/227] (chore) Fix typo in README on "good first issue" badge (#3431) When you clicked the badge it took you to "beginner friendly" instead of "good first issue" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05d926f528..e1fcf0656f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [![discord](https://badgen.net/badge/icon/discord?icon=discord&label&color=pink)](https://discord.gg/M24EbU7ja9) [![open issues](https://badgen.net/github/open-issues/highlightjs/highlight.js?label=issues)](https://github.com/highlightjs/highlight.js/issues) [![help welcome issues](https://badgen.net/github/label-issues/highlightjs/highlight.js/help%20welcome/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+welcome%22) -[![good first issue](https://badgen.net/github/label-issues/highlightjs/highlight.js/good%20first%20issue/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22) +[![good first issue](https://badgen.net/github/label-issues/highlightjs/highlight.js/good%20first%20issue/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) From c5ff49e7cf2b975a0f63500a6f647b0ff57f74ab Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Wed, 22 Dec 2021 14:32:27 +0100 Subject: [PATCH 115/227] fix(julia-repl) `aliases` was not in correct object (#3432) --- CHANGES.md | 2 ++ src/languages/julia-repl.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a463fbb50c..ade99dd748 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -42,6 +42,7 @@ Grammars: - enh(clojure) Add `regex` mode to regex literal - fix(clojure) Remove inconsistent/broken highlighting for metadata - enh(clojure) Add `punctuation` mode for commas. +- fix(julia) Enable the `jldoctest` alias (#3432) [Fons van der Plas][] Developer Tools: @@ -61,6 +62,7 @@ Themes: [Samia Ali]: https://github.com/samiaab1990 [Matthieu Lempereur]: https://github.com/MrYamous [idleberg]: https://github.com/idleberg +[Fons van der Plas]: https://github.com/fonsp ## Version 11.3.1 diff --git a/src/languages/julia-repl.js b/src/languages/julia-repl.js index 6772b86641..8094c4fa9f 100644 --- a/src/languages/julia-repl.js +++ b/src/languages/julia-repl.js @@ -35,14 +35,14 @@ export default function(hljs) { // least six spaces in the beginning end: /^(?![ ]{6})/, subLanguage: 'julia' + }, }, - // jldoctest Markdown blocks are used in the Julia manual and package docs indicate - // code snippets that should be verified when the documentation is built. They can be - // either REPL-like or script-like, but are usually REPL-like and therefore we apply - // julia-repl highlighting to them. More information can be found in Documenter's - // manual: https://juliadocs.github.io/Documenter.jl/latest/man/doctests.html - aliases: ['jldoctest'] - } - ] + ], + // jldoctest Markdown blocks are used in the Julia manual and package docs indicate + // code snippets that should be verified when the documentation is built. They can be + // either REPL-like or script-like, but are usually REPL-like and therefore we apply + // julia-repl highlighting to them. More information can be found in Documenter's + // manual: https://juliadocs.github.io/Documenter.jl/latest/man/doctests.html + aliases: ['jldoctest'], } } From c0138d99b476933eb105e9c7eff4b2cd006d70bb Mon Sep 17 00:00:00 2001 From: Pegasis Date: Mon, 27 Dec 2021 09:16:40 -0500 Subject: [PATCH 116/227] (themes) Add new `intellij-light` theme (#3433) --- CHANGES.md | 2 + src/styles/intellij-light.css | 119 ++++++++++++++++++++++++++++++++++ tools/developer.html | 1 + 3 files changed, 122 insertions(+) create mode 100644 src/styles/intellij-light.css diff --git a/CHANGES.md b/CHANGES.md index ade99dd748..b5c98322d9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ Themes: - `Default` is now much closer WCAG AA (contrast) (#3402) [Josh Goebel] - `Dark` now meets WCAG AA (contrast) (#3402) [Josh Goebel] +- Added `intellij-light` theme [Pegasis] These changes should be for the better and should not be super noticeable but if you're super picky about your colors you may want to intervene here or copy over the older themes from 11.3 or prior. @@ -52,6 +53,7 @@ Themes: - Modified background color in css for Gradient Light and Gradient Dark themes [Samia Ali][] +[Pegasis]: https://github.com/PegasisForever [Wojciech Kania]: https://github.com/wkania [Jeylani B]: https://github.com/jeyllani [Richard Gibson]: https://github.com/gibson042 diff --git a/src/styles/intellij-light.css b/src/styles/intellij-light.css new file mode 100644 index 0000000000..4ab3f230bb --- /dev/null +++ b/src/styles/intellij-light.css @@ -0,0 +1,119 @@ +/* + +Intellij-light style (c) Pegasis + +*/ + +.hljs { + color: #000; + background: #fff; +} + +.hljs-subst, +.hljs-title { + font-weight: normal; + color: #000; +} + +.hljs-title.function_ { + color: #7A7A43; +} + +.hljs-code, +.hljs-comment, +.hljs-quote { + color: #8C8C8C; + font-style: italic; +} + +.hljs-meta { + color: #9E880D; +} + +.hljs-section { + color: #871094; +} + +.hljs-variable.language_, +.hljs-symbol, +.hljs-selector-class, +.hljs-selector-id, +.hljs-selector-tag, +.hljs-template-tag, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-keyword, +.hljs-meta .hljs-keyword, +.hljs-literal, +.hljs-name, +.hljs-built_in, +.hljs-type { + color: #0033B3; +} + +.hljs-property, +.hljs-attr { + color: #871094; +} + +.hljs-attribute { + color: #174AD4; +} + +.hljs-number { + color: #1750EB; +} + +.hljs-regexp { + color: #264EFF; +} + +.hljs-link { + text-decoration: underline; + color: #006DCC; +} + +.hljs-meta .hljs-string, +.hljs-string { + color: #067D17; +} + +.hljs-char.escape_ { + color: #0037A6; +} + +.hljs-doctag { + text-decoration: underline; +} + +.hljs-template-variable { + color: #248F8F; +} + +.hljs-addition { + background: #BEE6BE; +} + +.hljs-deletion { + background: #D6D6D6; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-variable, +.hljs-operator, +.hljs-punctuation, +.hljs-title.class_.inherited__, +.hljs-title.class_, +.hljs-params, +.hljs-bullet, +.hljs-formula, +.hljs-tag { + /* purposely ignored */ +} diff --git a/tools/developer.html b/tools/developer.html index 0690702bfa..5707b0600b 100644 --- a/tools/developer.html +++ b/tools/developer.html @@ -107,6 +107,7 @@

Code

+ From 7355c13512374e14b93f7124f67e71d300924f4c Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 29 Dec 2021 07:01:45 -0500 Subject: [PATCH 117/227] fix(cpp) `vector<<` false positive as template begin (#3438) --- CHANGES.md | 1 + src/languages/cpp.js | 2 +- test/markup/cpp/bugs.expect.txt | 6 ++++++ test/markup/cpp/bugs.txt | 6 ++++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/markup/cpp/bugs.expect.txt create mode 100644 test/markup/cpp/bugs.txt diff --git a/CHANGES.md b/CHANGES.md index b5c98322d9..071402f28d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ These changes should be for the better and should not be super noticeable but if Grammars: - enh(php) add PHP 8.1 keywords [Wojciech Kania][] +- fix(cpp) fix `vector<<` template false positive (#3437) [Josh Goebel][] - enh(php) support First-class Callable Syntax (#3427) [Wojciech Kania][] - enh(php) support class constructor call (#3427) [Wojciech Kania][] - enh(php) support function invoke (#3427) [Wojciech Kania][] diff --git a/src/languages/cpp.js b/src/languages/cpp.js index e2cf5a9d28..54e3bced7d 100644 --- a/src/languages/cpp.js +++ b/src/languages/cpp.js @@ -558,7 +558,7 @@ export default function(hljs) { [ PREPROCESSOR, { // containers: ie, `vector rooms (9);` - begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<', + begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)', end: '>', keywords: CPP_KEYWORDS, contains: [ diff --git a/test/markup/cpp/bugs.expect.txt b/test/markup/cpp/bugs.expect.txt new file mode 100644 index 0000000000..08e8689dfc --- /dev/null +++ b/test/markup/cpp/bugs.expect.txt @@ -0,0 +1,6 @@ +//4. 对角矩阵 +//4.1 构造对角矩阵 +Eigen::VectorXd vector(5); //构建5维向量 +vector<<1,2,3,4,5; //向量赋值 +Eigen::MatrixXd C(vector.asDiagonal()); //使用向量生成对角阵 +std::cout << "\nC= \n" << C << std::endl; diff --git a/test/markup/cpp/bugs.txt b/test/markup/cpp/bugs.txt new file mode 100644 index 0000000000..00c4281821 --- /dev/null +++ b/test/markup/cpp/bugs.txt @@ -0,0 +1,6 @@ +//4. 对角矩阵 +//4.1 构造对角矩阵 +Eigen::VectorXd vector(5); //构建5维向量 +vector<<1,2,3,4,5; //向量赋值 +Eigen::MatrixXd C(vector.asDiagonal()); //使用向量生成对角阵 +std::cout << "\nC= \n" << C << std::endl; From 360f5c42c2d26ac51f90fb56d351a745e3cb1e66 Mon Sep 17 00:00:00 2001 From: John Foster Date: Thu, 30 Dec 2021 14:35:33 -0800 Subject: [PATCH 118/227] Add curl to supported languages (#3445) --- CHANGES.md | 1 + SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 071402f28d..4fe1fdbdbf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ New Language: - Added 3rd party Pine Script grammar to SUPPORTED_LANGUAGES [Jeylani B][] +- Added 3rd party cURL grammar to SUPPORTED_LANGUAGES [highlightjs-curl][https://github.com/highlightjs/highlightjs-curl] Themes: diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index ed4382692a..c73a294af5 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -52,6 +52,7 @@ The table below shows the full list of languages (and corresponding classes/alia | CpcdosC+ | cpc | [highlightjs-cpcdos](https://github.com/SPinti-Software/highlightjs-cpcdos) | | Crmsh | crmsh, crm, pcmk | | | Crystal | crystal, cr | | +| cURL | curl | [highlightjs-curl](https://github.com/highlightjs/highlightjs-curl) | | Cypher (Neo4j) | cypher | [highlightjs-cypher](https://github.com/highlightjs/highlightjs-cypher) | | D | d | | | Dafny | dafny | [highlightjs-dafny](https://github.com/ConsenSys/highlightjs-dafny)| From 2e344f51c305dabc06005f1a17c439e934600727 Mon Sep 17 00:00:00 2001 From: John Foster Date: Thu, 30 Dec 2021 15:12:41 -0800 Subject: [PATCH 119/227] Update CHANGES.md (#3447) --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 4fe1fdbdbf..0e6f4b1bdf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,7 @@ New Language: - Added 3rd party Pine Script grammar to SUPPORTED_LANGUAGES [Jeylani B][] -- Added 3rd party cURL grammar to SUPPORTED_LANGUAGES [highlightjs-curl][https://github.com/highlightjs/highlightjs-curl] +- Added 3rd party cURL grammar to SUPPORTED_LANGUAGES [highlightjs-curl](https://github.com/highlightjs/highlightjs-curl) Themes: From 0e3735ac62a35b7296b7e92bc39f73d587c738f5 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 1 Jan 2022 17:17:26 -0600 Subject: [PATCH 120/227] tools: check-theme: consider background-color too (#3449) * tools: check-theme: consider `background-color` too This is the precise property we want to check. --- tools/checkTheme.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/checkTheme.js b/tools/checkTheme.js index bd2587e6d0..45ae7d9157 100755 --- a/tools/checkTheme.js +++ b/tools/checkTheme.js @@ -193,7 +193,10 @@ class CSSRule { constructor(rule, body) { this.rule = rule; if (rule.declarations) { - this.bg = rule.declarations.find(x => x.property =="background")?.value; + this.bg = rule.declarations.find(x => x.property == "background-color")?.value; + if (!this.bg) { + this.bg = rule.declarations.find(x => x.property == "background")?.value; + } this.fg = rule.declarations.find(x => x.property =="color")?.value; if (this.bg) { From e828d694b4dc8cc7f9c1aae8a2cab806178cb446 Mon Sep 17 00:00:00 2001 From: wkania Date: Tue, 4 Jan 2022 23:50:39 +0100 Subject: [PATCH 121/227] enh(php) Left and right-side of double colon (#3422) - declare and use `IDENT_RE` for valid labels instead of `w+` - declaration of PHP [constants](https://www.php.net/manual/en/language.oop5.constants.php) were not highlighted. Now they use the same class as variables. - enum and constant reference were not highlighted. Now they use the same class as variables. - Class name references are highlighted as `variable.language`. [class](https://wiki.php.net/rfc/class_name_literal_on_object) is a special case of the constant, it's also a reserved keyword. - left-side class name highlighting --- CHANGES.md | 2 + src/languages/php.js | 94 +++++++++++++++++++++++----- test/markup/php/functions.expect.txt | 2 +- test/markup/php/titles.expect.txt | 26 ++++++++ test/markup/php/titles.txt | 26 ++++++++ 5 files changed, 132 insertions(+), 18 deletions(-) create mode 100644 test/markup/php/titles.expect.txt create mode 100644 test/markup/php/titles.txt diff --git a/CHANGES.md b/CHANGES.md index 0e6f4b1bdf..92f6d7b2f5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,8 @@ These changes should be for the better and should not be super noticeable but if Grammars: +- enh(php) Left and right-side of double colon [Wojciech Kania][] +- enh(php) add PHP constants [Wojciech Kania][] - enh(php) add PHP 8.1 keywords [Wojciech Kania][] - fix(cpp) fix `vector<<` template false positive (#3437) [Josh Goebel][] - enh(php) support First-class Callable Syntax (#3427) [Wojciech Kania][] diff --git a/src/languages/php.js b/src/languages/php.js index 728e744720..7f0be203ae 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -12,12 +12,16 @@ Category: common * */ export default function(hljs) { const regex = hljs.regex; + const IDENT_RE_CORE = '[a-zA-Z0-9_\x7f-\xff]*' + + // negative look-ahead tries to avoid matching patterns that are not + // Perl at all like $ident$, @ident@, etc. + '(?![A-Za-z0-9])(?![$]))'; + const IDENT_RE = regex.concat("([a-zA-Z_\\x7f-\\xff]", IDENT_RE_CORE); + // Will not detect camelCase classes + const PASCAL_CASE_CLASS_NAME_RE = regex.concat("([A-Z]", IDENT_RE_CORE); const VARIABLE = { scope: 'variable', - match: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' + - // negative look-ahead tries to avoid matching patterns that are not - // Perl at all like $ident$, @ident@, etc. - `(?![A-Za-z0-9])(?![$])` + match: '\\$+' + IDENT_RE, }; const PREPROCESSOR = { scope: 'meta', @@ -46,7 +50,7 @@ export default function(hljs) { end: /[ \t]*(\w+)\b/, contains: hljs.QUOTE_STRING_MODE.contains.concat(SUBST), }); - // list of valid whitespaces because non-breaking space might be part of a name + // list of valid whitespaces because non-breaking space might be part of a IDENT_RE const WHITESPACE = '[ \t\n]'; const STRING = { scope: 'string', @@ -313,8 +317,8 @@ export default function(hljs) { regex.concat(WHITESPACE, "+"), // to prevent built ins from being confused as the class constructor call regex.concat("(?!", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), - /\\?\w+/, - regex.concat(WHITESPACE, "*\\("), + regex.concat(/\\?/, IDENT_RE), + regex.concat(WHITESPACE, "*", /\(/), ], scope: { 1: "keyword", @@ -330,7 +334,7 @@ export default function(hljs) { /\b/, // to prevent keywords from being confused as the function title regex.concat("(?!fn\\b|function\\b|", normalizeKeywords(KWS).join("\\b|"), "|", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), - /\w+/, + IDENT_RE, regex.concat(WHITESPACE, "*"), regex.lookahead(/(?=\()/) ], @@ -339,6 +343,57 @@ export default function(hljs) { } }; + const CONSTANT_REFERENCE = regex.concat(IDENT_RE, "\\b(?!\\()"); + + const LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON = { + variants: [ + { + match: [ + regex.concat( + /::/, + regex.lookahead(/(?!class\b)/) + ), + CONSTANT_REFERENCE, + ], + scope: { + 2: "variable.constant", + }, + }, + { + match: [ + /::/, + /class/, + ], + scope: { + 2: "variable.language", + }, + }, + { + match: [ + PASCAL_CASE_CLASS_NAME_RE, + regex.concat( + "::", + regex.lookahead(/(?!class\b)/) + ), + ], + scope: { + 1: "title.class", + }, + }, + { + match: [ + PASCAL_CASE_CLASS_NAME_RE, + /::/, + /class/, + ], + scope: { + 1: "title.class", + 3: "variable.language", + }, + } + ] + }; + return { case_insensitive: false, keywords: KEYWORDS, @@ -351,8 +406,8 @@ export default function(hljs) { { contains: [ { - className: 'doctag', - begin: '@[A-Za-z]+' + scope: 'doctag', + match: '@[A-Za-z]+' } ] } @@ -379,14 +434,18 @@ export default function(hljs) { }, VARIABLE, FUNCTION_INVOKE, + LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON, { - // swallow composed identifiers to avoid parsing them as keywords - match: regex.concat( - /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/, - regex.concat("(?!", WHITESPACE, "*\\()"), - /(?![a-zA-Z0-9_\x7f-\xff])/ - ), - // scope:"wrong" + match: [ + /const/, + /\s/, + IDENT_RE, + /\s*=/, + ], + scope: { + 1: "keyword", + 3: "variable.constant", + }, }, CONSTRUCTOR_CALL, { @@ -412,6 +471,7 @@ export default function(hljs) { contains: [ 'self', VARIABLE, + LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON, hljs.C_BLOCK_COMMENT_MODE, STRING, NUMBER diff --git a/test/markup/php/functions.expect.txt b/test/markup/php/functions.expect.txt index f6bc43f49a..88c5d94ebe 100644 --- a/test/markup/php/functions.expect.txt +++ b/test/markup/php/functions.expect.txt @@ -13,7 +13,7 @@ $date = new DateTimeImmutable (); $date->format('Y-m-d'); -DateTimeImmutable::createFromMutable(new \DateTime('now')); +DateTimeImmutable::createFromMutable(new \DateTime('now')); str_contains (\strtoupper(substr('abcdef', -2), 'f')); diff --git a/test/markup/php/titles.expect.txt b/test/markup/php/titles.expect.txt new file mode 100644 index 0000000000..05763d78a2 --- /dev/null +++ b/test/markup/php/titles.expect.txt @@ -0,0 +1,26 @@ +final class Example extends Foo { + const FOO='foo'; + + public function __construct( + public readonly string $name = self::FOO + ) {} + + public function getClass(): string { + return DateTimeImmutable::class; + } + + public function getClassFromSelf(): string { + return self::class; + } + + public static function getClassFromStatic(): string { + return static::class; + } + + public static function getParentClass(): string { + return parent::class; + } +} + +$date = DateTimeImmutable::createFromMutable(new \DateTime()); +echo $date::class; diff --git a/test/markup/php/titles.txt b/test/markup/php/titles.txt new file mode 100644 index 0000000000..6ff19f2fc6 --- /dev/null +++ b/test/markup/php/titles.txt @@ -0,0 +1,26 @@ +final class Example extends Foo { + const FOO='foo'; + + public function __construct( + public readonly string $name = self::FOO + ) {} + + public function getClass(): string { + return DateTimeImmutable::class; + } + + public function getClassFromSelf(): string { + return self::class; + } + + public static function getClassFromStatic(): string { + return static::class; + } + + public static function getParentClass(): string { + return parent::class; + } +} + +$date = DateTimeImmutable::createFromMutable(new \DateTime()); +echo $date::class; From c88890c57ce8c286366172fe18c565baa5ddbfad Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 4 Jan 2022 18:54:36 -0500 Subject: [PATCH 122/227] chore(arcade) eslint --fix, explode keywords --- src/languages/arcade.js | 242 ++++++++++++++++++++++++++++++---------- 1 file changed, 185 insertions(+), 57 deletions(-) diff --git a/src/languages/arcade.js b/src/languages/arcade.js index 45abb1ea18..579d5b475a 100644 --- a/src/languages/arcade.js +++ b/src/languages/arcade.js @@ -10,22 +10,156 @@ export default function(hljs) { const IDENT_RE = '[A-Za-z_][0-9A-Za-z_]*'; const KEYWORDS = { - keyword: - 'if for while var new function do return void else break', - literal: - 'BackSlash DoubleQuote false ForwardSlash Infinity NaN NewLine null PI SingleQuote Tab TextFormatting true undefined', - built_in: - 'Abs Acos Angle Attachments Area AreaGeodetic Asin Atan Atan2 Average Bearing Boolean Buffer BufferGeodetic ' + - 'Ceil Centroid Clip Console Constrain Contains Cos Count Crosses Cut Date DateAdd ' + - 'DateDiff Day Decode DefaultValue Dictionary Difference Disjoint Distance DistanceGeodetic Distinct ' + - 'DomainCode DomainName Equals Exp Extent Feature FeatureSet FeatureSetByAssociation FeatureSetById FeatureSetByPortalItem ' + - 'FeatureSetByRelationshipName FeatureSetByTitle FeatureSetByUrl Filter First Floor Geometry GroupBy Guid HasKey Hour IIf IndexOf ' + - 'Intersection Intersects IsEmpty IsNan IsSelfIntersecting Length LengthGeodetic Log Max Mean Millisecond Min Minute Month ' + - 'MultiPartToSinglePart Multipoint NextSequenceValue Now Number OrderBy Overlaps Point Polygon ' + - 'Polyline Portal Pow Random Relate Reverse RingIsClockWise Round Second SetGeometry Sin Sort Sqrt Stdev Sum ' + - 'SymmetricDifference Tan Text Timestamp Today ToLocal Top Touches ToUTC TrackCurrentTime ' + - 'TrackGeometryWindow TrackIndex TrackStartTime TrackWindow TypeOf Union UrlEncode Variance ' + - 'Weekday When Within Year ' + keyword: [ + "if", + "for", + "while", + "var", + "new", + "function", + "do", + "return", + "void", + "else", + "break" + ], + literal: [ + "BackSlash", + "DoubleQuote", + "false", + "ForwardSlash", + "Infinity", + "NaN", + "NewLine", + "null", + "PI", + "SingleQuote", + "Tab", + "TextFormatting", + "true", + "undefined" + ], + built_in: [ + "Abs", + "Acos", + "Angle", + "Attachments", + "Area", + "AreaGeodetic", + "Asin", + "Atan", + "Atan2", + "Average", + "Bearing", + "Boolean", + "Buffer", + "BufferGeodetic", + "Ceil", + "Centroid", + "Clip", + "Console", + "Constrain", + "Contains", + "Cos", + "Count", + "Crosses", + "Cut", + "Date", + "DateAdd", + "DateDiff", + "Day", + "Decode", + "DefaultValue", + "Dictionary", + "Difference", + "Disjoint", + "Distance", + "DistanceGeodetic", + "Distinct", + "DomainCode", + "DomainName", + "Equals", + "Exp", + "Extent", + "Feature", + "FeatureSet", + "FeatureSetByAssociation", + "FeatureSetById", + "FeatureSetByPortalItem", + "FeatureSetByRelationshipName", + "FeatureSetByTitle", + "FeatureSetByUrl", + "Filter", + "First", + "Floor", + "Geometry", + "GroupBy", + "Guid", + "HasKey", + "Hour", + "IIf", + "IndexOf", + "Intersection", + "Intersects", + "IsEmpty", + "IsNan", + "IsSelfIntersecting", + "Length", + "LengthGeodetic", + "Log", + "Max", + "Mean", + "Millisecond", + "Min", + "Minute", + "Month", + "MultiPartToSinglePart", + "Multipoint", + "NextSequenceValue", + "Now", + "Number", + "OrderBy", + "Overlaps", + "Point", + "Polygon", + "Polyline", + "Portal", + "Pow", + "Random", + "Relate", + "Reverse", + "RingIsClockWise", + "Round", + "Second", + "SetGeometry", + "Sin", + "Sort", + "Sqrt", + "Stdev", + "Sum", + "SymmetricDifference", + "Tan", + "Text", + "Timestamp", + "Today", + "ToLocal", + "Top", + "Touches", + "ToUTC", + "TrackCurrentTime", + "TrackGeometryWindow", + "TrackIndex", + "TrackStartTime", + "TrackWindow", + "TypeOf", + "Union", + "UrlEncode", + "Variance", + "Weekday", + "When", + "Within", + "Year" + ] }; const SYMBOL = { className: 'symbol', @@ -34,15 +168,9 @@ export default function(hljs) { const NUMBER = { className: 'number', variants: [ - { - begin: '\\b(0[bB][01]+)' - }, - { - begin: '\\b(0[oO][0-7]+)' - }, - { - begin: hljs.C_NUMBER_RE - } + { begin: '\\b(0[bB][01]+)' }, + { begin: '\\b(0[oO][0-7]+)' }, + { begin: hljs.C_NUMBER_RE } ], relevance: 0 }; @@ -88,16 +216,20 @@ export default function(hljs) { { // object attr container begin: /[{,]\s*/, relevance: 0, - contains: [{ - begin: IDENT_RE + '\\s*:', - returnBegin: true, - relevance: 0, - contains: [{ - className: 'attr', - begin: IDENT_RE, - relevance: 0 - }] - }] + contains: [ + { + begin: IDENT_RE + '\\s*:', + returnBegin: true, + relevance: 0, + contains: [ + { + className: 'attr', + begin: IDENT_RE, + relevance: 0 + } + ] + } + ] }, { // "value" container begin: '(' + hljs.RE_STARTERS_RE + '|\\b(return)\\b)\\s*', @@ -111,25 +243,23 @@ export default function(hljs) { begin: '(\\(.*?\\)|' + IDENT_RE + ')\\s*=>', returnBegin: true, end: '\\s*=>', - contains: [{ - className: 'params', - variants: [ - { - begin: IDENT_RE - }, - { - begin: /\(\s*\)/ - }, - { - begin: /\(/, - end: /\)/, - excludeBegin: true, - excludeEnd: true, - keywords: KEYWORDS, - contains: PARAMS_CONTAINS - } - ] - }] + contains: [ + { + className: 'params', + variants: [ + { begin: IDENT_RE }, + { begin: /\(\s*\)/ }, + { + begin: /\(/, + end: /\)/, + excludeBegin: true, + excludeEnd: true, + keywords: KEYWORDS, + contains: PARAMS_CONTAINS + } + ] + } + ] } ], relevance: 0 @@ -154,9 +284,7 @@ export default function(hljs) { ], illegal: /\[|%/ }, - { - begin: /\$[(.]/ - } + { begin: /\$[(.]/ } ], illegal: /#(?!!)/ }; From 9598caafafbeab8db23dc5ba8cea9793fb7a25e8 Mon Sep 17 00:00:00 2001 From: John Foster Date: Tue, 4 Jan 2022 18:56:10 -0500 Subject: [PATCH 123/227] enh(arcade) Add missing keywords for Arcade v1.16 Signed-off-by: Josh Goebel --- CHANGES.md | 2 + src/languages/arcade.js | 78 +++++++++++++++++++++++++-- test/markup/arcade/profile.expect.txt | 2 +- 3 files changed, 76 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 92f6d7b2f5..82d853a84e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ These changes should be for the better and should not be super noticeable but if Grammars: +- enh(arcade) updated to ArcGIS Arcade version 1.16 [John Foster][] - enh(php) Left and right-side of double colon [Wojciech Kania][] - enh(php) add PHP constants [Wojciech Kania][] - enh(php) add PHP 8.1 keywords [Wojciech Kania][] @@ -57,6 +58,7 @@ Themes: - Modified background color in css for Gradient Light and Gradient Dark themes [Samia Ali][] +[John Foster]: https://github.com/jf990 [Pegasis]: https://github.com/PegasisForever [Wojciech Kania]: https://github.com/wkania [Jeylani B]: https://github.com/jeyllani diff --git a/src/languages/arcade.js b/src/languages/arcade.js index 579d5b475a..6de745189d 100644 --- a/src/languages/arcade.js +++ b/src/languages/arcade.js @@ -42,14 +42,18 @@ export default function(hljs) { built_in: [ "Abs", "Acos", + "All", "Angle", - "Attachments", + "Any", "Area", "AreaGeodetic", + "Array", "Asin", "Atan", "Atan2", + "Attachments", "Average", + "Back", "Bearing", "Boolean", "Buffer", @@ -57,9 +61,11 @@ export default function(hljs) { "Ceil", "Centroid", "Clip", + "Concatenate", "Console", "Constrain", "Contains", + "ConvertDirection", "Cos", "Count", "Crosses", @@ -70,45 +76,71 @@ export default function(hljs) { "Day", "Decode", "DefaultValue", + "Densify", + "DensifyGeodetic", "Dictionary", "Difference", "Disjoint", "Distance", "DistanceGeodetic", "Distinct", + "Domain", "DomainCode", "DomainName", + "EnvelopeIntersects", "Equals", + "Erase", "Exp", + "Expects", "Extent", "Feature", "FeatureSet", "FeatureSetByAssociation", "FeatureSetById", + "FeatureSetByName", "FeatureSetByPortalItem", "FeatureSetByRelationshipName", - "FeatureSetByTitle", - "FeatureSetByUrl", "Filter", + "Find", "First", "Floor", + "FromCharCode", + "FromCodePoint", + "FromJSON", + "GdbVersion", + "Generalize", "Geometry", + "GetFeatureSet", + "GetUser", "GroupBy", "Guid", + "Hash", "HasKey", "Hour", "IIf", + "Includes", "IndexOf", + "Insert", "Intersection", "Intersects", "IsEmpty", "IsNan", + "ISOMonth", + "ISOWeek", + "ISOWeekday", + "ISOYear", "IsSelfIntersecting", + "IsSimple", + "Left|0", "Length", + "Length3D", "LengthGeodetic", "Log", + "Lower", + "Map", "Max", "Mean", + "Mid", "Millisecond", "Min", "Minute", @@ -116,45 +148,80 @@ export default function(hljs) { "MultiPartToSinglePart", "Multipoint", "NextSequenceValue", + "None", "Now", "Number", + "Offset|0", "OrderBy", "Overlaps", "Point", "Polygon", "Polyline", + "Pop", "Portal", "Pow", + "Proper", + "Push", "Random", + "Reduce", "Relate", + "Replace", + "Resize", "Reverse", - "RingIsClockWise", + "Right|0", + "RingIsClockwise", + "Rotate", "Round", + "Schema", "Second", "SetGeometry", + "Simplify", "Sin", + "Slice", "Sort", + "Splice", + "Split", "Sqrt", "Stdev", + "SubtypeCode", + "SubtypeName", + "Subtypes", "Sum", "SymmetricDifference", "Tan", "Text", "Timestamp", + "ToCharCode", + "ToCodePoint", "Today", + "ToHex", "ToLocal", - "Top", + "Top|0", "Touches", "ToUTC", + "TrackAccelerationAt", + "TrackAccelerationWindow", + "TrackCurrentAcceleration", + "TrackCurrentDistance", + "TrackCurrentSpeed", "TrackCurrentTime", + "TrackDistanceAt", + "TrackDistanceWindow", + "TrackDuration", + "TrackFieldWindow", "TrackGeometryWindow", "TrackIndex", + "TrackSpeedAt", + "TrackSpeedWindow", "TrackStartTime", "TrackWindow", + "Trim", "TypeOf", "Union", + "Upper", "UrlEncode", "Variance", + "Week", "Weekday", "When", "Within", @@ -204,6 +271,7 @@ export default function(hljs) { return { name: 'ArcGIS Arcade', + case_insensitive: true, keywords: KEYWORDS, contains: [ hljs.APOS_STRING_MODE, diff --git a/test/markup/arcade/profile.expect.txt b/test/markup/arcade/profile.expect.txt index d4a9dce5f2..f30c09e4b6 100644 --- a/test/markup/arcade/profile.expect.txt +++ b/test/markup/arcade/profile.expect.txt @@ -3,7 +3,7 @@ */
function offsetPopulation(offset){ var popDensity = Round( $feature.POPULATION / AreaGeodetic(Geometry($feature), "square-kilometers") ); - var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} }); + var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} }); var myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); return popDensity; } From 2d0e7c1094a3c867bd65c8d2655cfcaa5f9dfa79 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 6 Jan 2022 09:56:23 -0500 Subject: [PATCH 124/227] (chore) release 10.4.0 --- CHANGES.md | 2 +- README.md | 36 ++++++++++++++++++------------------ docs/conf.py | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 82d853a84e..7973fa6ff6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## Version 11.4 (most likely) +## Version 11.4.0 New Language: diff --git a/README.md b/README.md index e1fcf0656f..e4f00a20e3 100644 --- a/README.md +++ b/README.md @@ -328,20 +328,20 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ````html - + @@ -353,20 +353,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` @@ -376,20 +376,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` diff --git a/docs/conf.py b/docs/conf.py index 3fd4634487..95fb287478 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,14 +46,14 @@ # General information about the project. project = u'highlight.js' -copyright = u'2012–2021, Ivan Sagalaev' +copyright = u'2012–2022, Ivan Sagalaev' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # The full version, including alpha/beta/rc tags. -release = '11.3.1' +release = '11.4.0' # The short X.Y version. version = ".".join(release.split(".")[:2]) diff --git a/package-lock.json b/package-lock.json index 55b90dec9d..349ec60b07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "highlight.js", - "version": "11.3.1", + "version": "11.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "11.3.1", + "version": "11.4.0", "license": "BSD-3-Clause", "devDependencies": { "@rollup/plugin-commonjs": "^21.0.0", diff --git a/package.json b/package.json index 985b47fdd6..0687273b47 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "11.3.1", + "version": "11.4.0", "author": { "name": "Ivan Sagalaev", "email": "maniac@softwaremaniacs.org" From 8a8835b65a4fba173cff865201b37e5216b8ed52 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 7 Jan 2022 00:04:43 -0600 Subject: [PATCH 125/227] themes: add new felipec theme (#3441) * themes: add new felipec theme Autogenerated with vim-felipec. --- CHANGES.md | 2 + src/styles/felipec.css | 103 +++++++++++++++++++++++++++++++++++++++++ tools/developer.html | 1 + 3 files changed, 106 insertions(+) create mode 100644 src/styles/felipec.css diff --git a/CHANGES.md b/CHANGES.md index 7973fa6ff6..433557a86e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Themes: - `Default` is now much closer WCAG AA (contrast) (#3402) [Josh Goebel] - `Dark` now meets WCAG AA (contrast) (#3402) [Josh Goebel] - Added `intellij-light` theme [Pegasis] +- Added `felipec` theme [Felipe Contreras] These changes should be for the better and should not be super noticeable but if you're super picky about your colors you may want to intervene here or copy over the older themes from 11.3 or prior. @@ -71,6 +72,7 @@ Themes: [Matthieu Lempereur]: https://github.com/MrYamous [idleberg]: https://github.com/idleberg [Fons van der Plas]: https://github.com/fonsp +[Felipe Contreras]: https://github.com/felipec ## Version 11.3.1 diff --git a/src/styles/felipec.css b/src/styles/felipec.css new file mode 100644 index 0000000000..30bf811953 --- /dev/null +++ b/src/styles/felipec.css @@ -0,0 +1,103 @@ +/*! + * Theme: FelipeC + * Author: (c) 2021 Felipe Contreras + * Website: https://github.com/felipec/vim-felipec + * + * Autogenerated with vim-felipec's generator. +*/ + +.hljs { + color: #dddde1; + background: #1e1e22; +} + +.hljs::selection, +.hljs ::selection { + color: #1e1e22; + background: #bf8fef; +} + +.hljs-comment, +.hljs-code, +.hljs-quote { + color: #888896; +} + +.hljs-number, +.hljs-literal, +.hljs-deletion { + color: #ef8f8f; +} + +.hljs-punctuation, +.hljs-meta, +.hljs-operator, +.hljs-subst, +.hljs-doctag, +.hljs-template-variable, +.hljs-selector-attr { + color: #efbf8f; +} + +.hljs-type { + color: #efef8f; +} + +.hljs-tag, +.hljs-title, +.hljs-selector-class, +.hljs-selector-id { + color: #bfef8f; +} + +.hljs-string, +.hljs-regexp, +.hljs-addition { + color: #8fef8f; +} + +.hljs-class, +.hljs-property { + color: #8fefbf; +} + +.hljs-name, +.hljs-selector-tag { + color: #8fefef; +} + +.hljs-keyword, +.hljs-built_in { + color: #8fbfef; +} + +.hljs-section, +.hljs-bullet { + color: #8f8fef; +} + +.hljs-selector-pseudo { + color: #bf8fef; +} + +.hljs-variable, +.hljs-params, +.hljs-attr, +.hljs-attribute { + color: #ef8fef; +} + +.hljs-symbol, +.hljs-link { + color: #ef8fbf; +} + +.hljs-strong, +.hljs-literal, +.hljs-title { + font-weight: bold; +} + +.hljs-emphasis { + font-style: italic; +} diff --git a/tools/developer.html b/tools/developer.html index 5707b0600b..0e8cbb7b2f 100644 --- a/tools/developer.html +++ b/tools/developer.html @@ -116,6 +116,7 @@

Code

+ From 112135fb063af64b7a94155b5d86859e8d52b6f0 Mon Sep 17 00:00:00 2001 From: wkania Date: Wed, 12 Jan 2022 01:26:52 +0100 Subject: [PATCH 126/227] enh(php) named arguments and fix php constants (#3459) * enh(php) named arguments * fix(php) PHP constants --- CHANGES.md | 9 ++++ src/languages/php.js | 72 +++++++++++++++++++++------- test/markup/php/functions.expect.txt | 8 ++++ test/markup/php/functions.txt | 8 ++++ 4 files changed, 79 insertions(+), 18 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 433557a86e..f35fba5655 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +## Version 11.4.1 + +Grammars: + +- enh(php) named arguments [Wojciech Kania][] +- fix(php) PHP constants [Wojciech Kania][] + +[Wojciech Kania]: https://github.com/wkania + ## Version 11.4.0 New Language: diff --git a/src/languages/php.js b/src/languages/php.js index 7f0be203ae..936748d84d 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -328,21 +328,6 @@ export default function(hljs) { ] }; - const FUNCTION_INVOKE = { - relevance: 0, - match: [ - /\b/, - // to prevent keywords from being confused as the function title - regex.concat("(?!fn\\b|function\\b|", normalizeKeywords(KWS).join("\\b|"), "|", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), - IDENT_RE, - regex.concat(WHITESPACE, "*"), - regex.lookahead(/(?=\()/) - ], - scope: { - 3: "title.function.invoke", - } - }; - const CONSTANT_REFERENCE = regex.concat(IDENT_RE, "\\b(?!\\()"); const LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON = { @@ -368,6 +353,20 @@ export default function(hljs) { 2: "variable.language", }, }, + { + match: [ + PASCAL_CASE_CLASS_NAME_RE, + regex.concat( + /::/, + regex.lookahead(/(?!class\b)/) + ), + CONSTANT_REFERENCE, + ], + scope: { + 1: "title.class", + 3: "variable.constant", + }, + }, { match: [ PASCAL_CASE_CLASS_NAME_RE, @@ -394,6 +393,44 @@ export default function(hljs) { ] }; + const NAMED_ARGUMENT = { + scope: 'attr', + match: regex.concat(IDENT_RE, regex.lookahead(':'), regex.lookahead(/(?!::)/)), + }; + const PARAMS_MODE = { + relevance: 0, + begin: /\(/, + end: /\)/, + keywords: KEYWORDS, + contains: [ + NAMED_ARGUMENT, + VARIABLE, + LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON, + hljs.C_BLOCK_COMMENT_MODE, + STRING, + NUMBER, + CONSTRUCTOR_CALL, + ], + }; + const FUNCTION_INVOKE = { + relevance: 0, + match: [ + /\b/, + // to prevent keywords from being confused as the function title + regex.concat("(?!fn\\b|function\\b|", normalizeKeywords(KWS).join("\\b|"), "|", normalizeKeywords(BUILT_INS).join("\\b|"), "\\b)"), + IDENT_RE, + regex.concat(WHITESPACE, "*"), + regex.lookahead(/(?=\()/) + ], + scope: { + 3: "title.function.invoke", + }, + contains: [ + PARAMS_MODE + ] + }; + PARAMS_MODE.contains.push(FUNCTION_INVOKE); + return { case_insensitive: false, keywords: KEYWORDS, @@ -440,7 +477,6 @@ export default function(hljs) { /const/, /\s/, IDENT_RE, - /\s*=/, ], scope: { 1: "keyword", @@ -476,7 +512,7 @@ export default function(hljs) { STRING, NUMBER ] - } + }, ] }, { @@ -520,7 +556,7 @@ export default function(hljs) { ] }, STRING, - NUMBER + NUMBER, ] }; } diff --git a/test/markup/php/functions.expect.txt b/test/markup/php/functions.expect.txt index 88c5d94ebe..c50ac29e48 100644 --- a/test/markup/php/functions.expect.txt +++ b/test/markup/php/functions.expect.txt @@ -41,3 +41,11 @@ */
$fun = mb_strlen(); $fun(); + +/** + * Named arguments + */ +setAlarm( + label: 'foo', + time:time() + array(5)[0] + Foo::HOUR, +); diff --git a/test/markup/php/functions.txt b/test/markup/php/functions.txt index 86f7fd48a4..55538096c8 100644 --- a/test/markup/php/functions.txt +++ b/test/markup/php/functions.txt @@ -41,3 +41,11 @@ function testMe(string|int $name): int */ $fun = mb_strlen(); $fun(); + +/** + * Named arguments + */ +setAlarm( + label: 'foo', + time:time() + array(5)[0] + Foo::HOUR, +); From cabd43db58f72d0b00edefb9895dce1cee17cf52 Mon Sep 17 00:00:00 2001 From: Melissa Date: Wed, 19 Jan 2022 22:48:22 +0100 Subject: [PATCH 127/227] fix(angelscript) Fix highlighting of int8, int16, int32, int64 (#3464) * Swap order of int/uint and their explicit type variations to fix incomplete highlighting --- CHANGES.md | 2 ++ src/languages/angelscript.js | 2 +- test/detect/angelscript/default.txt | 2 +- test/markup/angelscript/default.expect.txt | 1 + test/markup/angelscript/default.txt | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f35fba5655..e2efb1495e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,8 +4,10 @@ Grammars: - enh(php) named arguments [Wojciech Kania][] - fix(php) PHP constants [Wojciech Kania][] +- fix(angelscript) incomplete int8, int16, int32, int64 highlighting [Melissa Geels][] [Wojciech Kania]: https://github.com/wkania +[Melissa Geels]: https://github.com/codecat ## Version 11.4.0 diff --git a/src/languages/angelscript.js b/src/languages/angelscript.js index d2f704c8a2..e09a4259cf 100644 --- a/src/languages/angelscript.js +++ b/src/languages/angelscript.js @@ -9,7 +9,7 @@ Website: https://www.angelcode.com/angelscript/ export default function(hljs) { const builtInTypeMode = { className: 'built_in', - begin: '\\b(void|bool|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|string|ref|array|double|float|auto|dictionary)' + begin: '\\b(void|bool|int8|int16|int32|int64|int|uint8|uint16|uint32|uint64|uint|string|ref|array|double|float|auto|dictionary)' }; const objectHandleMode = { diff --git a/test/detect/angelscript/default.txt b/test/detect/angelscript/default.txt index e22f5a6151..4adea5222c 100644 --- a/test/detect/angelscript/default.txt +++ b/test/detect/angelscript/default.txt @@ -15,7 +15,7 @@ namespace MyApplication array m_children; array> m_subChildren; // Nested templates - int m_thing; + uint64 m_thing; SomeClass() { diff --git a/test/markup/angelscript/default.expect.txt b/test/markup/angelscript/default.expect.txt index 51207945be..e6ec7dbfd8 100644 --- a/test/markup/angelscript/default.expect.txt +++ b/test/markup/angelscript/default.expect.txt @@ -16,6 +16,7 @@ array<array<SomeClass@>> m_subChildren; // Nested templates int m_thing; + uint64 m_thing2; SomeClass() { diff --git a/test/markup/angelscript/default.txt b/test/markup/angelscript/default.txt index e22f5a6151..02deadc3d1 100644 --- a/test/markup/angelscript/default.txt +++ b/test/markup/angelscript/default.txt @@ -16,6 +16,7 @@ namespace MyApplication array> m_subChildren; // Nested templates int m_thing; + uint64 m_thing2; SomeClass() { From d302ec44df4dd977b297809150b600a876fe246f Mon Sep 17 00:00:00 2001 From: anydonym <97789382+anydonym@users.noreply.github.com> Date: Sat, 22 Jan 2022 14:31:23 +0700 Subject: [PATCH 128/227] Minor change to TypeScript types and TypeScript-specific keywords (#3466) - Minor TypeScript primitive types addition and removal of "typedef" TypeScript-specific keyword. There is no such keyword as "typedef". - "enum" is not a type in TypeScript, but it is, indeed, a TypeScript-specific keyword. - Added "override" TS-specific keyword and "unknown" TypeScript type. --- CHANGES.md | 2 ++ src/languages/typescript.js | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e2efb1495e..50eaaf296f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,9 +5,11 @@ Grammars: - enh(php) named arguments [Wojciech Kania][] - fix(php) PHP constants [Wojciech Kania][] - fix(angelscript) incomplete int8, int16, int32, int64 highlighting [Melissa Geels][] +- enh(ts) modify TypeScript-specific keywords and types list [anydonym][] [Wojciech Kania]: https://github.com/wkania [Melissa Geels]: https://github.com/codecat +[anydonym]: https://github.com/anydonym ## Version 11.4.0 diff --git a/src/languages/typescript.js b/src/languages/typescript.js index c63adc995c..3dd84aed8b 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -23,7 +23,9 @@ export default function(hljs) { "string", "object", "never", - "enum" + "symbol", + "bigint", + "unknown" ]; const NAMESPACE = { beginKeywords: 'namespace', @@ -53,7 +55,6 @@ export default function(hljs) { const TS_SPECIFIC_KEYWORDS = [ "type", "namespace", - "typedef", "interface", "public", "private", @@ -61,7 +62,9 @@ export default function(hljs) { "implements", "declare", "abstract", - "readonly" + "readonly", + "enum", + "override" ]; const KEYWORDS = { $pattern: ECMAScript.IDENT_RE, From 45778948669ed372f56829e053e534fd2a7925d5 Mon Sep 17 00:00:00 2001 From: LyricLy Date: Sun, 9 Jan 2022 17:29:13 +1300 Subject: [PATCH 129/227] fix(brainfuck) fix highlighting of initial ++/-- --- CHANGES.md | 2 ++ src/languages/brainfuck.js | 2 +- test/markup/brainfuck/default.expect.txt | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 50eaaf296f..10c325aa64 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,10 +6,12 @@ Grammars: - fix(php) PHP constants [Wojciech Kania][] - fix(angelscript) incomplete int8, int16, int32, int64 highlighting [Melissa Geels][] - enh(ts) modify TypeScript-specific keywords and types list [anydonym][] +- fix(brainfuck) fix highlighting of initial ++/-- [Christina Hanson][] [Wojciech Kania]: https://github.com/wkania [Melissa Geels]: https://github.com/codecat [anydonym]: https://github.com/anydonym +[Christina Hanson]: https://github.com/LyricLy ## Version 11.4.0 diff --git a/src/languages/brainfuck.js b/src/languages/brainfuck.js index 3634b094b0..ca73e64fda 100644 --- a/src/languages/brainfuck.js +++ b/src/languages/brainfuck.js @@ -35,7 +35,7 @@ export default function(hljs) { }, { // this mode works as the only relevance counter - begin: /(?:\+\+|--)/, + begin: /(?=\+\+|--)/, contains: [LITERAL] }, LITERAL diff --git a/test/markup/brainfuck/default.expect.txt b/test/markup/brainfuck/default.expect.txt index 7ddd595714..2c17057703 100644 --- a/test/markup/brainfuck/default.expect.txt +++ b/test/markup/brainfuck/default.expect.txt @@ -1,17 +1,17 @@ -++++++++++ +++++++++++ [ 3*10 and 10*10 - ->+++>++++++++++<< + ->+++>++++++++++<< ]>> [ filling cells - ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[</]<[<]<[<]>> + ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[</]<[<]<[<]>> ]< -+++++++++<< ++++++++++<< [ rough codes correction loop - ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]< + ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]< ] more accurate сodes correction ->>>++> --->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++> -++>+++++++++++>++++++++++++>------>+++ +>>>++> +-->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++> +++>+++++++++++>++++++++++++>------>+++ rewind and output [<]>[.>] From 8d38e239ecbf14e68c8fc08c19fabfdc517d9475 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 29 Jan 2022 15:16:14 -0500 Subject: [PATCH 130/227] (chore) simplify brainfuck grammar --- src/languages/brainfuck.js | 16 +++++++++++---- test/markup/brainfuck/default.expect.txt | 26 ++++++++++++------------ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/languages/brainfuck.js b/src/languages/brainfuck.js index ca73e64fda..49f58c37fa 100644 --- a/src/languages/brainfuck.js +++ b/src/languages/brainfuck.js @@ -8,7 +8,7 @@ Website: https://esolangs.org/wiki/Brainfuck export default function(hljs) { const LITERAL = { className: 'literal', - begin: /[+-]/, + begin: /[+-]+/, relevance: 0 }; return { @@ -16,9 +16,15 @@ export default function(hljs) { aliases: ['bf'], contains: [ hljs.COMMENT( - '[^\\[\\]\\.,\\+\\-<> \r\n]', - '[\\[\\]\\.,\\+\\-<> \r\n]', + /[^\[\]\.,\+\-<> \r\n]/, + /[\[\]\.,\+\-<> \r\n]/, { + contains: [ + { + match: /[ ]+[^\[\]\.,\+\-<> \r\n]/, + relevance: 0 + } + ], returnEnd: true, relevance: 0 } @@ -35,8 +41,10 @@ export default function(hljs) { }, { // this mode works as the only relevance counter + // it looks ahead to find the start of a run of literals + // so only the runs are counted as relevant begin: /(?=\+\+|--)/, - contains: [LITERAL] + contains: [ LITERAL ] }, LITERAL ] diff --git a/test/markup/brainfuck/default.expect.txt b/test/markup/brainfuck/default.expect.txt index 2c17057703..0881840143 100644 --- a/test/markup/brainfuck/default.expect.txt +++ b/test/markup/brainfuck/default.expect.txt @@ -1,17 +1,17 @@ -++++++++++ -[ 3*10 and 10*10 - ->+++>++++++++++<< +++++++++++ +[ 3*10 and 10*10 + ->+++>++++++++++<< ]>> -[ filling cells - ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[</]<[<]<[<]>> +[ filling cells + ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[</]<[<]<[<]>> ]< -+++++++++<< -[ rough codes correction loop - ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]< ++++++++++<< +[ rough codes correction loop + ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]< ] -more accurate сodes correction ->>>++> --->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++> -++>+++++++++++>++++++++++++>------>+++ -rewind and output +more accurate сodes correction +>>>++> +-->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++> +++>+++++++++++>++++++++++++>------>+++ +rewind and output [<]>[.>] From 5e1e37c14b3adaaa0b49e4888b4a9af1199ec904 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Sun, 30 Jan 2022 18:16:35 +0100 Subject: [PATCH 131/227] enh(llvm) Improve number support, add `char.escape` (#3471) - Numbers are allowed to have a leading + sign - Hex floats can have a format specified after the 'x' - Strings cannot escape quotes with backslashes, so a '\"' ends a string - Add support for `\00` style `char.escape` inside strings --- CHANGES.md | 2 ++ src/languages/llvm.js | 15 +++++++++------ test/markup/llvm/default.expect.txt | 4 ++-- test/markup/llvm/numbers.expect.txt | 11 +++++++++++ test/markup/llvm/numbers.txt | 11 +++++++++++ test/markup/llvm/string.expect.txt | 8 ++++++++ test/markup/llvm/string.txt | 8 ++++++++ 7 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 test/markup/llvm/numbers.expect.txt create mode 100644 test/markup/llvm/numbers.txt create mode 100644 test/markup/llvm/string.expect.txt create mode 100644 test/markup/llvm/string.txt diff --git a/CHANGES.md b/CHANGES.md index 10c325aa64..b0efb3f85a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,11 +7,13 @@ Grammars: - fix(angelscript) incomplete int8, int16, int32, int64 highlighting [Melissa Geels][] - enh(ts) modify TypeScript-specific keywords and types list [anydonym][] - fix(brainfuck) fix highlighting of initial ++/-- [Christina Hanson][] +- fix(llvm) escaping in strings and number formats [Flakebi][] [Wojciech Kania]: https://github.com/wkania [Melissa Geels]: https://github.com/codecat [anydonym]: https://github.com/anydonym [Christina Hanson]: https://github.com/LyricLy +[Flakebi]: https://github.com/Flakebi ## Version 11.4.0 diff --git a/src/languages/llvm.js b/src/languages/llvm.js index 415b28f4e0..8358792eb0 100644 --- a/src/languages/llvm.js +++ b/src/languages/llvm.js @@ -28,8 +28,8 @@ export default function(hljs) { const NUMBER = { className: 'number', variants: [ - { begin: /0[xX][a-fA-F0-9]+/ }, - { begin: /-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/ } + { begin: /[su]?0[xX][KMLHR]?[a-fA-F0-9]+/ }, + { begin: /[-+]?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/ } ], relevance: 0 }; @@ -109,12 +109,15 @@ export default function(hljs) { // another language than an actual comment hljs.COMMENT(/;\s*$/, null, { relevance: 0 }), hljs.COMMENT(/;/, /$/), - hljs.QUOTE_STRING_MODE, { className: 'string', - variants: [ - // Double-quoted string - { begin: /"/, end: /[^\\]"/ }, + begin: /"/, + end: /"/, + contains: [ + { + className: 'char.escape', + match: /\\\d\d/ + } ] }, FUNCTION, diff --git a/test/markup/llvm/default.expect.txt b/test/markup/llvm/default.expect.txt index 8d09a4bc77..48662995cf 100644 --- a/test/markup/llvm/default.expect.txt +++ b/test/markup/llvm/default.expect.txt @@ -6,10 +6,10 @@ %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 } %struct.what = type { i8, i16 } -@.str = private unnamed_addr constant [6 x i8] c"foo()\00", align 1 +@.str = private unnamed_addr constant [6 x i8] c"foo()\00", align 1 @e_long = common global i64 0, align 8 @g_double = common global double 0.000000e+00, align 8 -@.str.1 = private unnamed_addr constant [7 x i8] c"oooooh\00", align 1 +@.str.1 = private unnamed_addr constant [7 x i8] c"oooooh\00", align 1 @func_ptr = common global i32 (...)* null, align 8 @stderr = external global %struct._IO_FILE*, align 8 diff --git a/test/markup/llvm/numbers.expect.txt b/test/markup/llvm/numbers.expect.txt new file mode 100644 index 0000000000..bd41bc80d0 --- /dev/null +++ b/test/markup/llvm/numbers.expect.txt @@ -0,0 +1,11 @@ +define i32 @signed_int() { + ret i32 s0x12a +} + +define float @signed_float() { + ret float +1.0 +} + +define float @float_format() { + ret float 0xK12a +} diff --git a/test/markup/llvm/numbers.txt b/test/markup/llvm/numbers.txt new file mode 100644 index 0000000000..a347c96731 --- /dev/null +++ b/test/markup/llvm/numbers.txt @@ -0,0 +1,11 @@ +define i32 @signed_int() { + ret i32 s0x12a +} + +define float @signed_float() { + ret float +1.0 +} + +define float @float_format() { + ret float 0xK12a +} diff --git a/test/markup/llvm/string.expect.txt b/test/markup/llvm/string.expect.txt new file mode 100644 index 0000000000..6492317555 --- /dev/null +++ b/test/markup/llvm/string.expect.txt @@ -0,0 +1,8 @@ +; Backslashes do not escape quotes, this is a legal string +define void @"C:\"() { + ret void +} + +define void @"escape_code_\0123\04end"() { + ret void +} diff --git a/test/markup/llvm/string.txt b/test/markup/llvm/string.txt new file mode 100644 index 0000000000..1af23f7066 --- /dev/null +++ b/test/markup/llvm/string.txt @@ -0,0 +1,8 @@ +; Backslashes do not escape quotes, this is a legal string +define void @"C:\"() { + ret void +} + +define void @"escape_code_\0123\04end"() { + ret void +} From 5b3a3e6728fde8d8aa68843528a351cb5c10a964 Mon Sep 17 00:00:00 2001 From: Henri <52706578+Vanderscycle@users.noreply.github.com> Date: Mon, 31 Jan 2022 20:43:55 -0800 Subject: [PATCH 132/227] (themes) Add `tokyo-night-dark` (#3467) --- CHANGES.md | 4 ++ src/styles/tokyo-night-dark.css | 118 ++++++++++++++++++++++++++++++++ tools/developer.html | 1 + 3 files changed, 123 insertions(+) create mode 100644 src/styles/tokyo-night-dark.css diff --git a/CHANGES.md b/CHANGES.md index b0efb3f85a..3686fe9b8e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ ## Version 11.4.1 +Themes: +- Added `Tokyo-Night-dark` theme [Henri Vandersleyen][] + Grammars: - enh(php) named arguments [Wojciech Kania][] @@ -12,6 +15,7 @@ Grammars: [Wojciech Kania]: https://github.com/wkania [Melissa Geels]: https://github.com/codecat [anydonym]: https://github.com/anydonym +[henri Vandersleyen]: https://github.com/Vanderscycle [Christina Hanson]: https://github.com/LyricLy [Flakebi]: https://github.com/Flakebi diff --git a/src/styles/tokyo-night-dark.css b/src/styles/tokyo-night-dark.css new file mode 100644 index 0000000000..6066560891 --- /dev/null +++ b/src/styles/tokyo-night-dark.css @@ -0,0 +1,118 @@ +/*! + Theme: Tokyionight-Dark + origin: https://github.com/enkia/tokyo-night-vscode-theme + Description: Original highlight.js style + Author: (c) Henri Vandersleyen + License: see project LICENSE + Touched: 2022 +*/ + +/* Comment */ +.hljs-meta, +.hljs-comment { + color: #565f89; +} + +/* Red */ +/*INFO: This keyword, HTML elements, Regex group symbol, CSS units, Terminal Red */ +.hljs-tag, +.hljs-doctag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-template-tag, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_, +.hljs-deletion { + color: #f7768e; +} + +/*Orange */ +/*INFO: Number and Boolean constants, Language support constants */ +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-link { + color: #ff9e64; +} + + +/* Yellow */ +/* INFO: Function parameters, Regex character sets, Terminal Yellow */ +.hljs-built_in, +.hljs-attribute { + color: #e0af68; +} +/* cyan */ +/* INFO: Language support functions, CSS HTML elements */ +.hljs-selector-tag { + color: #2ac3de; +} + +/* light blue */ +/* INFO: Object properties, Regex quantifiers and flags, Markdown headings, Terminal Cyan, Markdown code, Import/export keywords */ +.hljs-keyword, + .hljs-title.function_, +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-subst, +.hljs-property {color: #7dcfff;} + +/*Green*/ +/* INFO: Object literal keys, Markdown links, Terminal Green */ +.hljs-selector-tag { color: #73daca;} + + +/*Green(er) */ +/* INFO: Strings, CSS class names */ +.hljs-quote, +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #9ece6a; +} + +/* Blue */ +/* INFO: Function names, CSS property names, Terminal Blue */ +.hljs-code, +.hljs-formula, +.hljs-section { + color: #7aa2f7; +} + + + +/* Purple */ +/*INFO: Control Keywords, Storage Types, Regex symbols and operators, HTML Attributes, Terminal Magenta */ +.hljs-name, +.hljs-keyword, +.hljs-operator, +.hljs-keyword, +.hljs-char.escape_, +.hljs-attr { + color: #bb9af7; +} + +/* white*/ +/* INFO: Variables, Class names, Terminal White */ +.hljs-punctuation {color: #c0caf5} + +.hljs { + /* background: #002451; */ + background: #1a1b26; + color: #9aa5ce; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/tools/developer.html b/tools/developer.html index 0e8cbb7b2f..8143b8cdc2 100644 --- a/tools/developer.html +++ b/tools/developer.html @@ -71,6 +71,7 @@

Code

Language: Theme: + From f2c6652732e269b8b7f2ced70416ddd9eae39174 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 2 Mar 2022 17:07:07 -0500 Subject: [PATCH 155/227] enh(xml) better support processing directives (#3492) --- CHANGES.md | 1 + src/languages/php.js | 9 ++++----- src/languages/xml.js | 16 ++++++++++++++-- test/markup/xml/namespace.expect.txt | 2 +- test/markup/xml/processing.expect.txt | 6 ++++++ test/markup/xml/processing.txt | 6 ++++++ 6 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 test/markup/xml/processing.expect.txt create mode 100644 test/markup/xml/processing.txt diff --git a/CHANGES.md b/CHANGES.md index aed414f091..e46b22fe81 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ New Grammars: Grammars: +- enh(xml) support processing instructions (#3492) [Josh Goebel][] - enh(ruby ) better support multi-line IRB prompts - enh(bash) improved keyword `$pattern` (numbers allowed in command names) [Martin Mattel][] - add `meta.prompt` scope for REPL prompts, etc [Josh Goebel][] diff --git a/src/languages/php.js b/src/languages/php.js index 9dfa2fb3b3..f0e5f8ef68 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -29,11 +29,10 @@ export default function(hljs) { const PREPROCESSOR = { scope: 'meta', variants: [ - { - begin: /<\?php/, - relevance: 10 - }, // boost for obvious PHP - { begin: /<\?[=]?/ }, + { begin: /<\?php/, relevance: 10 }, // boost for obvious PHP + { begin: /<\?=/ }, + // less relevant per PSR-1 which says not to use short-tags + { begin: /<\?/, relevance: 0.1 }, { begin: /\?>/ } // end php tag ] }; diff --git a/src/languages/xml.js b/src/languages/xml.js index 971bc9cba7..cb640d8a1e 100644 --- a/src/languages/xml.js +++ b/src/languages/xml.js @@ -122,11 +122,23 @@ export default function(hljs) { relevance: 10 }, XML_ENTITIES, + // xml processing instructions { className: 'meta', - begin: /<\?xml/, end: /\?>/, - relevance: 10 + variants: [ + { + begin: /<\?xml/, + relevance: 10, + contains: [ + QUOTE_META_STRING_MODE + ] + }, + { + begin: /<\?[a-z][a-z0-9]+/, + } + ] + }, { className: 'tag', diff --git a/test/markup/xml/namespace.expect.txt b/test/markup/xml/namespace.expect.txt index 4317227c5f..05aaa944e8 100644 --- a/test/markup/xml/namespace.expect.txt +++ b/test/markup/xml/namespace.expect.txt @@ -1,3 +1,3 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"></xs:schema> <s:schema xmlns:s="http://www.w3.org/2001/XMLSchema"></s:schema> diff --git a/test/markup/xml/processing.expect.txt b/test/markup/xml/processing.expect.txt new file mode 100644 index 0000000000..19018d0d0b --- /dev/null +++ b/test/markup/xml/processing.expect.txt @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?PITarget PIContent?> +<?xml-stylesheet type="text/xsl" href="style.xsl"?> +<?xml-stylesheet type="text/css" href="style.css"?> +Some <?Pub _font FontColor="green"?>green<?Pub /_font?> text. +<?mso-application progid="Excel.Sheet"?> diff --git a/test/markup/xml/processing.txt b/test/markup/xml/processing.txt new file mode 100644 index 0000000000..e9565dd387 --- /dev/null +++ b/test/markup/xml/processing.txt @@ -0,0 +1,6 @@ + + + + +Some green text. + From 50d3a1e9b9b4ce6a72efb6952e7a5142f6468d3f Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 2 Mar 2022 20:05:05 -0500 Subject: [PATCH 156/227] enh(objc) add scopes `type` and `variable.language` (#3499) --- CHANGES.md | 1 + src/languages/objectivec.js | 37 +++++++++++-------- .../markup/objectivec/preprocessor.expect.txt | 6 +-- .../objectivec/string-literals.expect.txt | 12 +++--- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e46b22fe81..2ad4fc51f6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ New Grammars: Grammars: +- enh(objectivec) add `type` and `variable.language` scopes [Josh Goebel][] - enh(xml) support processing instructions (#3492) [Josh Goebel][] - enh(ruby ) better support multi-line IRB prompts - enh(bash) improved keyword `$pattern` (numbers allowed in command names) [Martin Mattel][] diff --git a/src/languages/objectivec.js b/src/languages/objectivec.js index 72167648fa..0f9f67beeb 100644 --- a/src/languages/objectivec.js +++ b/src/languages/objectivec.js @@ -12,11 +12,25 @@ export default function(hljs) { begin: '\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+' }; const IDENTIFIER_RE = /[a-zA-Z@][a-zA-Z0-9_]*/; - const KWS = [ + const TYPES = [ "int", "float", - "while", "char", + "unsigned", + "signed", + "short", + "long", + "double", + "wchar_t", + "unichar", + "void", + "bool", + "BOOL", + "id|0", + "_Bool" + ]; + const KWS = [ + "while", "export", "sizeof", "typedef", @@ -24,34 +38,25 @@ export default function(hljs) { "struct", "for", "union", - "unsigned", - "long", "volatile", "static", - "bool", "mutable", "if", "do", "return", "goto", - "void", "enum", "else", "break", "extern", "asm", "case", - "short", "default", - "double", "register", "explicit", - "signed", "typename", - "this", "switch", "continue", - "wchar_t", "inline", "readonly", "assign", @@ -61,8 +66,6 @@ export default function(hljs) { "id", "typeof", "nonatomic", - "super", - "unichar", "IBOutlet", "IBAction", "strong", @@ -153,7 +156,6 @@ export default function(hljs) { "NULL" ]; const BUILT_INS = [ - "BOOL", "dispatch_once_t", "dispatch_queue_t", "dispatch_sync", @@ -161,10 +163,15 @@ export default function(hljs) { "dispatch_once" ]; const KEYWORDS = { + "variable.language": [ + "this", + "super" + ], $pattern: IDENTIFIER_RE, keyword: KWS, literal: LITERALS, - built_in: BUILT_INS + built_in: BUILT_INS, + type: TYPES }; const CLASS_KEYWORDS = { $pattern: IDENTIFIER_RE, diff --git a/test/markup/objectivec/preprocessor.expect.txt b/test/markup/objectivec/preprocessor.expect.txt index b69e9b5aa0..09bf75aefa 100644 --- a/test/markup/objectivec/preprocessor.expect.txt +++ b/test/markup/objectivec/preprocessor.expect.txt @@ -2,9 +2,9 @@ #define foo 1<<16 #ifdef DEBUG -TYPE1 foo(void) +TYPE1 foo(void) #else -int foo(void) +int foo(void) #endif { } @@ -15,5 +15,5 @@ TYPE1 foo(void) #if MACRO_WITH_STRING_ARG("hello \"world\"") #elif MULTI_LINE /* comment */ < \ EXPRESSION -int bar; +int bar; #endif // comment diff --git a/test/markup/objectivec/string-literals.expect.txt b/test/markup/objectivec/string-literals.expect.txt index a59d6c08c1..4446ce05c5 100644 --- a/test/markup/objectivec/string-literals.expect.txt +++ b/test/markup/objectivec/string-literals.expect.txt @@ -1,7 +1,7 @@ -const char *str = "Regular \"quoted\" string\n"; +const char *str = "Regular \"quoted\" string\n"; NSString *nsstr = @"Obj-C \"quoted\" string\n"; -char c = 'c'; -char c2 = '"'; -char c3 = '\''; -char c4 = '\n'; -int multibyte_char = 'abcd'; +char c = 'c'; +char c2 = '"'; +char c3 = '\''; +char c4 = '\n'; +int multibyte_char = 'abcd'; From 8cea942683c0c2f19ca809d70c226121afd0cc24 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 2 Mar 2022 20:26:23 -0500 Subject: [PATCH 157/227] (enh) lots of small Ruby improvements (#3491) * (enh) lots of small Ruby improvements * do not scope () as params * better camel case regex --- CHANGES.md | 1 + src/highlight.js | 4 +- src/languages/ruby.js | 185 +++++++++++++++++++++------- test/markup/erb/default.expect.txt | 2 +- test/markup/haml/default.expect.txt | 2 +- test/markup/ruby/heredoc.expect.txt | 4 +- test/markup/ruby/prompt.expect.txt | 6 +- 7 files changed, 148 insertions(+), 56 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2ad4fc51f6..78adafe977 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ New Grammars: Grammars: +- enh(ruby) lots of small Ruby cleanups/improvements [Josh Goebel][] - enh(objectivec) add `type` and `variable.language` scopes [Josh Goebel][] - enh(xml) support processing instructions (#3492) [Josh Goebel][] - enh(ruby ) better support multi-line IRB prompts diff --git a/src/highlight.js b/src/highlight.js index ed0e187fd5..f81cc458e9 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -277,8 +277,8 @@ const HLJS = function(hljs) { */ function emitMultiClass(scope, match) { let i = 1; - // eslint-disable-next-line no-undefined - while (match[i] !== undefined) { + const max = match.length - 1; + while (i <= max) { if (!scope._emit[i]) { i++; continue; } const klass = language.classNameAliases[scope[i]] || scope[i]; const text = match[i]; diff --git a/src/languages/ruby.js b/src/languages/ruby.js index 59e77edec9..0504039a0a 100644 --- a/src/languages/ruby.js +++ b/src/languages/ruby.js @@ -10,15 +10,71 @@ Category: common export default function(hljs) { const regex = hljs.regex; const RUBY_METHOD_RE = '([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)'; + // TODO: move concepts like CAMEL_CASE into `modes.js` + const CLASS_NAME_RE = regex.either( + /\b([A-Z]+[a-z0-9]+)+/, + // ends in caps + /\b([A-Z]+[a-z0-9]+)+[A-Z]+/, + ) + ; + const CLASS_NAME_WITH_NAMESPACE_RE = regex.concat(CLASS_NAME_RE, /(::\w+)*/) const RUBY_KEYWORDS = { - keyword: - 'and then defined module in return redo if BEGIN retry end for self when ' - + 'next until do begin unless END rescue else break undef not super class case ' - + 'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor ' - + '__FILE__', - built_in: 'proc lambda', - literal: - 'true false nil' + "variable.constant": [ + "__FILE__", + "__LINE__" + ], + "variable.language": [ + "self", + "super", + ], + keyword: [ + "alias", + "and", + "attr_accessor", + "attr_reader", + "attr_writer", + "begin", + "BEGIN", + "break", + "case", + "class", + "defined", + "do", + "else", + "elsif", + "end", + "END", + "ensure", + "for", + "if", + "in", + "include", + "module", + "next", + "not", + "or", + "redo", + "require", + "rescue", + "retry", + "return", + "then", + "undef", + "unless", + "until", + "when", + "while", + "yield", + ], + built_in: [ + "proc", + "lambda" + ], + literal: [ + "true", + "false", + "nil" + ] }; const YARDOCTAG = { className: 'doctag', @@ -42,7 +98,7 @@ export default function(hljs) { relevance: 10 } ), - hljs.COMMENT('^__END__', '\\n$') + hljs.COMMENT('^__END__', hljs.MATCH_NOTHING_RE) ]; const SUBST = { className: 'subst', @@ -156,49 +212,82 @@ export default function(hljs) { }; const PARAMS = { - className: 'params', - begin: '\\(', - end: '\\)', - endsParent: true, + variants: [ + { + match: /\(\)/, + }, + { + className: 'params', + begin: /\(/, + end: /(?=\))/, + excludeBegin: true, + endsParent: true, + keywords: RUBY_KEYWORDS, + } + ] + }; + + const CLASS_DEFINITION = { + variants: [ + { + match: [ + /class\s+/, + CLASS_NAME_WITH_NAMESPACE_RE, + /\s+<\s+/, + CLASS_NAME_WITH_NAMESPACE_RE + ] + }, + { + match: [ + /class\s+/, + CLASS_NAME_WITH_NAMESPACE_RE + ] + } + ], + scope: { + 2: "title.class", + 4: "title.class.inherited" + }, keywords: RUBY_KEYWORDS }; + const UPPER_CASE_CONSTANT = { + relevance: 0, + match: /\b[A-Z][A-Z_0-9]+\b/, + className: "variable.constant" + }; + + const METHOD_DEFINITION = { + match: [ + /def/, /\s+/, + RUBY_METHOD_RE + ], + scope: { + 1: "keyword", + 3: "title.function" + }, + contains: [ + PARAMS + ] + }; + + const OBJECT_CREATION = { + relevance: 0, + match: [ + CLASS_NAME_WITH_NAMESPACE_RE, + /\.new[ (]/ + ], + scope: { + 1: "title.class" + } + }; + const RUBY_DEFAULT_CONTAINS = [ STRING, - { - className: 'class', - beginKeywords: 'class module', - end: '$|;', - illegal: /=/, - contains: [ - hljs.inherit(hljs.TITLE_MODE, { begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|!)?' }), - { - begin: '<\\s*', - contains: [ - { - begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE, - // we already get points for <, we don't need poitns - // for the name also - relevance: 0 - } - ] - } - ].concat(COMMENT_MODES) - }, - { - className: 'function', - // def method_name( - // def method_name; - // def method_name (end of line) - begin: regex.concat(/def\s+/, regex.lookahead(RUBY_METHOD_RE + "\\s*(\\(|;|$)")), - relevance: 0, // relevance comes from kewords - keywords: "def", - end: '$|;', - contains: [ - hljs.inherit(hljs.TITLE_MODE, { begin: RUBY_METHOD_RE }), - PARAMS - ].concat(COMMENT_MODES) - }, + CLASS_DEFINITION, + OBJECT_CREATION, + UPPER_CASE_CONSTANT, + METHOD_DEFINITION, { // swallow namespace qualifiers before symbols begin: hljs.IDENT_RE + '::' }, @@ -227,6 +316,8 @@ export default function(hljs) { className: 'params', begin: /\|/, end: /\|/, + excludeBegin: true, + excludeEnd: true, relevance: 0, // this could be a lot of things (in other languages) other than params keywords: RUBY_KEYWORDS }, diff --git a/test/markup/erb/default.expect.txt b/test/markup/erb/default.expect.txt index 47a8cf878d..2473ac1b61 100644 --- a/test/markup/erb/default.expect.txt +++ b/test/markup/erb/default.expect.txt @@ -1,6 +1,6 @@ <%# this is a comment %> -<% @posts.each do |post| %> +<% @posts.each do |post| %> <p><%= link_to post.title, post %></p> <% end %> diff --git a/test/markup/haml/default.expect.txt b/test/markup/haml/default.expect.txt index ccb3a210f4..7a422eb11f 100644 --- a/test/markup/haml/default.expect.txt +++ b/test/markup/haml/default.expect.txt @@ -5,7 +5,7 @@ /html comment -# ignore this line %ul(style='margin: 0') - -items.each do |i| + -items.each do |i| %i= i = variable =variable2 diff --git a/test/markup/ruby/heredoc.expect.txt b/test/markup/ruby/heredoc.expect.txt index 3f9379314e..cb3fd9f31b 100644 --- a/test/markup/ruby/heredoc.expect.txt +++ b/test/markup/ruby/heredoc.expect.txt @@ -13,7 +13,7 @@ message = <<-MESSAGE.chomp This looks good MESSAGE -def foo() +def foo() msg = <<-HTML <div> <h4>#{bar}</h4> @@ -21,7 +21,7 @@ MESSAGE HTML end -def baz() +def baz() msg = <<~FOO <div> <h4>#{bar}</h4> diff --git a/test/markup/ruby/prompt.expect.txt b/test/markup/ruby/prompt.expect.txt index 0d6baee8c5..bef182b866 100644 --- a/test/markup/ruby/prompt.expect.txt +++ b/test/markup/ruby/prompt.expect.txt @@ -7,7 +7,7 @@ jruby-1.7.16 :001 > "RVM-Format" ->> obj = OpenStruct.new :integer => 987, :symbol => :so_great +>> obj = OpenStruct.new :integer => 987, :symbol => :so_great => #<OpenStruct integer=987, symbol=:so_great> >> [obj,obj,obj] => [#<OpenStruct integer=987, symbol=:so_great>, #<OpenStruct integer=987, symbol=:so_great>, #<OpenStruct integer=987, symbol=:so_great>] @@ -22,8 +22,8 @@ irb(main):002:0> test = 1 -irb(main):001:1* class Secret -irb(main):002:2* def [](x) +irb(main):001:1* class Secret +irb(main):002:2* def [](x) irb(main):003:2* "TREASURE" if x==42 irb(main):004:1* end irb(main):005:0> end From 3da0e25dc5730799614470d78db28c3c62346910 Mon Sep 17 00:00:00 2001 From: MrYamous Date: Sat, 12 Mar 2022 00:45:19 +0100 Subject: [PATCH 158/227] enh(twig) add Symphony keywords to `twig` (#3453) --- CHANGES.md | 1 + src/languages/twig.js | 46 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 78adafe977..2b4f8e92a1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -61,6 +61,7 @@ These changes should be for the better and should not be super noticeable but if Grammars: +- enh(twig) update keywords list for symfony (#3453) [Matthieu Lempereur][] - enh(arcade) updated to ArcGIS Arcade version 1.16 [John Foster][] - enh(php) Left and right-side of double colon [Wojciech Kania][] - enh(php) add PHP constants [Wojciech Kania][] diff --git a/src/languages/twig.js b/src/languages/twig.js index f8345a4374..a4757d6037 100644 --- a/src/languages/twig.js +++ b/src/languages/twig.js @@ -10,26 +10,51 @@ Category: template export default function(hljs) { const regex = hljs.regex; const FUNCTION_NAMES = [ + "absolute_url", + "asset|0", + "asset_version", "attribute", "block", "constant", + "controller|0", "country_timezones", + "csrf_token", "cycle", "date", "dump", + "expression", + "form|0", + "form_end", + "form_errors", + "form_help", + "form_label", + "form_rest", + "form_row", + "form_start", + "form_widget", "html_classes", "include", + "is_granted", + "logout_path", + "logout_url", "max", "min", "parent", + "path|0", "random", "range", + "relative_path", + "render", + "render_esi", "source", - "template_from_string" + "template_from_string", + "url|0" ]; const FILTERS = [ "abs", + "abbr_class", + "abbr_method", "batch", "capitalize", "column", @@ -42,15 +67,23 @@ export default function(hljs) { "date_modify", "default", "escape", + "file_excerpt", + "file_link", + "file_relative", "filter", "first", "format", + "format_args", + "format_args_as_text", "format_currency", "format_date", "format_datetime", + "format_file", + "format_file_from_text", "format_number", "format_time", "html_to_markdown", + "humanize", "inky_to_html", "inline_css", "join", @@ -80,10 +113,14 @@ export default function(hljs) { "striptags", "timezone_name", "title", + "trans", + "transchoice", "trim", "u|0", "upper", - "url_encode" + "url_encode", + "yaml_dump", + "yaml_encode" ]; let TAG_NAMES = [ @@ -98,6 +135,7 @@ export default function(hljs) { "filter", "flush", "for", + "form_theme", "from", "if", "import", @@ -105,6 +143,10 @@ export default function(hljs) { "macro", "sandbox", "set", + "stopwatch", + "trans", + "trans_default_domain", + "transchoice", "use", "verbatim", "with" From 7a62552656b485b78586a23b0da6a3843ebfd711 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 11 Mar 2022 19:04:53 -0500 Subject: [PATCH 159/227] release 10.5.0 Signed-off-by: Josh Goebel --- CHANGES.md | 2 +- README.md | 36 ++++++++++++++++++------------------ docs/conf.py | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2b4f8e92a1..9925c1e800 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## Version 11.5.0 (in progress) +## Version 11.5.0 Themes: - Added `Tokyo-Night-dark` theme [Henri Vandersleyen][] diff --git a/README.md b/README.md index e4f00a20e3..39e7743d6b 100644 --- a/README.md +++ b/README.md @@ -328,20 +328,20 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ````html - + @@ -353,20 +353,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` @@ -376,20 +376,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` diff --git a/docs/conf.py b/docs/conf.py index 95fb287478..a191d91276 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,7 @@ # built documents. # The full version, including alpha/beta/rc tags. -release = '11.4.0' +release = '11.5.0' # The short X.Y version. version = ".".join(release.split(".")[:2]) diff --git a/package-lock.json b/package-lock.json index ee2768fd22..0e6d4bf6ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "highlight.js", - "version": "11.4.0", + "version": "11.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "highlight.js", - "version": "11.4.0", + "version": "11.5.0", "license": "BSD-3-Clause", "devDependencies": { "@colors/colors": "^1.5.0", diff --git a/package.json b/package.json index 6d67ebad13..6ce765377b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "11.4.0", + "version": "11.5.0", "author": { "name": "Ivan Sagalaev", "email": "maniac@softwaremaniacs.org" From 86a20e9bdf56778868519d58e9d3de40f5702fd0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 11 Mar 2022 19:41:03 -0500 Subject: [PATCH 160/227] (chore) remove "pre", this is our release script --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fe91ac9e5..a321f94d3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ on: jobs: prerelease: - name: Pre-release + name: Release runs-on: ubuntu-latest steps: - name: Checkout highlight.js From 4db262dbdceed2a01ec6414b98b6c8a9b76ad28f Mon Sep 17 00:00:00 2001 From: dirkjf Date: Tue, 29 Mar 2022 14:38:29 +0200 Subject: [PATCH 161/227] (chore) explicitly set sideEffect for css and scss files, fixes #3504 (#3511) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ce765377b..3aa4b15ab2 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "type": "commonjs", "main": "./lib/index.js", "types": "./types/index.d.ts", - "sideEffects": false, + "sideEffects": ["*.css", "*.scss"], "scripts": { "mocha": "mocha", "lint": "eslint src/*.js src/lib/*.js demo/*.js tools/**/*.js --ignore-pattern vendor", From 0c98957206664d2aacd72bbfab4479c216f6da7e Mon Sep 17 00:00:00 2001 From: Annmarie Switzer Date: Tue, 29 Mar 2022 08:58:24 -0400 Subject: [PATCH 162/227] (themes) adds Panda Syntax Theme (#3506) --- CHANGES.md | 3 + src/styles/panda-syntax-dark.css | 98 +++++++++++++++++++++++++++++++ src/styles/panda-syntax-light.css | 94 +++++++++++++++++++++++++++++ tools/developer.html | 2 + 4 files changed, 197 insertions(+) create mode 100644 src/styles/panda-syntax-dark.css create mode 100644 src/styles/panda-syntax-light.css diff --git a/CHANGES.md b/CHANGES.md index 9925c1e800..ffa143a71e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,8 @@ Themes: - Added `Tokyo-Night-dark` theme [Henri Vandersleyen][] - Added `Tokyo-Night-light` theme [Henri Vandersleyen][] +- Added `panda-syntax-dark` theme [Annmarie Switzer][] +- Added `panda-syntax-light` theme [Annmarie Switzer][] New Grammars: @@ -41,6 +43,7 @@ Grammars: [Mark Ericksen]: https://github.com/brainlid [Nicolaos Skimas]: https://github.com/dev-nicolaos [Doug Torrance]: https://github.com/d-torrance +[Annmarie Switzer]: https://github.com/annmarie-switzer ## Version 11.4.0 diff --git a/src/styles/panda-syntax-dark.css b/src/styles/panda-syntax-dark.css new file mode 100644 index 0000000000..5ae417d47e --- /dev/null +++ b/src/styles/panda-syntax-dark.css @@ -0,0 +1,98 @@ +/** + * Panda Syntax Theme for Highlight.js + * Based on: https://github.com/tinkertrain/panda-syntax-vscode + * Author: Annmarie Switzer + */ + +.hljs { + color: #e6e6e6; + background: #2a2c2d; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-link { + text-decoration: underline; +} + +.hljs-comment, +.hljs-quote { + color: #bbbbbb; + font-style: italic; +} + +.hljs-params { + color: #bbbbbb; +} + +.hljs-punctuation, +.hljs-attr { + color: #e6e6e6; +} + +.hljs-selector-tag, +.hljs-name, +.hljs-meta { + color: #ff4b82; +} + +.hljs-operator, +.hljs-char.escape_ { + color: #b084eb; +} + +.hljs-keyword, +.hljs-deletion { + color: #ff75b5; +} + +.hljs-regexp, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_ { + color: #ff9ac1; +} + +.hljs-subst, +.hljs-property, +.hljs-code, +.hljs-formula, +.hljs-section, +.hljs-title.function_ { + color: #45a9f9; +} + +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-selector-class, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-meta .hljs-string { + color: #19f9d8; +} + +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-link, +.hljs-built_in, +.hljs-title, +.hljs-selector-id, +.hljs-tag, +.hljs-doctag, +.hljs-attribute, +.hljs-template-tag, +.hljs-meta .hljs-keyword, +.hljs-punctuation { + color: #ffb86c; +} diff --git a/src/styles/panda-syntax-light.css b/src/styles/panda-syntax-light.css new file mode 100644 index 0000000000..c58d063ff3 --- /dev/null +++ b/src/styles/panda-syntax-light.css @@ -0,0 +1,94 @@ +/** + * Panda Syntax Theme for Highlight.js + * Based on: https://github.com/tinkertrain/panda-syntax-vscode + * Author: Annmarie Switzer + */ + +.hljs { + color: #2a2c2d; + background: #e6e6e6; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-link { + text-decoration: underline; +} + +.hljs-comment, +.hljs-quote { + color: #676B79; + font-style: italic; +} + +.hljs-params { + color: #676B79; +} + +.hljs-punctuation, +.hljs-attr { + color: #2a2c2d; +} + +.hljs-selector-tag, +.hljs-name, +.hljs-meta, +.hljs-operator, +.hljs-char.escape_ { + color: #c56200; +} + +.hljs-keyword, +.hljs-deletion { + color: #d92792; +} + +.hljs-regexp, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_ { + color: #cc5e91; +} + +.hljs-subst, +.hljs-property, +.hljs-code, +.hljs-formula, +.hljs-section, +.hljs-title.function_ { + color: #3787c7; +} + +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-selector-class, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-meta .hljs-string { + color: #0d7d6c; +} + +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-link, +.hljs-built_in, +.hljs-title, +.hljs-selector-id, +.hljs-tag, +.hljs-doctag, +.hljs-attribute, +.hljs-template-tag, +.hljs-meta .hljs-keyword { + color: #7641bb; +} diff --git a/tools/developer.html b/tools/developer.html index e780bb4653..df4b4f7a2a 100644 --- a/tools/developer.html +++ b/tools/developer.html @@ -321,6 +321,8 @@

Code

+ +

From aaeb543f0acb198db81ab73916c9229e44f12e58 Mon Sep 17 00:00:00 2001 From: Ivan Sagalaev Date: Tue, 29 Mar 2022 14:23:53 -0700 Subject: [PATCH 163/227] (chore) assign `author` to Josh Goebel (#3513) I'm getting contacted occasionally by people who look up the package's author from npm's registry. Package.json doesn't have a dedicated 'maintainer' field, so 'author' should work, I think. --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 3aa4b15ab2..7fff2315ce 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,7 @@ ], "homepage": "https://highlightjs.org/", "version": "11.5.0", - "author": { - "name": "Ivan Sagalaev", - "email": "maniac@softwaremaniacs.org" - }, + "author": "Josh Goebel ", "contributors": [ "Josh Goebel ", "Egor Rogov ", From c4bbd13381069e984b155ced5c5e00b9e5bd6c17 Mon Sep 17 00:00:00 2001 From: Bradley Mackey Date: Sun, 3 Apr 2022 22:23:06 +0400 Subject: [PATCH 164/227] enh(swift): add SE-0335 existential `any` keyword (#3515) * Swift: add existential any keyword --- CHANGES.md | 8 ++++++++ src/languages/lib/kws_swift.js | 1 + test/markup/swift/types.expect.txt | 1 + test/markup/swift/types.txt | 1 + 4 files changed, 11 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index ffa143a71e..dde0d94bce 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,11 @@ +## Version 11.6.0 (maybe) + +Grammars: + +- enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][] + +[Bradley Mackey]: https://github.com/bradleymackey + ## Version 11.5.0 Themes: diff --git a/src/languages/lib/kws_swift.js b/src/languages/lib/kws_swift.js index be06394ba8..ff53f648a0 100644 --- a/src/languages/lib/kws_swift.js +++ b/src/languages/lib/kws_swift.js @@ -33,6 +33,7 @@ export const keywords = [ // will result in additional modes being created to scan for those keywords to // avoid conflicts with other rules 'actor', + 'any', // contextual 'associatedtype', 'async', 'await', diff --git a/test/markup/swift/types.expect.txt b/test/markup/swift/types.expect.txt index 4bd3695140..9e604fbdb1 100644 --- a/test/markup/swift/types.expect.txt +++ b/test/markup/swift/types.expect.txt @@ -33,6 +33,7 @@ // Functions (@escaping (String) -> Void, @autoclosure () -> String) -> String (Int, String...) -> some Collection +(Int, String...) -> any SomeProtocol () throws -> Self // Generic arguments diff --git a/test/markup/swift/types.txt b/test/markup/swift/types.txt index 89a27ea6a9..fb1c5aca0c 100644 --- a/test/markup/swift/types.txt +++ b/test/markup/swift/types.txt @@ -33,6 +33,7 @@ Swift.Array.Element // Functions (@escaping (String) -> Void, @autoclosure () -> String) -> String (Int, String...) -> some Collection +(Int, String...) -> any SomeProtocol () throws -> Self // Generic arguments From 1db18921bbaa0f053b77a15cb417a479e81f003d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 13 Mar 2022 04:45:16 -0400 Subject: [PATCH 165/227] (chore) Node.kind => Node.scope --- src/lib/html_renderer.js | 16 +++++++++------- src/lib/token_tree.js | 29 +++++++++++++++++------------ 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/lib/html_renderer.js b/src/lib/html_renderer.js index 9456276e65..e8bdacc34b 100644 --- a/src/lib/html_renderer.js +++ b/src/lib/html_renderer.js @@ -8,7 +8,7 @@ import { escapeHTML } from './utils.js'; * @property {() => string} value */ -/** @typedef {{kind?: string, sublanguage?: boolean}} Node */ +/** @typedef {{scope?: string, language?: string, sublanguage?: boolean}} Node */ /** @typedef {{walk: (r: Renderer) => void}} Tree */ /** */ @@ -19,7 +19,9 @@ const SPAN_CLOSE = '
'; * * @param {Node} node */ const emitsWrappingTags = (node) => { - return !!node.kind; + // rarely we can have a sublanguage where language is undefined + // TODO: track down why + return !!node.scope || (node.sublanguage && node.language) ; }; /** @@ -27,7 +29,7 @@ const emitsWrappingTags = (node) => { * @param {string} name * @param {{prefix:string}} options */ -const expandScopeName = (name, { prefix }) => { +const scopeToCSSClass = (name, { prefix }) => { if (name.includes(".")) { const pieces = name.split("."); return [ @@ -67,13 +69,13 @@ export default class HTMLRenderer { openNode(node) { if (!emitsWrappingTags(node)) return; - let scope = node.kind; + let className = ""; if (node.sublanguage) { - scope = `language-${scope}`; + className = `language-${node.language}`; } else { - scope = expandScopeName(scope, { prefix: this.classPrefix }); + className = scopeToCSSClass(node.scope, { prefix: this.classPrefix }); } - this.span(scope); + this.span(className); } /** diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js index cd388c60af..3c4aae4c9d 100644 --- a/src/lib/token_tree.js +++ b/src/lib/token_tree.js @@ -1,14 +1,19 @@ import HTMLRenderer from './html_renderer.js'; -/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} | string} Node */ -/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} } DataNode */ +/** @typedef {{scope?: string, language?: string, sublanguage?: boolean, children: Node[]} | string} Node */ +/** @typedef {{scope?: string, language?: string, sublanguage?: boolean, children: Node[]} } DataNode */ /** @typedef {import('highlight.js').Emitter} Emitter */ /** */ +/** @returns {DataNode} */ +const newNode = (opts = {}) => { + return { children: [], ...opts }; +} + class TokenTree { constructor() { /** @type DataNode */ - this.rootNode = { children: [] }; + this.rootNode = newNode(); this.stack = [this.rootNode]; } @@ -23,10 +28,10 @@ class TokenTree { this.top.children.push(node); } - /** @param {string} kind */ - openNode(kind) { + /** @param {string} scope */ + openNode(scope) { /** @type Node */ - const node = { kind, children: [] }; + const node = newNode({scope}); this.add(node); this.stack.push(node); } @@ -98,11 +103,11 @@ class TokenTree { Minimal interface: - - addKeyword(text, kind) + - addKeyword(text, scope) - addText(text) - addSublanguage(emitter, subLanguageName) - finalize() - - openNode(kind) + - openNode(scope) - closeNode() - closeAllNodes() - toHTML() @@ -123,12 +128,12 @@ export default class TokenTreeEmitter extends TokenTree { /** * @param {string} text - * @param {string} kind + * @param {string} scope */ - addKeyword(text, kind) { + addKeyword(text, scope) { if (text === "") { return; } - this.openNode(kind); + this.openNode(scope); this.addText(text); this.closeNode(); } @@ -149,8 +154,8 @@ export default class TokenTreeEmitter extends TokenTree { addSublanguage(emitter, name) { /** @type DataNode */ const node = emitter.root; - node.kind = name; node.sublanguage = true; + node.language = name; this.add(node); } From 4376731e058c5f588cb2ccdc2cd2089e49e6ca32 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 4 Apr 2022 18:27:54 -0400 Subject: [PATCH 166/227] (chore) back to ES2015 for now --- src/lib/token_tree.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js index 3c4aae4c9d..9921d595ae 100644 --- a/src/lib/token_tree.js +++ b/src/lib/token_tree.js @@ -7,8 +7,11 @@ import HTMLRenderer from './html_renderer.js'; /** @returns {DataNode} */ const newNode = (opts = {}) => { - return { children: [], ...opts }; -} + /** @type DataNode */ + var result = { children: [] }; + Object.assign(result, opts); + return result; +}; class TokenTree { constructor() { @@ -31,7 +34,7 @@ class TokenTree { /** @param {string} scope */ openNode(scope) { /** @type Node */ - const node = newNode({scope}); + const node = newNode({ scope }); this.add(node); this.stack.push(node); } From 184d76dbb486624c4749d21bac11efd637e5e4d9 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 15 Apr 2022 21:52:44 -0400 Subject: [PATCH 167/227] (chore) fix linter errors --- src/lib/html_renderer.js | 2 +- src/lib/token_tree.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/html_renderer.js b/src/lib/html_renderer.js index e8bdacc34b..51ba5a140c 100644 --- a/src/lib/html_renderer.js +++ b/src/lib/html_renderer.js @@ -21,7 +21,7 @@ const SPAN_CLOSE = '
'; const emitsWrappingTags = (node) => { // rarely we can have a sublanguage where language is undefined // TODO: track down why - return !!node.scope || (node.sublanguage && node.language) ; + return !!node.scope || (node.sublanguage && node.language); }; /** diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js index 9921d595ae..f6b7ba70e1 100644 --- a/src/lib/token_tree.js +++ b/src/lib/token_tree.js @@ -8,7 +8,7 @@ import HTMLRenderer from './html_renderer.js'; /** @returns {DataNode} */ const newNode = (opts = {}) => { /** @type DataNode */ - var result = { children: [] }; + const result = { children: [] }; Object.assign(result, opts); return result; }; From 962a69a209306e2a922b3f95339624babcad025c Mon Sep 17 00:00:00 2001 From: Marcus Ortiz Date: Mon, 18 Apr 2022 19:28:32 -0700 Subject: [PATCH 168/227] Support `distributed` keyword for Swift (#3523) --- CHANGES.md | 2 ++ src/languages/lib/kws_swift.js | 1 + test/markup/swift/distributed-actor-runtime.expect.txt | 7 +++++++ test/markup/swift/distributed-actor-runtime.txt | 7 +++++++ 4 files changed, 17 insertions(+) create mode 100644 test/markup/swift/distributed-actor-runtime.expect.txt create mode 100644 test/markup/swift/distributed-actor-runtime.txt diff --git a/CHANGES.md b/CHANGES.md index dde0d94bce..c81e25ff80 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,8 +3,10 @@ Grammars: - enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][] +- enh(swift) add support for `distributed` keyword [Marcus Ortiz][] [Bradley Mackey]: https://github.com/bradleymackey +[Marcus Ortiz]: https://github.com/mportiz08 ## Version 11.5.0 diff --git a/src/languages/lib/kws_swift.js b/src/languages/lib/kws_swift.js index ff53f648a0..2671729bba 100644 --- a/src/languages/lib/kws_swift.js +++ b/src/languages/lib/kws_swift.js @@ -50,6 +50,7 @@ export const keywords = [ 'defer', 'deinit', 'didSet', // contextual + 'distributed', 'do', 'dynamic', // contextual 'else', diff --git a/test/markup/swift/distributed-actor-runtime.expect.txt b/test/markup/swift/distributed-actor-runtime.expect.txt new file mode 100644 index 0000000000..73d33a77ba --- /dev/null +++ b/test/markup/swift/distributed-actor-runtime.expect.txt @@ -0,0 +1,7 @@ +distributed actor Foobar { + distributed func baz() { + } + + func qux() { + } +} diff --git a/test/markup/swift/distributed-actor-runtime.txt b/test/markup/swift/distributed-actor-runtime.txt new file mode 100644 index 0000000000..47f2cdac67 --- /dev/null +++ b/test/markup/swift/distributed-actor-runtime.txt @@ -0,0 +1,7 @@ +distributed actor Foobar { + distributed func baz() { + } + + func qux() { + } +} From 7addd66c19036eccd7c602af61f1ed84d215c77d Mon Sep 17 00:00:00 2001 From: martin-honnen Date: Tue, 26 Apr 2022 17:05:15 +0200 Subject: [PATCH 169/227] enh(xml) Unicode letter support for XML element names/tags and attribute names (#3529) * Use Unicode letter class in TAG_NAME_RE and XML_IDENT_RE * Tests for using Unicode in XML element names and attribute names. * Add flag for Unicode regular expression as otherwise use of Unicode character class to have Unicode support in names doesn't work. --- CHANGES.md | 2 ++ src/languages/xml.js | 13 ++++++++++--- .../markup/xml/non-ascii-attribute-names.expect.txt | 3 +++ test/markup/xml/non-ascii-attribute-names.txt | 3 +++ test/markup/xml/non-ascii-element-names.expect.txt | 12 ++++++++++++ test/markup/xml/non-ascii-element-names.txt | 12 ++++++++++++ 6 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 test/markup/xml/non-ascii-attribute-names.expect.txt create mode 100644 test/markup/xml/non-ascii-attribute-names.txt create mode 100644 test/markup/xml/non-ascii-element-names.expect.txt create mode 100644 test/markup/xml/non-ascii-element-names.txt diff --git a/CHANGES.md b/CHANGES.md index c81e25ff80..54a5048815 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,9 +4,11 @@ Grammars: - enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][] - enh(swift) add support for `distributed` keyword [Marcus Ortiz][] +- enh(xml) recognize Unicode letters instead of only ASCII letters in XML element and attribute names (#3256)[Martin Honnen][] [Bradley Mackey]: https://github.com/bradleymackey [Marcus Ortiz]: https://github.com/mportiz08 +[Martin Honnen]: https://github.com/martin-honnen ## Version 11.5.0 diff --git a/src/languages/xml.js b/src/languages/xml.js index cb640d8a1e..31f11e6866 100644 --- a/src/languages/xml.js +++ b/src/languages/xml.js @@ -8,9 +8,15 @@ Audit: 2020 /** @type LanguageFn */ export default function(hljs) { const regex = hljs.regex; - // Element names can contain letters, digits, hyphens, underscores, and periods - const TAG_NAME_RE = regex.concat(/[A-Z_]/, regex.optional(/[A-Z0-9_.-]*:/), /[A-Z0-9_.-]*/); - const XML_IDENT_RE = /[A-Za-z0-9._:-]+/; + // XML names can have the following additional letters: https://www.w3.org/TR/xml/#NT-NameChar + // OTHER_NAME_CHARS = /[:\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]/; + // Element names start with NAME_START_CHAR followed by optional other Unicode letters, ASCII digits, hyphens, underscores, and periods + // const TAG_NAME_RE = regex.concat(/[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, regex.optional(/[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*:/), /[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*/);; + // const XML_IDENT_RE = /[A-Z_a-z:\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]+/; + // const TAG_NAME_RE = regex.concat(/[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, regex.optional(/[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*:/), /[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*/); + // however, to cater for performance and more Unicode support rely simply on the Unicode letter class + const TAG_NAME_RE = regex.concat(/[\p{L}_]/u, regex.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u); + const XML_IDENT_RE = /[\p{L}0-9._:-]+/u; const XML_ENTITIES = { className: 'symbol', begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/ @@ -81,6 +87,7 @@ export default function(hljs) { 'svg' ], case_insensitive: true, + unicodeRegex: true, contains: [ { className: 'meta', diff --git a/test/markup/xml/non-ascii-attribute-names.expect.txt b/test/markup/xml/non-ascii-attribute-names.expect.txt new file mode 100644 index 0000000000..e9f3c1ac8d --- /dev/null +++ b/test/markup/xml/non-ascii-attribute-names.expect.txt @@ -0,0 +1,3 @@ +<productos> + <producto categoría="mueble" descripción="Asiento cómodo para dos o más personas, que tiene respaldo y brazos.">sofá</producto> +</productos> diff --git a/test/markup/xml/non-ascii-attribute-names.txt b/test/markup/xml/non-ascii-attribute-names.txt new file mode 100644 index 0000000000..62c745b330 --- /dev/null +++ b/test/markup/xml/non-ascii-attribute-names.txt @@ -0,0 +1,3 @@ + + sofá + diff --git a/test/markup/xml/non-ascii-element-names.expect.txt b/test/markup/xml/non-ascii-element-names.expect.txt new file mode 100644 index 0000000000..5def3c6fc1 --- /dev/null +++ b/test/markup/xml/non-ascii-element-names.expect.txt @@ -0,0 +1,12 @@ +<productos> + <producto> + <name>sofá</name> + <categoría>mueble</categoría> + <descripción>Asiento cómodo para dos o más personas, que tiene respaldo y brazos.</descripción> + </producto> + <producto> + <name>sillón</name> + <categoría>mueble</categoría> + <descripción>Silla de brazos, mayor y más cómoda que la ordinaria.</descripción> + </producto> +</productos> diff --git a/test/markup/xml/non-ascii-element-names.txt b/test/markup/xml/non-ascii-element-names.txt new file mode 100644 index 0000000000..f312419647 --- /dev/null +++ b/test/markup/xml/non-ascii-element-names.txt @@ -0,0 +1,12 @@ + + + sofá + mueble + Asiento cómodo para dos o más personas, que tiene respaldo y brazos. + + + sillón + mueble + Silla de brazos, mayor y más cómoda que la ordinaria. + + From 4c1f2b7f9a13ba3263b140c11524bd934d3b93bf Mon Sep 17 00:00:00 2001 From: snxx Date: Fri, 6 May 2022 01:48:28 +0500 Subject: [PATCH 170/227] (docs) Toit language (www.toit.io) highlighting (#3531) --- CHANGES.md | 2 ++ SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 54a5048815..a565c551e0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,10 +5,12 @@ Grammars: - enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][] - enh(swift) add support for `distributed` keyword [Marcus Ortiz][] - enh(xml) recognize Unicode letters instead of only ASCII letters in XML element and attribute names (#3256)[Martin Honnen][] +- Added 3rd party Toit grammar to SUPPORTED_LANGUAGES [Serzhan Nasredin][] [Bradley Mackey]: https://github.com/bradleymackey [Marcus Ortiz]: https://github.com/mportiz08 [Martin Honnen]: https://github.com/martin-honnen +[Serzhan Nasredin]: https://github.com/snxx-lppxx ## Version 11.5.0 diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 51097c6f39..9b87c5879a 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -203,6 +203,7 @@ The table below shows the full list of languages (and corresponding classes/alia | Terraform (HCL) | terraform, tf, hcl | [highlightjs-terraform](https://github.com/highlightjs/highlightjs-terraform) | | Test Anything Protocol | tap | | | Thrift | thrift | | +| Toit | toit | [toit-highlight](https://github.com/snxx-lppxx/toit-highlight) | | TP | tp | | | Transact-SQL | tsql | [highlightjs-tsql](https://github.com/highlightjs/highlightjs-tsql) | | Twig | twig, craftcms | | From 88b2e442e08920046393c0bace09aa3bc93ddef1 Mon Sep 17 00:00:00 2001 From: Tobias Buschor Date: Wed, 11 May 2022 20:21:46 +0200 Subject: [PATCH 171/227] (chore) substr is deprecated, use substring (#3535) * substr is deprecated Hi 'string'.substr() is deprecated See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr Using with one argument should be compatible with 'string'.substring() https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring --- CHANGES.md | 2 ++ src/highlight.js | 6 +++--- src/languages/javascript.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a565c551e0..bc891f4649 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,11 +6,13 @@ Grammars: - enh(swift) add support for `distributed` keyword [Marcus Ortiz][] - enh(xml) recognize Unicode letters instead of only ASCII letters in XML element and attribute names (#3256)[Martin Honnen][] - Added 3rd party Toit grammar to SUPPORTED_LANGUAGES [Serzhan Nasredin][] +- Use substring() instead of deprecated substr() [Tobias Buschor][] [Bradley Mackey]: https://github.com/bradleymackey [Marcus Ortiz]: https://github.com/mportiz08 [Martin Honnen]: https://github.com/martin-honnen [Serzhan Nasredin]: https://github.com/snxx-lppxx +[Tobias Buschor]: https://github.com/nuxodin/ ## Version 11.5.0 diff --git a/src/highlight.js b/src/highlight.js index f81cc458e9..64373ac878 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -232,7 +232,7 @@ const HLJS = function(hljs) { lastIndex = top.keywordPatternRe.lastIndex; match = top.keywordPatternRe.exec(modeBuffer); } - buf += modeBuffer.substr(lastIndex); + buf += modeBuffer.substring(lastIndex); emitter.addText(buf); } @@ -407,7 +407,7 @@ const HLJS = function(hljs) { */ function doEndMatch(match) { const lexeme = match[0]; - const matchPlusRemainder = codeToHighlight.substr(match.index); + const matchPlusRemainder = codeToHighlight.substring(match.index); const endMode = endOfMode(top, match, matchPlusRemainder); if (!endMode) { return NO_MATCH; } @@ -580,7 +580,7 @@ const HLJS = function(hljs) { const processedCount = processLexeme(beforeMatch, match); index = match.index + processedCount; } - processLexeme(codeToHighlight.substr(index)); + processLexeme(codeToHighlight.substring(index)); emitter.closeAllNodes(); emitter.finalize(); result = emitter.toHTML(); diff --git a/src/languages/javascript.js b/src/languages/javascript.js index e3ec15a04c..1b1ff4c30e 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -68,7 +68,7 @@ export default function(hljs) { // `` // technically this could be HTML, but it smells like a type let m; - const afterMatch = match.input.substr(afterMatchIndex); + const afterMatch = match.input.substring(afterMatchIndex); // NOTE: This is ugh, but added specifically for https://github.com/highlightjs/highlight.js/issues/3276 if ((m = afterMatch.match(/^\s+extends\s+/))) { if (m.index === 0) { From 8c4a39d2a07f0adb0783f31927539f32634a2f8e Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 12 May 2022 20:37:51 -0700 Subject: [PATCH 172/227] add Oak to supported languages (3rd party) (#3534) --- CHANGES.md | 2 ++ SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index bc891f4649..1043087b6f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,12 +7,14 @@ Grammars: - enh(xml) recognize Unicode letters instead of only ASCII letters in XML element and attribute names (#3256)[Martin Honnen][] - Added 3rd party Toit grammar to SUPPORTED_LANGUAGES [Serzhan Nasredin][] - Use substring() instead of deprecated substr() [Tobias Buschor][] +- Added 3rd party Oak grammar to SUPPORTED_LANGUAGES [Tim Smith][] [Bradley Mackey]: https://github.com/bradleymackey [Marcus Ortiz]: https://github.com/mportiz08 [Martin Honnen]: https://github.com/martin-honnen [Serzhan Nasredin]: https://github.com/snxx-lppxx [Tobias Buschor]: https://github.com/nuxodin/ +[Tim Smith]: https://github.com/timlabs ## Version 11.5.0 diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 9b87c5879a..eb1e9e9f62 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -137,6 +137,7 @@ The table below shows the full list of languages (and corresponding classes/alia | Nginx | nginx, nginxconf | | | Nim | nim, nimrod | | | Nix | nix | | +| Oak | oak | [highlightjs-oak](https://github.com/timlabs/highlightjs-oak) | | Object Constraint Language | ocl | [highlightjs-ocl](https://github.com/nhomble/highlightjs-ocl) | | OCaml | ocaml, ml | | | Objective C | objectivec, mm, objc, obj-c, obj-c++, objective-c++ | | From 8ecf4fe92da01188ff8ef91f193d0dfd71ef7484 Mon Sep 17 00:00:00 2001 From: Avrumy Date: Tue, 17 May 2022 17:28:37 +0300 Subject: [PATCH 173/227] enh(python) add `match` and `case` keywords (#3538) Closes #3537. --- CHANGES.md | 2 ++ src/languages/python.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 1043087b6f..59a3764321 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ Grammars: - Added 3rd party Toit grammar to SUPPORTED_LANGUAGES [Serzhan Nasredin][] - Use substring() instead of deprecated substr() [Tobias Buschor][] - Added 3rd party Oak grammar to SUPPORTED_LANGUAGES [Tim Smith][] +- enh(python) add `match` and `case` keywords [Avrumy Lunger][] [Bradley Mackey]: https://github.com/bradleymackey [Marcus Ortiz]: https://github.com/mportiz08 @@ -15,6 +16,7 @@ Grammars: [Serzhan Nasredin]: https://github.com/snxx-lppxx [Tobias Buschor]: https://github.com/nuxodin/ [Tim Smith]: https://github.com/timlabs +[Avrumy Lunger]: https://github.com/vrumger ## Version 11.5.0 diff --git a/src/languages/python.js b/src/languages/python.js index cb152d1b6c..10a4e9e273 100644 --- a/src/languages/python.js +++ b/src/languages/python.js @@ -15,6 +15,7 @@ export default function(hljs) { 'async', 'await', 'break', + 'case', 'class', 'continue', 'def', @@ -31,6 +32,7 @@ export default function(hljs) { 'in', 'is', 'lambda', + 'match', 'nonlocal|10', 'not', 'or', From 4dfb4ae6eec1d9b7234d2150d9e9f068e520bfed Mon Sep 17 00:00:00 2001 From: Alex <69764315+Serial-ATA@users.noreply.github.com> Date: Mon, 23 May 2022 07:41:23 -0400 Subject: [PATCH 174/227] fix(rust) recognize `include_bytes!` macro (#3541) --- CHANGES.md | 2 ++ src/languages/rust.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 59a3764321..350267fb89 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- fix(rust) recognize `include_bytes!` macro (#3541) [Serial-ATA][] - enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][] - enh(swift) add support for `distributed` keyword [Marcus Ortiz][] - enh(xml) recognize Unicode letters instead of only ASCII letters in XML element and attribute names (#3256)[Martin Honnen][] @@ -10,6 +11,7 @@ Grammars: - Added 3rd party Oak grammar to SUPPORTED_LANGUAGES [Tim Smith][] - enh(python) add `match` and `case` keywords [Avrumy Lunger][] +[Serial-ATA]: https://github.com/Serial-ATA [Bradley Mackey]: https://github.com/bradleymackey [Marcus Ortiz]: https://github.com/mportiz08 [Martin Honnen]: https://github.com/martin-honnen diff --git a/src/languages/rust.js b/src/languages/rust.js index 005d2da72a..4e65b578dd 100644 --- a/src/languages/rust.js +++ b/src/languages/rust.js @@ -127,7 +127,7 @@ export default function(hljs) { "file!", "format!", "format_args!", - "include_bin!", + "include_bytes!", "include_str!", "line!", "local_data_key!", From 7629b44b5d070695f1974cc4f71a9bc533a07c56 Mon Sep 17 00:00:00 2001 From: Megatron King <1256980529@qq.com> Date: Fri, 3 Jun 2022 03:00:56 +0800 Subject: [PATCH 175/227] fix(scala) `END` mode should be an object (#3547) --- src/languages/scala.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/languages/scala.js b/src/languages/scala.js index 5db9b60b1e..d2aef9d6bc 100644 --- a/src/languages/scala.js +++ b/src/languages/scala.js @@ -119,20 +119,18 @@ export default function(hljs) { beginScope: { 2: "keyword", } }; - const END = [ - { - begin: [ - /^\s*/, // Is first token on the line - /end/, - /\s+/, - /(extension\b)?/, // `extension` is the only marker that follows an `end` that cannot be captured by another rule. - ], - beginScope: { - 2: "keyword", - 4: "keyword", - } + const END = { + begin: [ + /^\s*/, // Is first token on the line + /end/, + /\s+/, + /(extension\b)?/, // `extension` is the only marker that follows an `end` that cannot be captured by another rule. + ], + beginScope: { + 2: "keyword", + 4: "keyword", } - ]; + }; // TODO: use negative look-behind in future // /(? Date: Sat, 11 Jun 2022 16:02:54 -0500 Subject: [PATCH 176/227] chore: Set permissions for GitHub actions (#3549) --- .github/workflows/lint.yml | 3 +++ .github/workflows/node.js.yml | 3 +++ .github/workflows/size_report.yml | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e8e8ac936e..eef530b8a4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,6 +8,9 @@ on: branches: - main +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 55c5aa64d6..06fd7c4c38 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -9,6 +9,9 @@ on: pull_request: branches: [ main ] +permissions: + contents: read + jobs: build: diff --git a/.github/workflows/size_report.yml b/.github/workflows/size_report.yml index 0d9a047ef3..3c73a04453 100644 --- a/.github/workflows/size_report.yml +++ b/.github/workflows/size_report.yml @@ -6,9 +6,17 @@ name: Size Report (gzip) on: [pull_request] +permissions: + contents: read + jobs: build: + permissions: + checks: write # for preactjs/compressed-size-action to create and update the checks + contents: read # for actions/checkout to fetch code + issues: write # for preactjs/compressed-size-action to create comments + pull-requests: write # for preactjs/compressed-size-action to write a PR review runs-on: ubuntu-latest steps: From 98278440d5ab253d08f2cf6e0f7a3802e5511aff Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 12 Jun 2022 08:24:52 -0400 Subject: [PATCH 177/227] (chore) npm audit fix --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0e6d4bf6ec..f088e6026c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2831,9 +2831,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/mocha": { @@ -6173,9 +6173,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mocha": { From f78eac433035b7e5001ff74c5ba9b8e09ceb35de Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 12 Jun 2022 08:30:56 -0400 Subject: [PATCH 178/227] (chore) bump deps --- package-lock.json | 1506 ++++++++++++++++++++++++++++++--------------- package.json | 33 +- 2 files changed, 1025 insertions(+), 514 deletions(-) diff --git a/package-lock.json b/package-lock.json index f088e6026c..c0ddc4854a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,37 +10,37 @@ "license": "BSD-3-Clause", "devDependencies": { "@colors/colors": "^1.5.0", - "@rollup/plugin-commonjs": "^21.0.0", + "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.0.0", - "@types/mocha": "^9.0.0", - "@typescript-eslint/eslint-plugin": "^5.12.0", - "@typescript-eslint/parser": "^5.12.0", - "clean-css": "^5.0.1", + "@rollup/plugin-node-resolve": "^13.3.0", + "@types/mocha": "^9.1.1", + "@typescript-eslint/eslint-plugin": "^5.27.1", + "@typescript-eslint/parser": "^5.27.1", + "clean-css": "^5.3.0", "cli-table": "^0.3.1", "commander": "8.2", "css": "^3.0.0", "css-color-names": "^1.0.1", "deep-freeze-es6": "^1.4.1", - "del": "^6.0.0", + "del": "^6.1.1", "dependency-resolver": "^2.0.1", - "eslint": "^8.9.0", - "eslint-config-standard": "^16.0.1", - "eslint-plugin-import": "^2.25.4", + "eslint": "^8.17.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.26.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^6.0.0", - "glob": "^7.1.7", + "glob": "^8.0.3", "glob-promise": "^4.2.2", "handlebars": "^4.7.6", "jsdom": "^19.0.0", "lodash": "^4.17.20", - "mocha": "^9.1.3", + "mocha": "^10.0.0", "refa": "^0.4.1", "rollup": "^2.47.0", "should": "^13.2.3", - "terser": "^5.7.0", + "terser": "^5.14.1", "tiny-worker": "^2.3.0", - "typescript": "^4.4.4", + "typescript": "^4.7.3", "wcag-contrast": "^3.0.0" }, "engines": { @@ -57,34 +57,25 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz", - "integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", @@ -105,13 +96,71 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz", + "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz", + "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz", + "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "2.0.3", + "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" }, "engines": { @@ -119,21 +168,21 @@ } }, "node_modules/@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.3", + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" }, "engines": { @@ -141,9 +190,9 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz", - "integrity": "sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", + "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", @@ -155,10 +204,10 @@ "resolve": "^1.17.0" }, "engines": { - "node": ">= 8.0.0" + "node": ">= 12.0.0" }, "peerDependencies": { - "rollup": "^2.38.3" + "rollup": "^2.68.0" } }, "node_modules/@rollup/plugin-commonjs/node_modules/estree-walker": { @@ -167,6 +216,26 @@ "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", "dev": true }, + "node_modules/@rollup/plugin-commonjs/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@rollup/plugin-commonjs/node_modules/is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -195,15 +264,15 @@ } }, "node_modules/@rollup/plugin-node-resolve": { - "version": "13.1.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz", - "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", + "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", "is-module": "^1.0.0", "resolve": "^1.19.0" }, @@ -269,15 +338,15 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "node_modules/@types/minimatch": { @@ -287,9 +356,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", - "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", "dev": true }, "node_modules/@types/node": { @@ -299,19 +368,19 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.0.tgz", - "integrity": "sha512-fwCMkDimwHVeIOKeBHiZhRUfJXU8n6xW1FL9diDxAyGAFvKcH4csy0v7twivOQdQdA0KC8TDr7GGRd3L4Lv0rQ==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz", + "integrity": "sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/type-utils": "5.12.0", - "@typescript-eslint/utils": "5.12.0", - "debug": "^4.3.2", + "@typescript-eslint/scope-manager": "5.27.1", + "@typescript-eslint/type-utils": "5.27.1", + "@typescript-eslint/utils": "5.27.1", + "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", + "ignore": "^5.2.0", "regexpp": "^3.2.0", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { @@ -332,15 +401,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.12.0.tgz", - "integrity": "sha512-MfSwg9JMBojMUoGjUmX+D2stoQj1CBYTCP0qnnVtu9A+YQXVKNtLjasYh+jozOcrb/wau8TCfWOkQTiOAruBog==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.27.1.tgz", + "integrity": "sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/typescript-estree": "5.12.0", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "5.27.1", + "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/typescript-estree": "5.27.1", + "debug": "^4.3.4" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -359,13 +428,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.12.0.tgz", - "integrity": "sha512-GAMobtIJI8FGf1sLlUWNUm2IOkIjvn7laFWyRx7CLrv6nLBI7su+B7lbStqVlK5NdLvHRFiJo2HhiDF7Ki01WQ==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz", + "integrity": "sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/visitor-keys": "5.12.0" + "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/visitor-keys": "5.27.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -376,13 +445,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.12.0.tgz", - "integrity": "sha512-9j9rli3zEBV+ae7rlbBOotJcI6zfc6SHFMdKI9M3Nc0sy458LJ79Os+TPWeBBL96J9/e36rdJOfCuyRSgFAA0Q==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz", + "integrity": "sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.12.0", - "debug": "^4.3.2", + "@typescript-eslint/utils": "5.27.1", + "debug": "^4.3.4", "tsutils": "^3.21.0" }, "engines": { @@ -402,9 +471,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.12.0.tgz", - "integrity": "sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.27.1.tgz", + "integrity": "sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -415,17 +484,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz", - "integrity": "sha512-Dd9gVeOqt38QHR0BEA8oRaT65WYqPYbIc5tRFQPkfLquVEFPD1HAtbZT98TLBkEcCkvwDYOAvuSvAD9DnQhMfQ==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz", + "integrity": "sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/visitor-keys": "5.12.0", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/visitor-keys": "5.27.1", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { @@ -442,15 +511,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.12.0.tgz", - "integrity": "sha512-k4J2WovnMPGI4PzKgDtQdNrCnmBHpMUFy21qjX2CoPdoBcSBIMvVBr9P2YDP8jOqZOeK3ThOL6VO/sy6jtnvzw==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.27.1.tgz", + "integrity": "sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/typescript-estree": "5.12.0", + "@typescript-eslint/scope-manager": "5.27.1", + "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/typescript-estree": "5.27.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -493,13 +562,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.0.tgz", - "integrity": "sha512-cFwTlgnMV6TgezQynx2c/4/tx9Tufbuo9LPzmWqyRC3QC4qTGkAG1C6pBr0/4I10PAI/FlYunI3vJjIcu+ZHMg==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz", + "integrity": "sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.12.0", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "5.27.1", + "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -531,9 +600,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -779,12 +848,25 @@ "dev": true }, "node_modules/builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "peer": true, + "dependencies": { + "semver": "^7.0.0" } }, "node_modules/call-bind": { @@ -901,9 +983,9 @@ } }, "node_modules/clean-css": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.4.tgz", - "integrity": "sha512-nKseG8wCzEuji/4yrgM/5cthL9oTDc5UOQyFMvW/Q53oP6gLH690o1NbuTh6Y18nujr7BxlsFuS7gXLnLzKJGg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.0.tgz", + "integrity": "sha512-YYuuxv4H/iNb1Z/5IbMRoxgrzjWGhOEFfd+groZ5dMCVkpENiMZmwspdrzBo9286JjM1gZJPAyL7ZIdzuvu2AQ==", "dev": true, "dependencies": { "source-map": "~0.6.0" @@ -1059,9 +1141,9 @@ } }, "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -1124,9 +1206,9 @@ } }, "node_modules/del": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz", - "integrity": "sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", + "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", "dev": true, "dependencies": { "globby": "^11.0.1", @@ -1140,6 +1222,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/delayed-stream": { @@ -1300,12 +1385,12 @@ } }, "node_modules/eslint": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz", - "integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.17.0.tgz", + "integrity": "sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.1.0", + "@eslint/eslintrc": "^1.3.0", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -1316,14 +1401,14 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -1332,7 +1417,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -1352,9 +1437,9 @@ } }, "node_modules/eslint-config-standard": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz", - "integrity": "sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", + "integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==", "dev": true, "funding": [ { @@ -1371,10 +1456,10 @@ } ], "peerDependencies": { - "eslint": "^7.12.1", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^4.2.1 || ^5.0.0" + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0", + "eslint-plugin-promise": "^6.0.0" } }, "node_modules/eslint-import-resolver-node": { @@ -1490,9 +1575,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "dependencies": { "array-includes": "^3.1.4", @@ -1500,14 +1585,14 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "is-core-module": "^2.8.0", + "is-core-module": "^2.8.1", "is-glob": "^4.0.3", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "engines": { "node": ">=4" @@ -1543,6 +1628,97 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "node_modules/eslint-plugin-n": { + "version": "15.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.2.tgz", + "integrity": "sha512-MLjZVAv4TiCIoXqjibNqCJjLkGHfrOY3XZ0ZBLoW0OnS3o98PUBnzB/kfp8dCz/4A4Y18jjX50PRnqI4ACFY1Q==", + "dev": true, + "peer": true, + "dependencies": { + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", + "ignore": "^5.1.1", + "is-core-module": "^2.9.0", + "minimatch": "^3.1.2", + "resolve": "^1.10.1", + "semver": "^7.3.7" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/eslint-plugin-es": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", + "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", + "dev": true, + "peer": true, + "dependencies": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" + } + }, + "node_modules/eslint-plugin-n/node_modules/eslint-plugin-es/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "peer": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-plugin-n/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "peer": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-plugin-n/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -1697,15 +1873,6 @@ "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/eslint/node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -1767,13 +1934,13 @@ } }, "node_modules/espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dev": true, "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1869,20 +2036,19 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" }, "engines": { - "node": ">=8" + "node": ">=8.6.0" } }, "node_modules/fast-json-stable-stringify": { @@ -1898,12 +2064,12 @@ "dev": true }, "node_modules/fastq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "dependencies": { - "reusify": "^1.0.0" + "reusify": "^1.0.4" } }, "node_modules/file-entry-cache": { @@ -2066,20 +2232,19 @@ } }, "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2116,10 +2281,31 @@ "glob": "^7.1.6" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -2132,16 +2318,16 @@ } }, "node_modules/globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" }, "engines": { @@ -2157,15 +2343,6 @@ "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "engines": { - "node": ">=4.x" - } - }, "node_modules/handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -2296,9 +2473,9 @@ } }, "node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, "engines": { "node": ">= 4" @@ -2408,6 +2585,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-builtin-module": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", + "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/is-callable": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", @@ -2421,9 +2610,9 @@ } }, "node_modules/is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -2785,16 +2974,16 @@ } }, "node_modules/micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { - "node": ">=8" + "node": ">=8.6" } }, "node_modules/mime-db": { @@ -2819,9 +3008,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -2837,42 +3026,40 @@ "dev": true }, "node_modules/mocha": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.0.tgz", - "integrity": "sha512-kNn7E8g2SzVcq0a77dkphPsDSN7P+iYkqE0ZsGCYWRsoiKjOt+NvXfaagik8vuDa6W5Zw3qxe8Jfpt5qKf+6/Q==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", + "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", - "debug": "4.3.3", + "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", - "growl": "1.10.5", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", - "minimatch": "3.0.4", + "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.2.0", + "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", + "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", - "mocha": "bin/mocha" + "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 12.0.0" + "node": ">= 14.0.0" }, "funding": { "type": "opencollective", @@ -2888,6 +3075,38 @@ "node": ">=10" } }, + "node_modules/mocha/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/mocha/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2897,6 +3116,27 @@ "node": ">=8" } }, + "node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/mocha/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2925,9 +3165,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -3148,9 +3388,9 @@ } }, "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" @@ -3183,6 +3423,26 @@ "node": ">=6" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3244,13 +3504,17 @@ } }, "node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dev": true, "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3287,10 +3551,30 @@ "rimraf": "bin.js" } }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/rollup": { - "version": "2.67.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.67.2.tgz", - "integrity": "sha512-hoEiBWwZtf1QdK3jZIq59L0FJj4Fiv4RplCO4pvCRC86qsoFurWB4hKQIjoRf3WvJmk5UZ9b0y5ton+62fC7Tw==", + "version": "2.75.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", + "integrity": "sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -3303,10 +3587,27 @@ } }, "node_modules/run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } }, "node_modules/safe-buffer": { "version": "5.2.1", @@ -3347,9 +3648,9 @@ } }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3567,7 +3868,7 @@ "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { "node": ">=4" @@ -3582,6 +3883,18 @@ "node": ">=8" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -3589,13 +3902,14 @@ "dev": true }, "node_modules/terser": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", - "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", + "version": "5.14.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz", + "integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==", "dev": true, "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "bin": { @@ -3603,14 +3917,6 @@ }, "engines": { "node": ">=10" - }, - "peerDependencies": { - "acorn": "^8.5.0" - }, - "peerDependenciesMeta": { - "acorn": { - "optional": true - } } }, "node_modules/terser/node_modules/commander": { @@ -3619,15 +3925,6 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "node_modules/terser/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -3682,14 +3979,14 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", - "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.1", - "minimist": "^1.2.0", + "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, @@ -3739,9 +4036,9 @@ } }, "node_modules/typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", + "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -3933,9 +4230,9 @@ "dev": true }, "node_modules/workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "node_modules/wrap-ansi": { @@ -4114,28 +4411,20 @@ "dev": true }, "@eslint/eslintrc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz", - "integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - } } }, "@humanwhocodes/config-array": { @@ -4155,36 +4444,85 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@jridgewell/gen-mapping": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz", + "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz", + "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz", + "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "requires": { - "@nodelib/fs.stat": "2.0.3", + "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true }, "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { - "@nodelib/fs.scandir": "2.1.3", + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "@rollup/plugin-commonjs": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz", - "integrity": "sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", + "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", @@ -4202,6 +4540,20 @@ "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", "dev": true }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -4232,15 +4584,15 @@ } }, "@rollup/plugin-node-resolve": { - "version": "13.1.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz", - "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", + "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", "is-module": "^1.0.0", "resolve": "^1.19.0" }, @@ -4298,15 +4650,15 @@ } }, "@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "@types/minimatch": { @@ -4316,9 +4668,9 @@ "dev": true }, "@types/mocha": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", - "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", "dev": true }, "@types/node": { @@ -4328,86 +4680,86 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.0.tgz", - "integrity": "sha512-fwCMkDimwHVeIOKeBHiZhRUfJXU8n6xW1FL9diDxAyGAFvKcH4csy0v7twivOQdQdA0KC8TDr7GGRd3L4Lv0rQ==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz", + "integrity": "sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/type-utils": "5.12.0", - "@typescript-eslint/utils": "5.12.0", - "debug": "^4.3.2", + "@typescript-eslint/scope-manager": "5.27.1", + "@typescript-eslint/type-utils": "5.27.1", + "@typescript-eslint/utils": "5.27.1", + "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", + "ignore": "^5.2.0", "regexpp": "^3.2.0", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.12.0.tgz", - "integrity": "sha512-MfSwg9JMBojMUoGjUmX+D2stoQj1CBYTCP0qnnVtu9A+YQXVKNtLjasYh+jozOcrb/wau8TCfWOkQTiOAruBog==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.27.1.tgz", + "integrity": "sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/typescript-estree": "5.12.0", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "5.27.1", + "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/typescript-estree": "5.27.1", + "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.12.0.tgz", - "integrity": "sha512-GAMobtIJI8FGf1sLlUWNUm2IOkIjvn7laFWyRx7CLrv6nLBI7su+B7lbStqVlK5NdLvHRFiJo2HhiDF7Ki01WQ==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz", + "integrity": "sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/visitor-keys": "5.12.0" + "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/visitor-keys": "5.27.1" } }, "@typescript-eslint/type-utils": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.12.0.tgz", - "integrity": "sha512-9j9rli3zEBV+ae7rlbBOotJcI6zfc6SHFMdKI9M3Nc0sy458LJ79Os+TPWeBBL96J9/e36rdJOfCuyRSgFAA0Q==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz", + "integrity": "sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.12.0", - "debug": "^4.3.2", + "@typescript-eslint/utils": "5.27.1", + "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.12.0.tgz", - "integrity": "sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.27.1.tgz", + "integrity": "sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz", - "integrity": "sha512-Dd9gVeOqt38QHR0BEA8oRaT65WYqPYbIc5tRFQPkfLquVEFPD1HAtbZT98TLBkEcCkvwDYOAvuSvAD9DnQhMfQ==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz", + "integrity": "sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/visitor-keys": "5.12.0", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/visitor-keys": "5.27.1", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/utils": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.12.0.tgz", - "integrity": "sha512-k4J2WovnMPGI4PzKgDtQdNrCnmBHpMUFy21qjX2CoPdoBcSBIMvVBr9P2YDP8jOqZOeK3ThOL6VO/sy6jtnvzw==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.27.1.tgz", + "integrity": "sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/typescript-estree": "5.12.0", + "@typescript-eslint/scope-manager": "5.27.1", + "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/typescript-estree": "5.27.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -4430,13 +4782,13 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.0.tgz", - "integrity": "sha512-cFwTlgnMV6TgezQynx2c/4/tx9Tufbuo9LPzmWqyRC3QC4qTGkAG1C6pBr0/4I10PAI/FlYunI3vJjIcu+ZHMg==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz", + "integrity": "sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.12.0", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "5.27.1", + "eslint-visitor-keys": "^3.3.0" }, "dependencies": { "eslint-visitor-keys": { @@ -4460,9 +4812,9 @@ "dev": true }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true }, "acorn-globals": { @@ -4647,11 +4999,21 @@ "dev": true }, "builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true }, + "builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "peer": true, + "requires": { + "semver": "^7.0.0" + } + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -4736,9 +5098,9 @@ } }, "clean-css": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.4.tgz", - "integrity": "sha512-nKseG8wCzEuji/4yrgM/5cthL9oTDc5UOQyFMvW/Q53oP6gLH690o1NbuTh6Y18nujr7BxlsFuS7gXLnLzKJGg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.0.tgz", + "integrity": "sha512-YYuuxv4H/iNb1Z/5IbMRoxgrzjWGhOEFfd+groZ5dMCVkpENiMZmwspdrzBo9286JjM1gZJPAyL7ZIdzuvu2AQ==", "dev": true, "requires": { "source-map": "~0.6.0" @@ -4868,9 +5230,9 @@ } }, "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -4916,9 +5278,9 @@ } }, "del": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz", - "integrity": "sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", + "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", "dev": true, "requires": { "globby": "^11.0.1", @@ -5049,12 +5411,12 @@ } }, "eslint": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz", - "integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.17.0.tgz", + "integrity": "sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.1.0", + "@eslint/eslintrc": "^1.3.0", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -5065,14 +5427,14 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -5081,7 +5443,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -5145,12 +5507,6 @@ "is-glob": "^4.0.3" } }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -5193,9 +5549,9 @@ } }, "eslint-config-standard": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz", - "integrity": "sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", + "integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==", "dev": true, "requires": {} }, @@ -5295,9 +5651,9 @@ } }, "eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "requires": { "array-includes": "^3.1.4", @@ -5305,14 +5661,14 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "is-core-module": "^2.8.0", + "is-core-module": "^2.8.1", "is-glob": "^4.0.3", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "dependencies": { "debug": { @@ -5341,6 +5697,67 @@ } } }, + "eslint-plugin-n": { + "version": "15.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.2.tgz", + "integrity": "sha512-MLjZVAv4TiCIoXqjibNqCJjLkGHfrOY3XZ0ZBLoW0OnS3o98PUBnzB/kfp8dCz/4A4Y18jjX50PRnqI4ACFY1Q==", + "dev": true, + "peer": true, + "requires": { + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", + "ignore": "^5.1.1", + "is-core-module": "^2.9.0", + "minimatch": "^3.1.2", + "resolve": "^1.10.1", + "semver": "^7.3.7" + }, + "dependencies": { + "eslint-plugin-es": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", + "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", + "dev": true, + "peer": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "peer": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + } + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "peer": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "peer": true + } + } + } + } + }, "eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -5402,13 +5819,13 @@ "dev": true }, "espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dev": true, "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "dependencies": { @@ -5479,17 +5896,16 @@ "dev": true }, "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" } }, "fast-json-stable-stringify": { @@ -5505,12 +5921,12 @@ "dev": true }, "fastq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { - "reusify": "^1.0.0" + "reusify": "^1.0.4" } }, "file-entry-cache": { @@ -5635,17 +6051,36 @@ } }, "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "glob-parent": { @@ -5667,25 +6102,25 @@ } }, "globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", "dev": true, "requires": { "type-fest": "^0.20.2" } }, "globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" } }, @@ -5695,12 +6130,6 @@ "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -5790,9 +6219,9 @@ } }, "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "import-fresh": { @@ -5872,6 +6301,15 @@ "has-tostringtag": "^1.0.0" } }, + "is-builtin-module": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", + "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "dev": true, + "requires": { + "builtin-modules": "^3.0.0" + } + }, "is-callable": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", @@ -5879,9 +6317,9 @@ "dev": true }, "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "requires": { "has": "^1.0.3" @@ -6139,13 +6577,13 @@ "dev": true }, "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, "mime-db": { @@ -6164,9 +6602,9 @@ } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -6179,32 +6617,30 @@ "dev": true }, "mocha": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.0.tgz", - "integrity": "sha512-kNn7E8g2SzVcq0a77dkphPsDSN7P+iYkqE0ZsGCYWRsoiKjOt+NvXfaagik8vuDa6W5Zw3qxe8Jfpt5qKf+6/Q==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", + "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", - "debug": "4.3.3", + "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", - "growl": "1.10.5", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", - "minimatch": "3.0.4", + "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.2.0", + "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", + "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -6216,12 +6652,57 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + } + } + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -6246,9 +6727,9 @@ "dev": true }, "nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true }, "natural-compare": { @@ -6412,9 +6893,9 @@ "dev": true }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "prelude-ls": { @@ -6435,6 +6916,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -6484,13 +6971,14 @@ "dev": true }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-from": { @@ -6512,22 +7000,41 @@ "dev": true, "requires": { "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "rollup": { - "version": "2.67.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.67.2.tgz", - "integrity": "sha512-hoEiBWwZtf1QdK3jZIq59L0FJj4Fiv4RplCO4pvCRC86qsoFurWB4hKQIjoRf3WvJmk5UZ9b0y5ton+62fC7Tw==", + "version": "2.75.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", + "integrity": "sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==", "dev": true, "requires": { "fsevents": "~2.3.2" } }, "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } }, "safe-buffer": { "version": "5.2.1", @@ -6551,9 +7058,9 @@ } }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -6737,7 +7244,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true }, "strip-json-comments": { @@ -6746,6 +7253,12 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -6753,13 +7266,14 @@ "dev": true }, "terser": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", - "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", + "version": "5.14.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz", + "integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "dependencies": { @@ -6768,12 +7282,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true } } }, @@ -6822,14 +7330,14 @@ } }, "tsconfig-paths": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", - "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "requires": { "@types/json5": "^0.0.29", "json5": "^1.0.1", - "minimist": "^1.2.0", + "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, @@ -6864,9 +7372,9 @@ "dev": true }, "typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", + "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", "dev": true }, "uglify-js": { @@ -7014,9 +7522,9 @@ "dev": true }, "workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "wrap-ansi": { diff --git a/package.json b/package.json index 7fff2315ce..f16f66d8e9 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,10 @@ "type": "commonjs", "main": "./lib/index.js", "types": "./types/index.d.ts", - "sideEffects": ["*.css", "*.scss"], + "sideEffects": [ + "*.css", + "*.scss" + ], "scripts": { "mocha": "mocha", "lint": "eslint src/*.js src/lib/*.js demo/*.js tools/**/*.js --ignore-pattern vendor", @@ -53,37 +56,37 @@ }, "devDependencies": { "@colors/colors": "^1.5.0", - "@rollup/plugin-commonjs": "^21.0.0", + "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.0.0", - "@types/mocha": "^9.0.0", - "@typescript-eslint/eslint-plugin": "^5.12.0", - "@typescript-eslint/parser": "^5.12.0", - "clean-css": "^5.0.1", + "@rollup/plugin-node-resolve": "^13.3.0", + "@types/mocha": "^9.1.1", + "@typescript-eslint/eslint-plugin": "^5.27.1", + "@typescript-eslint/parser": "^5.27.1", + "clean-css": "^5.3.0", "cli-table": "^0.3.1", "commander": "8.2", "css": "^3.0.0", "css-color-names": "^1.0.1", "deep-freeze-es6": "^1.4.1", - "del": "^6.0.0", + "del": "^6.1.1", "dependency-resolver": "^2.0.1", - "eslint": "^8.9.0", - "eslint-config-standard": "^16.0.1", - "eslint-plugin-import": "^2.25.4", + "eslint": "^8.17.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.26.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^6.0.0", - "glob": "^7.1.7", + "glob": "^8.0.3", "glob-promise": "^4.2.2", "handlebars": "^4.7.6", "jsdom": "^19.0.0", "lodash": "^4.17.20", - "mocha": "^9.1.3", + "mocha": "^10.0.0", "refa": "^0.4.1", "rollup": "^2.47.0", "should": "^13.2.3", - "terser": "^5.7.0", + "terser": "^5.14.1", "tiny-worker": "^2.3.0", - "typescript": "^4.4.4", + "typescript": "^4.7.3", "wcag-contrast": "^3.0.0" } } From 0f5b40d840da4c9e7b10c52554d55b0dc4a1e177 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 12 Jun 2022 08:35:06 -0400 Subject: [PATCH 179/227] rewind glob --- package-lock.json | 137 +++++----------------------------------------- package.json | 2 +- 2 files changed, 15 insertions(+), 124 deletions(-) diff --git a/package-lock.json b/package-lock.json index c0ddc4854a..109f2438ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "eslint-plugin-import": "^2.26.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^6.0.0", - "glob": "^8.0.3", + "glob": "^7.2.3", "glob-promise": "^4.2.2", "handlebars": "^4.7.6", "jsdom": "^19.0.0", @@ -216,26 +216,6 @@ "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", "dev": true }, - "node_modules/@rollup/plugin-commonjs/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@rollup/plugin-commonjs/node_modules/is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -2232,19 +2212,20 @@ } }, "node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=12" + "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2281,27 +2262,6 @@ "glob": "^7.1.6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/globals": { "version": "13.15.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", @@ -3551,26 +3511,6 @@ "rimraf": "bin.js" } }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rollup": { "version": "2.75.6", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", @@ -4540,20 +4480,6 @@ "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", "dev": true }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, "is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -6051,36 +5977,17 @@ } }, "glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - } - } + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-parent": { @@ -7000,22 +6907,6 @@ "dev": true, "requires": { "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } } }, "rollup": { diff --git a/package.json b/package.json index f16f66d8e9..71b5f4fcfd 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "eslint-plugin-import": "^2.26.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^6.0.0", - "glob": "^8.0.3", + "glob": "^7.2.3", "glob-promise": "^4.2.2", "handlebars": "^4.7.6", "jsdom": "^19.0.0", From b3143343bbb19b21ea3b2e7f1e37ccb14e36e5ac Mon Sep 17 00:00:00 2001 From: Naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Sun, 12 Jun 2022 07:42:10 -0500 Subject: [PATCH 180/227] chore: Included githubactions in the dependabot config (#3550) This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure. Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com> --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..5ace4600a1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From 9dda37a3ae3d7fc2f0164c3610b0afa5b3d01525 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 12 Jun 2022 08:46:51 -0400 Subject: [PATCH 181/227] Bump actions/setup-node from 1 to 3 (#3552) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 3. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v1...v3) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lint.yml | 2 +- .github/workflows/node.js.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eef530b8a4..633b8cdd58 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: node-version: "*" # latest - run: npm ci diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 06fd7c4c38..cc5bdc93b2 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a321f94d3c..daf13be7ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: TAG_PREFIX: refs/tags/ # Optional, default prefix refs/tags/ - name: Use Node.js 15.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 15.x - name: Build Node.js package From 927398e23df143e80110a923224e3497c86ab1d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 12 Jun 2022 08:49:06 -0400 Subject: [PATCH 182/227] Bump actions/checkout from 2 to 3 (#3553) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lint.yml | 2 +- .github/workflows/node.js.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/size_report.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 633b8cdd58..5d3a73a664 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: "*" # latest diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cc5bdc93b2..0b1d4f8166 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -23,7 +23,7 @@ jobs: build-how: ["node", "browser", "browser -n", "cdn :common"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index daf13be7ce..06a49d0b15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout highlight.js - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Tag is ${{ github.ref }}. # we have to repeat ourselves here since the environment is not actually updated @@ -80,7 +80,7 @@ jobs: false - name: Checkout cdn-release - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: 'highlightjs/cdn-release' path: 'cdn-release' diff --git a/.github/workflows/size_report.yml b/.github/workflows/size_report.yml index 3c73a04453..4a3fe22e6b 100644 --- a/.github/workflows/size_report.yml +++ b/.github/workflows/size_report.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compute Compressed Size uses: preactjs/compressed-size-action@v2 with: From 95e56156d15edd1b73a9d4bf7311feea780e08c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 12 Jun 2022 09:13:46 -0400 Subject: [PATCH 183/227] Bump geritol/match-tag-to-package-version from 0.0.2 to 0.2.0 (#3551) Bumps [geritol/match-tag-to-package-version](https://github.com/geritol/match-tag-to-package-version) from 0.0.2 to 0.2.0. - [Release notes](https://github.com/geritol/match-tag-to-package-version/releases) - [Commits](https://github.com/geritol/match-tag-to-package-version/compare/0.0.2...0.2.0) --- updated-dependencies: - dependency-name: geritol/match-tag-to-package-version dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06a49d0b15..f787fe86f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: echo "RELEASING=stable" >> $GITHUB_ENV - name: match-tag-to-package-version - uses: geritol/match-tag-to-package-version@0.0.2 + uses: geritol/match-tag-to-package-version@0.2.0 env: TAG_PREFIX: refs/tags/ # Optional, default prefix refs/tags/ From 610f71ca2b2bc9a7211999d4896ec22fa47fce62 Mon Sep 17 00:00:00 2001 From: Maurits van Riezen <12109031+mousetail@users.noreply.github.com> Date: Mon, 13 Jun 2022 13:19:56 +0200 Subject: [PATCH 184/227] Fix(Java) Fix `==` being interpreted as a variable declaration (#3555) --- CHANGES.md | 2 ++ src/languages/java.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 350267fb89..3a1fbc4c4a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ Grammars: - fix(rust) recognize `include_bytes!` macro (#3541) [Serial-ATA][] +- fix(java) do not intepret `==` as a variable declaration [Mousetail][] - enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][] - enh(swift) add support for `distributed` keyword [Marcus Ortiz][] - enh(xml) recognize Unicode letters instead of only ASCII letters in XML element and attribute names (#3256)[Martin Honnen][] @@ -19,6 +20,7 @@ Grammars: [Tobias Buschor]: https://github.com/nuxodin/ [Tim Smith]: https://github.com/timlabs [Avrumy Lunger]: https://github.com/vrumger +[Mousetail]: https://github.com/mousetail ## Version 11.5.0 diff --git a/src/languages/java.js b/src/languages/java.js index 152da4ed0f..9a0cf137f5 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -187,7 +187,7 @@ export default function(hljs) { /\s+/, JAVA_IDENT_RE, /\s+/, - /=/ + /=(?!=)/ ], className: { 1: "type", From bae959016bab3f2a13d3108f98608b6428fc1a44 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 15 Jun 2022 00:21:49 -0400 Subject: [PATCH 185/227] fix(kotlin) should handled nested () in ANNOTATION --- src/languages/kotlin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/languages/kotlin.js b/src/languages/kotlin.js index 62c395c0dd..2e50992e97 100644 --- a/src/languages/kotlin.js +++ b/src/languages/kotlin.js @@ -92,7 +92,10 @@ export default function(hljs) { { begin: /\(/, end: /\)/, - contains: [ hljs.inherit(STRING, { className: 'string' }) ] + contains: [ + hljs.inherit(STRING, { className: 'string' }), + "self" + ] } ] }; From 7d3340250155f92729f6137b45b74651b0e6a1c9 Mon Sep 17 00:00:00 2001 From: David Schach Date: Wed, 15 Jun 2022 13:07:13 -0700 Subject: [PATCH 186/227] (docs) Add Apex to supported languages (#3546) --- CHANGES.md | 2 ++ SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 3a1fbc4c4a..9ea48d5cc2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- Added 3rd party Apex grammar to SUPPORTED_LANGUAGES (#3546) [David Schach][] - fix(rust) recognize `include_bytes!` macro (#3541) [Serial-ATA][] - fix(java) do not intepret `==` as a variable declaration [Mousetail][] - enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][] @@ -12,6 +13,7 @@ Grammars: - Added 3rd party Oak grammar to SUPPORTED_LANGUAGES [Tim Smith][] - enh(python) add `match` and `case` keywords [Avrumy Lunger][] +[David Schach]: https://github.com/dschach [Serial-ATA]: https://github.com/Serial-ATA [Bradley Mackey]: https://github.com/bradleymackey [Marcus Ortiz]: https://github.com/mportiz08 diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index eb1e9e9f62..03c91b54b4 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -13,6 +13,7 @@ The table below shows the full list of languages (and corresponding classes/alia | ABNF | abnf | | | Access logs | accesslog | | | Ada | ada | | +| Apex | apex | [highlightjs-apex](https://github.com/highlightjs/highlightjs-apex/) | | Arduino (C++ w/Arduino libs) | arduino, ino | | | ARM assembler | armasm, arm | | | AVR assembler | avrasm | | From dd2ae309279909aa261d5ee50229fa84d669fe20 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 22 Jun 2022 05:21:21 -0400 Subject: [PATCH 187/227] fix(rust) highlight types immediately preceeding `::` (#3540) Resolves #3539. --- CHANGES.md | 1 + src/languages/rust.js | 3 ++- test/markup/rust/types.expect.txt | 3 +++ test/markup/rust/types.txt | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 9ea48d5cc2..8e956b3597 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- fix(rust) highlight types immediately preceeding `::` (#3540) [Josh Goebel][] - Added 3rd party Apex grammar to SUPPORTED_LANGUAGES (#3546) [David Schach][] - fix(rust) recognize `include_bytes!` macro (#3541) [Serial-ATA][] - fix(java) do not intepret `==` as a variable declaration [Mousetail][] diff --git a/src/languages/rust.js b/src/languages/rust.js index 4e65b578dd..3f43aeb478 100644 --- a/src/languages/rust.js +++ b/src/languages/rust.js @@ -288,7 +288,8 @@ export default function(hljs) { begin: hljs.IDENT_RE + '::', keywords: { keyword: "Self", - built_in: BUILTINS + built_in: BUILTINS, + type: TYPES } }, { diff --git a/test/markup/rust/types.expect.txt b/test/markup/rust/types.expect.txt index a84825dff2..185c8f1d92 100644 --- a/test/markup/rust/types.expect.txt +++ b/test/markup/rust/types.expect.txt @@ -2,3 +2,6 @@ type A; type A = B; type R<T> = m::R<T, ConcreteError> + +let vec: Vec<isize> = Vec::new(); +if 100 > i32::MAX {} diff --git a/test/markup/rust/types.txt b/test/markup/rust/types.txt index b8644e4983..c8c5c3749a 100644 --- a/test/markup/rust/types.txt +++ b/test/markup/rust/types.txt @@ -2,3 +2,6 @@ type A: Trait; type A; type A = B; type R = m::R + +let vec: Vec = Vec::new(); +if 100 > i32::MAX {} From 998af68f0967bf4c50f5afef3b0ed55d47ec2647 Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Fri, 24 Jun 2022 13:22:02 -0700 Subject: [PATCH 188/227] (docs) add MLIR to list of supported languages (#3566) Include link to package. --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 03c91b54b4..a8c5278053 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -129,6 +129,7 @@ The table below shows the full list of languages (and corresponding classes/alia | mIRC Scripting Language | mirc, mrc | [highlightjs-mirc](https://github.com/highlightjs/highlightjs-mirc) | | Mizar | mizar | | | MKB | mkb | [highlightjs-mkb](https://github.com/Dereavy/highlightjs-mkb) | +| MLIR | mlir | [highlightjs-mlir](https://github.com/highlightjs/highlightjs-mlir) | | Mojolicious | mojolicious | | | Monkey | monkey | | | Moonscript | moonscript, moon | | From 6af7017604b36be0a4119ebbd881adb473f841f7 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 27 Jun 2022 14:07:27 -0400 Subject: [PATCH 189/227] fix(kotlin) `class` false positives and other small glitches (#3559) * fix(kotlin) class false positives * fix addl cases of same issue #3567. --- src/languages/kotlin.js | 13 ++++++++++--- test/markup/kotlin/class.expect.txt | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/languages/kotlin.js b/src/languages/kotlin.js index 2e50992e97..c31f5a9d49 100644 --- a/src/languages/kotlin.js +++ b/src/languages/kotlin.js @@ -203,8 +203,15 @@ export default function(hljs) { ] }, { - className: 'class', - beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS + begin: [ + /class|interface|trait/, + /\s+/, + hljs.UNDERSCORE_IDENT_RE + ], + beginScope: { + 3: "title.class" + }, + keywords: 'class interface trait', end: /[:\{(]|$/, excludeEnd: true, illegal: 'extends implements', @@ -222,7 +229,7 @@ export default function(hljs) { { className: 'type', begin: /[,:]\s*/, - end: /[<\(,]|$/, + end: /[<\(,){\s]|$/, excludeBegin: true, returnEnd: true }, diff --git a/test/markup/kotlin/class.expect.txt b/test/markup/kotlin/class.expect.txt index 583c2de7be..50936d3267 100644 --- a/test/markup/kotlin/class.expect.txt +++ b/test/markup/kotlin/class.expect.txt @@ -1,16 +1,16 @@ -class A { +class A { } -class B() +class B() -class C() {} +class C() {} -public class D +public class D -class E1<T> -class E2<T, R> -class E3<T,R> +class E1<T> +class E2<T, R> +class E3<T,R> -class F1 : A -class F2 : A, B -class F3 : A<T> \ No newline at end of file +class F1 : A +class F2 : A, B +class F3 : A<T> \ No newline at end of file From c57d04bb6bd318bc908131dd6802fa86555e5efe Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 27 Jun 2022 14:28:42 -0400 Subject: [PATCH 190/227] (docs) first pass at language request template --- .../ISSUE_TEMPLATE/z_request_language_repo.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/z_request_language_repo.md diff --git a/.github/ISSUE_TEMPLATE/z_request_language_repo.md b/.github/ISSUE_TEMPLATE/z_request_language_repo.md new file mode 100644 index 0000000000..880ef58762 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/z_request_language_repo.md @@ -0,0 +1,55 @@ +--- +name: Request a new 3rd party grammar repository +about: You'd like to host your repo inside the highlightjs org +title: "(request org repo) highlightjs-[name of your grammar]" +labels: language +assignees: 'joshgoebel' + +--- + + + +I would like to request the creation of a `highlightjs-[my-grammar]` repository for my 3rd party grammar. + + + +- [ ] I have an existing personal repository ready to go + + + + +### Metadata + +- Grammar Name: _Language Name_ +- Link to repo: _link to existing repository_ + + +### Requirements + +- [ ] I've read the [language Contributor Checklist](https://highlightjs.readthedocs.io/en/latest/language-contribution.html) +- [ ] I've read the [Language Contribution Guide](https://github.com/highlightjs/highlight.js/blob/main/extra/3RD_PARTY_QUICK_START.md) +- [ ] I'm currently willing to support and maintain this grammar over time +- [ ] That repo includes a `dist` folder with CDN-ready `CJS` and `ESM` builds +- [ ] That `README.md` includes examples of simple web usage +- [ ] That `README.md` includes examples of Node.js usage + + +### Afterwards + +Submit a PR that: + +- [ ] adds mention of your new language to `CHANGES.md` +- [ ] updates `SUPPORTED_LANGUAGES.md` in the main library + + From 955df259c3fed34d76376c70ed76f0cb87354895 Mon Sep 17 00:00:00 2001 From: Matt Bovel Date: Wed, 29 Jun 2022 22:06:20 +0200 Subject: [PATCH 191/227] (scala) Add transparent keyword (#3570) --- CHANGES.md | 2 ++ src/languages/scala.js | 2 +- test/markup/scala/inline.expect.txt | 2 +- test/markup/scala/transparent.expect.txt | 2 ++ test/markup/scala/transparent.txt | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 test/markup/scala/transparent.expect.txt create mode 100644 test/markup/scala/transparent.txt diff --git a/CHANGES.md b/CHANGES.md index 8e956b3597..09b80ef4df 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- enh(scala) add `transparent` keyword [Matt Bovel][] - fix(rust) highlight types immediately preceeding `::` (#3540) [Josh Goebel][] - Added 3rd party Apex grammar to SUPPORTED_LANGUAGES (#3546) [David Schach][] - fix(rust) recognize `include_bytes!` macro (#3541) [Serial-ATA][] @@ -14,6 +15,7 @@ Grammars: - Added 3rd party Oak grammar to SUPPORTED_LANGUAGES [Tim Smith][] - enh(python) add `match` and `case` keywords [Avrumy Lunger][] +[Matt Bovel]: https://github.com/mbovel [David Schach]: https://github.com/dschach [Serial-ATA]: https://github.com/Serial-ATA [Bradley Mackey]: https://github.com/bradleymackey diff --git a/src/languages/scala.js b/src/languages/scala.js index d2aef9d6bc..41d64e6d9c 100644 --- a/src/languages/scala.js +++ b/src/languages/scala.js @@ -155,7 +155,7 @@ export default function(hljs) { name: 'Scala', keywords: { literal: 'true false null', - keyword: 'type yield lazy override def with val var sealed abstract private trait object if then forSome for while do throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit export enum given' + keyword: 'type yield lazy override def with val var sealed abstract private trait object if then forSome for while do throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit export enum given transparent' }, contains: [ hljs.C_LINE_COMMENT_MODE, diff --git a/test/markup/scala/inline.expect.txt b/test/markup/scala/inline.expect.txt index e15b3e0663..5454d43e21 100644 --- a/test/markup/scala/inline.expect.txt +++ b/test/markup/scala/inline.expect.txt @@ -1,5 +1,5 @@ inline def pow(inline x: Int, inline n: Int) = ??? -transparent inline def f: Int = ??? +transparent inline def f: Int = ??? inline val a: Int = 9 inline given Int = 9 diff --git a/test/markup/scala/transparent.expect.txt b/test/markup/scala/transparent.expect.txt new file mode 100644 index 0000000000..e96b393e7d --- /dev/null +++ b/test/markup/scala/transparent.expect.txt @@ -0,0 +1,2 @@ +transparent inline def f() = 42 +transparent trait S diff --git a/test/markup/scala/transparent.txt b/test/markup/scala/transparent.txt new file mode 100644 index 0000000000..1f3b844888 --- /dev/null +++ b/test/markup/scala/transparent.txt @@ -0,0 +1,2 @@ +transparent inline def f() = 42 +transparent trait S From 3ae0ebddfe8366b178c1cca058359db8828a8dd7 Mon Sep 17 00:00:00 2001 From: David Schach Date: Wed, 29 Jun 2022 15:24:07 -0700 Subject: [PATCH 192/227] (docs) Language Contribution documentation update - repository creation request (#3569) * Add link to Issue submission Linking to general Issues page. Decided not to link to a specific template. Add hyperlink for referenced markdown page * Direct link to Supported Languages Clearly I don't know the tool for making the readthedocs site, so just link to the page. The link in this page to basic-testing will need to remain broken, as I don't know how to fix it. --- docs/language-contribution.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/language-contribution.rst b/docs/language-contribution.rst index 4fb9956b60..ae7d14c08d 100644 --- a/docs/language-contribution.rst +++ b/docs/language-contribution.rst @@ -108,11 +108,14 @@ distribute your own custom theme. 7. Request a repository at the ``highlightjs`` organization ----------------------------------------------------------- -*This is optional.* Of course you are free to host your repository anywhere -you would like. +*This is optional.* +Of course you are free to host your repository anywhere you would like. +Request a new 3rd party grammar repository hosted in highlightjs with Issue Type +`**Issue: Request a new 3rd party grammar repository** +`_ 8. Create a pull request ------------------------ -Submit a PR to add your language to `SUPPORTED_LANGUAGES.md`. +Submit a PR to add your language to `SUPPORTED_LANGUAGES.md `_. From 4eb662d3347a06102e23ba1c642c6fd5f6492fe6 Mon Sep 17 00:00:00 2001 From: David Pine Date: Fri, 1 Jul 2022 11:49:28 -0500 Subject: [PATCH 193/227] enh(csharp) Added support for the new `scoped` keyword in C# (#3571) --- CHANGES.md | 1 + src/languages/csharp.js | 3 ++- test/markup/csharp/scoped.expect.txt | 1 + test/markup/csharp/scoped.txt | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 test/markup/csharp/scoped.expect.txt create mode 100644 test/markup/csharp/scoped.txt diff --git a/CHANGES.md b/CHANGES.md index 09b80ef4df..5b727e447a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- enh(csharp) Added support for the new `scoped` keyword in C# (#3571) [David Pine][] - enh(scala) add `transparent` keyword [Matt Bovel][] - fix(rust) highlight types immediately preceeding `::` (#3540) [Josh Goebel][] - Added 3rd party Apex grammar to SUPPORTED_LANGUAGES (#3546) [David Schach][] diff --git a/src/languages/csharp.js b/src/languages/csharp.js index e86ed43448..2f228a9839 100644 --- a/src/languages/csharp.js +++ b/src/languages/csharp.js @@ -2,7 +2,7 @@ Language: C# Author: Jason Diamond Contributor: Nicolas LLOBERA , Pieter Vantorre , David Pine -Website: https://docs.microsoft.com/en-us/dotnet/csharp/ +Website: https://docs.microsoft.com/dotnet/csharp/ Category: common */ @@ -93,6 +93,7 @@ export default function(hljs) { 'record', 'ref', 'return', + 'scoped', 'sealed', 'sizeof', 'stackalloc', diff --git a/test/markup/csharp/scoped.expect.txt b/test/markup/csharp/scoped.expect.txt new file mode 100644 index 0000000000..88de4e742a --- /dev/null +++ b/test/markup/csharp/scoped.expect.txt @@ -0,0 +1 @@ +public static ref T AsRef<T>(scoped in T source); \ No newline at end of file diff --git a/test/markup/csharp/scoped.txt b/test/markup/csharp/scoped.txt new file mode 100644 index 0000000000..b2ee278dc6 --- /dev/null +++ b/test/markup/csharp/scoped.txt @@ -0,0 +1 @@ +public static ref T AsRef(scoped in T source); \ No newline at end of file From ba9418ed8e9c0633ac41bd4a09e1f6647a4c259a Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 8 Jul 2022 03:40:31 -0400 Subject: [PATCH 194/227] fix(css) fix quoting of url/data-uri that contains properly quoted `)` (#3516) * (chore) restore overall CSS consistency * fix(css) fix quoting of url/data-uri that contains properly quoted `)` * (chore) fix some explicit tests * (chore) fix relevancy * (chore) fix linter --- src/languages/css.js | 1 + src/languages/less.js | 9 +++++++-- src/languages/scss.js | 4 +++- src/languages/stylus.js | 3 ++- test/fixtures/expect/explicit2.txt | 2 +- test/fixtures/index.html | 4 ++-- test/markup/css/css_consistency.expect.txt | 2 ++ test/markup/css/css_consistency.txt | 2 ++ test/markup/css/url.expect.txt | 5 ++++- test/markup/css/url.txt | 5 ++++- test/markup/less/css_consistency.expect.txt | 2 +- test/markup/scss/css_consistency.expect.txt | 2 +- test/markup/scss/default.expect.txt | 4 ++-- test/markup/stylus/css_consistency.expect.txt | 2 +- test/markup/stylus/default.expect.txt | 2 +- 15 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/languages/css.js b/src/languages/css.js index 57baf24474..e76259c266 100644 --- a/src/languages/css.js +++ b/src/languages/css.js @@ -83,6 +83,7 @@ export default function(hljs) { relevance: 0, // from keywords keywords: { built_in: "url data-uri" }, contains: [ + ...STRINGS, { className: "string", // any character other than `)` as in `url()` will be the start diff --git a/src/languages/less.js b/src/languages/less.js index e66e630dae..c6a17ad79c 100644 --- a/src/languages/less.js +++ b/src/languages/less.js @@ -79,7 +79,9 @@ export default function(hljs) { returnBegin: true, excludeEnd: true }, - modes.IMPORTANT + modes.IMPORTANT, + { beginKeywords: 'and not' }, + modes.FUNCTION_DISPATCH ); const VALUE_WITH_RULESETS = VALUE_MODES.concat({ @@ -175,6 +177,7 @@ export default function(hljs) { MIXIN_GUARD_MODE, IDENT_MODE('keyword', 'all\\b'), IDENT_MODE('variable', '@\\{' + IDENT_RE + '\\}'), // otherwise it’s identified as tag + { begin: '\\b(' + css.TAGS.join('|') + ')\\b', className: 'selector-tag' @@ -217,7 +220,9 @@ export default function(hljs) { VAR_RULE_MODE, PSEUDO_SELECTOR_MODE, RULE_MODE, - SELECTOR_MODE + SELECTOR_MODE, + MIXIN_GUARD_MODE, + modes.FUNCTION_DISPATCH ); return { diff --git a/src/languages/scss.js b/src/languages/scss.js index 759cc8bbc2..0eaf922955 100644 --- a/src/languages/scss.js +++ b/src/languages/scss.js @@ -73,6 +73,7 @@ export default function(hljs) { { begin: /:/, end: /[;}{]/, + relevance: 0, contains: [ modes.BLOCK_COMMENT, VARIABLE, @@ -80,7 +81,8 @@ export default function(hljs) { modes.CSS_NUMBER_MODE, hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE, - modes.IMPORTANT + modes.IMPORTANT, + modes.FUNCTION_DISPATCH ] }, // matching these here allows us to treat them more like regular CSS diff --git a/src/languages/stylus.js b/src/languages/stylus.js index 40ac186cba..f680f90c7d 100644 --- a/src/languages/stylus.js +++ b/src/languages/stylus.js @@ -173,7 +173,8 @@ export default function(hljs) { hljs.QUOTE_STRING_MODE, modes.CSS_NUMBER_MODE, hljs.C_BLOCK_COMMENT_MODE, - modes.IMPORTANT + modes.IMPORTANT, + modes.FUNCTION_DISPATCH ], illegal: /\./, relevance: 0 diff --git a/test/fixtures/expect/explicit2.txt b/test/fixtures/expect/explicit2.txt index 0db09b19f0..3c6a86b30b 100644 --- a/test/fixtures/expect/explicit2.txt +++ b/test/fixtures/expect/explicit2.txt @@ -1,2 +1,2 @@ @import "compass/reset"; -$colorGreenDark: darken($colorGreen, 10); +$colorGreenDark: #393; diff --git a/test/fixtures/index.html b/test/fixtures/index.html index 0ca5640bbb..b3174e251d 100644 --- a/test/fixtures/index.html +++ b/test/fixtures/index.html @@ -21,12 +21,12 @@
@import "compass/reset";
-$colorGreenDark: darken($colorGreen, 10);
+$colorGreenDark: #393;
 
@import "compass/reset";
-$colorGreenDark: darken($colorGreen, 10);
+$colorGreenDark: #393;
 
diff --git a/test/markup/css/css_consistency.expect.txt b/test/markup/css/css_consistency.expect.txt index 784eda969c..93690630c5 100644 --- a/test/markup/css/css_consistency.expect.txt +++ b/test/markup/css/css_consistency.expect.txt @@ -22,7 +22,9 @@ a:visited { color: blue; } div::after { content: "test"; } +div:after { content: "test"; } div::before { content: open-quote; } +div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} diff --git a/test/markup/css/css_consistency.txt b/test/markup/css/css_consistency.txt index 1f2354ba28..fdf6529313 100644 --- a/test/markup/css/css_consistency.txt +++ b/test/markup/css/css_consistency.txt @@ -22,7 +22,9 @@ h1, h2, figcaption, aside, main, form, footer {} a:visited { color: blue; } div::after { content: "test"; } +div:after { content: "test"; } div::before { content: open-quote; } +div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} diff --git a/test/markup/css/url.expect.txt b/test/markup/css/url.expect.txt index 2e50d0c5ac..94c9e7e364 100644 --- a/test/markup/css/url.expect.txt +++ b/test/markup/css/url.expect.txt @@ -3,4 +3,7 @@ div { background: url(foo/bar/baz.jpg) } div { background-image: url(data:image/png;base64,TWFuIGlzIGRpc3=) } div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") } -div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } \ No newline at end of file +div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } + +// https://github.com/highlightjs/highlight.js/issues/3514 +div { --custom-background-image-1: url('/appearance/themes/Dark+/image/background (01).jpg'); } diff --git a/test/markup/css/url.txt b/test/markup/css/url.txt index 7a91d04741..d55e36a73a 100644 --- a/test/markup/css/url.txt +++ b/test/markup/css/url.txt @@ -3,4 +3,7 @@ div { background: url('foo/bar/baz.jpg') } div { background: url(foo/bar/baz.jpg) } div { background-image: url(data:image/png;base64,TWFuIGlzIGRpc3=) } div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") } -div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } \ No newline at end of file +div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } + +// https://github.com/highlightjs/highlight.js/issues/3514 +div { --custom-background-image-1: url('/appearance/themes/Dark+/image/background (01).jpg'); } diff --git a/test/markup/less/css_consistency.expect.txt b/test/markup/less/css_consistency.expect.txt index 7d2646167a..93690630c5 100644 --- a/test/markup/less/css_consistency.expect.txt +++ b/test/markup/less/css_consistency.expect.txt @@ -68,7 +68,7 @@ main { --color: red; - color: var(--color); + color: var(--color); } main { diff --git a/test/markup/scss/css_consistency.expect.txt b/test/markup/scss/css_consistency.expect.txt index fa8feaa41c..ccbab101d1 100644 --- a/test/markup/scss/css_consistency.expect.txt +++ b/test/markup/scss/css_consistency.expect.txt @@ -68,7 +68,7 @@ main { --color: red; - color: var(--color); + color: var(--color); } main { diff --git a/test/markup/scss/default.expect.txt b/test/markup/scss/default.expect.txt index 19e5443bff..e3a42a142f 100644 --- a/test/markup/scss/default.expect.txt +++ b/test/markup/scss/default.expect.txt @@ -2,7 +2,7 @@ // variables $colorGreen: #008000; -$colorGreenDark: darken($colorGreen, 10); +$colorGreenDark: darken($colorGreen, 10); @mixin container { max-width: 980px; @@ -45,7 +45,7 @@ li { float: left; margin-right: 10px; .home { - background: url('http://placehold.it/20') scroll no-repeat 0 0; + background: url('http://placehold.it/20') scroll no-repeat 0 0; } } } diff --git a/test/markup/stylus/css_consistency.expect.txt b/test/markup/stylus/css_consistency.expect.txt index fa8feaa41c..ccbab101d1 100644 --- a/test/markup/stylus/css_consistency.expect.txt +++ b/test/markup/stylus/css_consistency.expect.txt @@ -68,7 +68,7 @@ main { --color: red; - color: var(--color); + color: var(--color); } main { diff --git a/test/markup/stylus/default.expect.txt b/test/markup/stylus/default.expect.txt index 5816eb2ada..3a51ca91fd 100644 --- a/test/markup/stylus/default.expect.txt +++ b/test/markup/stylus/default.expect.txt @@ -23,6 +23,6 @@ #content, .content font Tahoma, Chunkfive, sans-serif - background url('hatch.png') + background url('hatch.png') color #F0F0F0 !important width 100% From 6fc781508b025ed6f2d612db91fe5c1280d10102 Mon Sep 17 00:00:00 2001 From: Bluecoreg <36262058+Bluecoreg@users.noreply.github.com> Date: Mon, 11 Jul 2022 07:32:56 -0400 Subject: [PATCH 195/227] enh(gml) reorganized and added additional keywords (#3577) * Re-order existing lists * Add new keywords --- CHANGES.md | 2 + src/languages/gml.js | 5225 +++++++++++++++++++++--------------------- 2 files changed, 2620 insertions(+), 2607 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5b727e447a..90fd437c5e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- enh(gml) reorganized and added additional keywords [Bluecoreg][] - enh(csharp) Added support for the new `scoped` keyword in C# (#3571) [David Pine][] - enh(scala) add `transparent` keyword [Matt Bovel][] - fix(rust) highlight types immediately preceeding `::` (#3540) [Josh Goebel][] @@ -16,6 +17,7 @@ Grammars: - Added 3rd party Oak grammar to SUPPORTED_LANGUAGES [Tim Smith][] - enh(python) add `match` and `case` keywords [Avrumy Lunger][] +[Bluecoreg]: https://github.com/Bluecoreg [Matt Bovel]: https://github.com/mbovel [David Schach]: https://github.com/dschach [Serial-ATA]: https://github.com/Serial-ATA diff --git a/src/languages/gml.js b/src/languages/gml.js index 444b3a04b5..7f17055dd0 100644 --- a/src/languages/gml.js +++ b/src/languages/gml.js @@ -8,2081 +8,2013 @@ Category: scripting export default function(hljs) { const KEYWORDS = [ + "#endregion", + "#macro", + "#region", + "and", "begin", - "end", - "if", - "then", - "else", - "while", - "do", - "for", "break", + "case", + "constructor", "continue", - "with", - "until", - "repeat", + "default", + "delete", + "div", + "do", + "else", + "end", + "enum", "exit", - "and", - "or", - "xor", + "for", + "function", + "globalvar", + "if", + "mod", "not", + "or", + "repeat", "return", - "mod", - "div", "switch", - "case", - "default", + "then", + "until", "var", - "globalvar", - "enum", - "function", - "constructor", - "delete", - "#macro", - "#region", - "#endregion" + "while", + "with", + "xor" ]; const BUILT_INS = [ - "is_real", - "is_string", - "is_array", - "is_undefined", - "is_int32", - "is_int64", - "is_ptr", - "is_vec3", - "is_vec4", - "is_matrix", - "is_bool", - "is_method", - "is_struct", - "is_infinity", - "is_nan", - "is_numeric", - "typeof", - "variable_global_exists", - "variable_global_get", - "variable_global_set", - "variable_instance_exists", - "variable_instance_get", - "variable_instance_set", - "variable_instance_get_names", - "variable_struct_exists", - "variable_struct_get", - "variable_struct_get_names", - "variable_struct_names_count", - "variable_struct_remove", - "variable_struct_set", + "abs", + "achievement_available", + "achievement_event", + "achievement_get_challenges", + "achievement_get_info", + "achievement_get_pic", + "achievement_increment", + "achievement_load_friends", + "achievement_load_leaderboard", + "achievement_load_progress", + "achievement_login", + "achievement_login_status", + "achievement_logout", + "achievement_post", + "achievement_post_score", + "achievement_reset", + "achievement_send_challenge", + "achievement_show", + "achievement_show_achievements", + "achievement_show_challenge_notifications", + "achievement_show_leaderboards", + "action_inherited", + "action_kill_object", + "ads_disable", + "ads_enable", + "ads_engagement_active", + "ads_engagement_available", + "ads_engagement_launch", + "ads_event", + "ads_event_preload", + "ads_get_display_height", + "ads_get_display_width", + "ads_interstitial_available", + "ads_interstitial_display", + "ads_move", + "ads_set_reward_callback", + "ads_setup", + "alarm_get", + "alarm_set", + "analytics_event", + "analytics_event_ext", + "angle_difference", + "ansi_char", + "application_get_position", + "application_surface_draw_enable", + "application_surface_enable", + "application_surface_is_enabled", + "arccos", + "arcsin", + "arctan", + "arctan2", + "array_copy", + "array_create", "array_delete", + "array_equals", + "array_height_2d", "array_insert", "array_length", "array_length_1d", "array_length_2d", - "array_height_2d", - "array_equals", - "array_create", - "array_copy", "array_pop", "array_push", "array_resize", "array_sort", - "random", - "random_range", - "irandom", - "irandom_range", - "random_set_seed", - "random_get_seed", - "randomize", - "randomise", - "choose", - "abs", - "round", - "floor", - "ceil", - "sign", - "frac", - "sqrt", - "sqr", - "exp", - "ln", - "log2", - "log10", - "sin", - "cos", - "tan", - "arcsin", - "arccos", - "arctan", - "arctan2", - "dsin", - "dcos", - "dtan", - "darcsin", - "darccos", - "darctan", - "darctan2", - "degtorad", - "radtodeg", - "power", - "logn", - "min", - "max", - "mean", - "median", - "clamp", - "lerp", - "dot_product", - "dot_product_3d", - "dot_product_normalised", - "dot_product_3d_normalised", - "dot_product_normalized", - "dot_product_3d_normalized", - "math_set_epsilon", - "math_get_epsilon", - "angle_difference", - "point_distance_3d", - "point_distance", - "point_direction", - "lengthdir_x", - "lengthdir_y", - "real", - "string", - "int64", - "ptr", - "string_format", - "chr", - "ansi_char", - "ord", - "string_length", - "string_byte_length", - "string_pos", - "string_copy", - "string_char_at", - "string_ord_at", - "string_byte_at", - "string_set_byte_at", - "string_delete", - "string_insert", - "string_lower", - "string_upper", - "string_repeat", - "string_letters", - "string_digits", - "string_lettersdigits", - "string_replace", - "string_replace_all", - "string_count", - "string_hash_to_newline", - "clipboard_has_text", - "clipboard_set_text", - "clipboard_get_text", - "date_current_datetime", - "date_create_datetime", - "date_valid_datetime", - "date_inc_year", - "date_inc_month", - "date_inc_week", - "date_inc_day", - "date_inc_hour", - "date_inc_minute", - "date_inc_second", - "date_get_year", - "date_get_month", - "date_get_week", - "date_get_day", - "date_get_hour", - "date_get_minute", - "date_get_second", - "date_get_weekday", - "date_get_day_of_year", - "date_get_hour_of_year", - "date_get_minute_of_year", - "date_get_second_of_year", - "date_year_span", - "date_month_span", - "date_week_span", - "date_day_span", - "date_hour_span", - "date_minute_span", - "date_second_span", - "date_compare_datetime", - "date_compare_date", - "date_compare_time", - "date_date_of", - "date_time_of", - "date_datetime_string", - "date_date_string", - "date_time_string", - "date_days_in_month", - "date_days_in_year", - "date_leap_year", - "date_is_today", - "date_set_timezone", - "date_get_timezone", - "game_set_speed", - "game_get_speed", - "motion_set", - "motion_add", - "place_free", - "place_empty", - "place_meeting", - "place_snapped", - "move_random", - "move_snap", - "move_towards_point", - "move_contact_solid", - "move_contact_all", - "move_outside_solid", - "move_outside_all", - "move_bounce_solid", - "move_bounce_all", - "move_wrap", - "distance_to_point", - "distance_to_object", - "position_empty", - "position_meeting", - "path_start", - "path_end", - "mp_linear_step", - "mp_potential_step", - "mp_linear_step_object", - "mp_potential_step_object", - "mp_potential_settings", - "mp_linear_path", - "mp_potential_path", - "mp_linear_path_object", - "mp_potential_path_object", - "mp_grid_create", - "mp_grid_destroy", - "mp_grid_clear_all", - "mp_grid_clear_cell", - "mp_grid_clear_rectangle", - "mp_grid_add_cell", - "mp_grid_get_cell", - "mp_grid_add_rectangle", - "mp_grid_add_instances", - "mp_grid_path", - "mp_grid_draw", - "mp_grid_to_ds_grid", - "collision_point", - "collision_rectangle", + "asset_get_index", + "asset_get_type", + "audio_channel_num", + "audio_create_buffer_sound", + "audio_create_play_queue", + "audio_create_stream", + "audio_create_sync_group", + "audio_debug", + "audio_destroy_stream", + "audio_destroy_sync_group", + "audio_emitter_create", + "audio_emitter_exists", + "audio_emitter_falloff", + "audio_emitter_free", + "audio_emitter_gain", + "audio_emitter_get_gain", + "audio_emitter_get_listener_mask", + "audio_emitter_get_pitch", + "audio_emitter_get_vx", + "audio_emitter_get_vy", + "audio_emitter_get_vz", + "audio_emitter_get_x", + "audio_emitter_get_y", + "audio_emitter_get_z", + "audio_emitter_pitch", + "audio_emitter_position", + "audio_emitter_set_listener_mask", + "audio_emitter_velocity", + "audio_exists", + "audio_falloff_set_model", + "audio_free_buffer_sound", + "audio_free_play_queue", + "audio_get_listener_count", + "audio_get_listener_info", + "audio_get_listener_mask", + "audio_get_master_gain", + "audio_get_name", + "audio_get_recorder_count", + "audio_get_recorder_info", + "audio_get_type", + "audio_group_is_loaded", + "audio_group_load", + "audio_group_load_progress", + "audio_group_name", + "audio_group_set_gain", + "audio_group_stop_all", + "audio_group_unload", + "audio_is_paused", + "audio_is_playing", + "audio_listener_get_data", + "audio_listener_orientation", + "audio_listener_position", + "audio_listener_set_orientation", + "audio_listener_set_position", + "audio_listener_set_velocity", + "audio_listener_velocity", + "audio_master_gain", + "audio_music_gain", + "audio_music_is_playing", + "audio_pause_all", + "audio_pause_music", + "audio_pause_sound", + "audio_pause_sync_group", + "audio_play_in_sync_group", + "audio_play_music", + "audio_play_sound", + "audio_play_sound_at", + "audio_play_sound_on", + "audio_queue_sound", + "audio_resume_all", + "audio_resume_music", + "audio_resume_sound", + "audio_resume_sync_group", + "audio_set_listener_mask", + "audio_set_master_gain", + "audio_sound_gain", + "audio_sound_get_gain", + "audio_sound_get_listener_mask", + "audio_sound_get_pitch", + "audio_sound_get_track_position", + "audio_sound_length", + "audio_sound_pitch", + "audio_sound_set_listener_mask", + "audio_sound_set_track_position", + "audio_start_recording", + "audio_start_sync_group", + "audio_stop_all", + "audio_stop_music", + "audio_stop_recording", + "audio_stop_sound", + "audio_stop_sync_group", + "audio_sync_group_debug", + "audio_sync_group_get_track_pos", + "audio_sync_group_is_playing", + "audio_system", + "background_get_height", + "background_get_width", + "base64_decode", + "base64_encode", + "browser_input_capture", + "buffer_async_group_begin", + "buffer_async_group_end", + "buffer_async_group_option", + "buffer_base64_decode", + "buffer_base64_decode_ext", + "buffer_base64_encode", + "buffer_copy", + "buffer_copy_from_vertex_buffer", + "buffer_create", + "buffer_create_from_vertex_buffer", + "buffer_create_from_vertex_buffer_ext", + "buffer_delete", + "buffer_exists", + "buffer_fill", + "buffer_get_address", + "buffer_get_alignment", + "buffer_get_size", + "buffer_get_surface", + "buffer_get_type", + "buffer_load", + "buffer_load_async", + "buffer_load_ext", + "buffer_load_partial", + "buffer_md5", + "buffer_peek", + "buffer_poke", + "buffer_read", + "buffer_resize", + "buffer_save", + "buffer_save_async", + "buffer_save_ext", + "buffer_seek", + "buffer_set_surface", + "buffer_sha1", + "buffer_sizeof", + "buffer_tell", + "buffer_write", + "camera_apply", + "camera_create", + "camera_create_view", + "camera_destroy", + "camera_get_active", + "camera_get_begin_script", + "camera_get_default", + "camera_get_end_script", + "camera_get_proj_mat", + "camera_get_update_script", + "camera_get_view_angle", + "camera_get_view_border_x", + "camera_get_view_border_y", + "camera_get_view_height", + "camera_get_view_mat", + "camera_get_view_speed_x", + "camera_get_view_speed_y", + "camera_get_view_target", + "camera_get_view_width", + "camera_get_view_x", + "camera_get_view_y", + "camera_set_begin_script", + "camera_set_default", + "camera_set_end_script", + "camera_set_proj_mat", + "camera_set_update_script", + "camera_set_view_angle", + "camera_set_view_border", + "camera_set_view_mat", + "camera_set_view_pos", + "camera_set_view_size", + "camera_set_view_speed", + "camera_set_view_target", + "ceil", + "choose", + "chr", + "clamp", + "clickable_add", + "clickable_add_ext", + "clickable_change", + "clickable_change_ext", + "clickable_delete", + "clickable_exists", + "clickable_set_style", + "clipboard_get_text", + "clipboard_has_text", + "clipboard_set_text", + "cloud_file_save", + "cloud_string_save", + "cloud_synchronise", + "code_is_compiled", "collision_circle", + "collision_circle_list", "collision_ellipse", + "collision_ellipse_list", "collision_line", + "collision_line_list", + "collision_point", "collision_point_list", + "collision_rectangle", "collision_rectangle_list", - "collision_circle_list", - "collision_ellipse_list", - "collision_line_list", - "instance_position_list", - "instance_place_list", - "point_in_rectangle", - "point_in_triangle", - "point_in_circle", - "rectangle_in_rectangle", - "rectangle_in_triangle", - "rectangle_in_circle", - "instance_find", - "instance_exists", - "instance_number", - "instance_position", - "instance_nearest", - "instance_furthest", - "instance_place", - "instance_create_depth", - "instance_create_layer", - "instance_copy", - "instance_change", - "instance_destroy", - "position_destroy", - "position_change", - "instance_id_get", - "instance_deactivate_all", - "instance_deactivate_object", - "instance_deactivate_region", - "instance_activate_all", - "instance_activate_object", - "instance_activate_region", - "room_goto", - "room_goto_previous", - "room_goto_next", - "room_previous", - "room_next", - "room_restart", - "game_end", - "game_restart", - "game_load", - "game_save", - "game_save_buffer", - "game_load_buffer", - "event_perform", - "event_user", - "event_perform_object", - "event_inherited", - "show_debug_message", - "show_debug_overlay", + "color_get_blue", + "color_get_green", + "color_get_hue", + "color_get_red", + "color_get_saturation", + "color_get_value", + "colour_get_blue", + "colour_get_green", + "colour_get_hue", + "colour_get_red", + "colour_get_saturation", + "colour_get_value", + "cos", + "darccos", + "darcsin", + "darctan", + "darctan2", + "date_compare_date", + "date_compare_datetime", + "date_compare_time", + "date_create_datetime", + "date_current_datetime", + "date_date_of", + "date_date_string", + "date_datetime_string", + "date_day_span", + "date_days_in_month", + "date_days_in_year", + "date_get_day", + "date_get_day_of_year", + "date_get_hour", + "date_get_hour_of_year", + "date_get_minute", + "date_get_minute_of_year", + "date_get_month", + "date_get_second", + "date_get_second_of_year", + "date_get_timezone", + "date_get_week", + "date_get_weekday", + "date_get_year", + "date_hour_span", + "date_inc_day", + "date_inc_hour", + "date_inc_minute", + "date_inc_month", + "date_inc_second", + "date_inc_week", + "date_inc_year", + "date_is_today", + "date_leap_year", + "date_minute_span", + "date_month_span", + "date_second_span", + "date_set_timezone", + "date_time_of", + "date_time_string", + "date_valid_datetime", + "date_week_span", + "date_year_span", + "dcos", "debug_event", "debug_get_callstack", - "alarm_get", - "alarm_set", - "font_texture_page_size", - "keyboard_set_map", - "keyboard_get_map", - "keyboard_unset_map", - "keyboard_check", - "keyboard_check_pressed", - "keyboard_check_released", - "keyboard_check_direct", - "keyboard_get_numlock", - "keyboard_set_numlock", - "keyboard_key_press", - "keyboard_key_release", - "keyboard_clear", - "io_clear", - "mouse_check_button", - "mouse_check_button_pressed", - "mouse_check_button_released", - "mouse_wheel_up", - "mouse_wheel_down", - "mouse_clear", - "draw_self", - "draw_sprite", - "draw_sprite_pos", - "draw_sprite_ext", - "draw_sprite_stretched", - "draw_sprite_stretched_ext", - "draw_sprite_tiled", - "draw_sprite_tiled_ext", - "draw_sprite_part", - "draw_sprite_part_ext", - "draw_sprite_general", + "degtorad", + "device_get_tilt_x", + "device_get_tilt_y", + "device_get_tilt_z", + "device_is_keypad_open", + "device_mouse_check_button", + "device_mouse_check_button_pressed", + "device_mouse_check_button_released", + "device_mouse_dbclick_enable", + "device_mouse_raw_x", + "device_mouse_raw_y", + "device_mouse_x", + "device_mouse_x_to_gui", + "device_mouse_y", + "device_mouse_y_to_gui", + "directory_create", + "directory_destroy", + "directory_exists", + "display_get_dpi_x", + "display_get_dpi_y", + "display_get_gui_height", + "display_get_gui_width", + "display_get_height", + "display_get_orientation", + "display_get_sleep_margin", + "display_get_timing_method", + "display_get_width", + "display_mouse_get_x", + "display_mouse_get_y", + "display_mouse_set", + "display_reset", + "display_set_gui_maximise", + "display_set_gui_maximize", + "display_set_gui_size", + "display_set_sleep_margin", + "display_set_timing_method", + "display_set_ui_visibility", + "distance_to_object", + "distance_to_point", + "dot_product", + "dot_product_3d", + "dot_product_3d_normalised", + "dot_product_3d_normalized", + "dot_product_normalised", + "dot_product_normalized", + "draw_arrow", + "draw_background", + "draw_background_ext", + "draw_background_part_ext", + "draw_background_tiled", + "draw_button", + "draw_circle", + "draw_circle_color", + "draw_circle_colour", "draw_clear", "draw_clear_alpha", - "draw_point", + "draw_ellipse", + "draw_ellipse_color", + "draw_ellipse_colour", + "draw_enable_alphablend", + "draw_enable_drawevent", + "draw_enable_swf_aa", + "draw_flush", + "draw_get_alpha", + "draw_get_color", + "draw_get_colour", + "draw_get_lighting", + "draw_get_swf_aa_level", + "draw_getpixel", + "draw_getpixel_ext", + "draw_healthbar", + "draw_highscore", + "draw_light_define_ambient", + "draw_light_define_direction", + "draw_light_define_point", + "draw_light_enable", + "draw_light_get", + "draw_light_get_ambient", "draw_line", + "draw_line_color", + "draw_line_colour", "draw_line_width", + "draw_line_width_color", + "draw_line_width_colour", + "draw_path", + "draw_point", + "draw_point_color", + "draw_point_colour", + "draw_primitive_begin", + "draw_primitive_begin_texture", + "draw_primitive_end", "draw_rectangle", + "draw_rectangle_color", + "draw_rectangle_colour", "draw_roundrect", + "draw_roundrect_color", + "draw_roundrect_color_ext", + "draw_roundrect_colour", + "draw_roundrect_colour_ext", "draw_roundrect_ext", - "draw_triangle", - "draw_circle", - "draw_ellipse", + "draw_self", + "draw_set_alpha", + "draw_set_alpha_test", + "draw_set_alpha_test_ref_value", + "draw_set_blend_mode", + "draw_set_blend_mode_ext", "draw_set_circle_precision", - "draw_arrow", - "draw_button", - "draw_path", - "draw_healthbar", - "draw_getpixel", - "draw_getpixel_ext", - "draw_set_colour", "draw_set_color", - "draw_set_alpha", - "draw_get_colour", - "draw_get_color", - "draw_get_alpha", - "merge_colour", - "make_colour_rgb", - "make_colour_hsv", - "colour_get_red", - "colour_get_green", - "colour_get_blue", - "colour_get_hue", - "colour_get_saturation", - "colour_get_value", - "merge_color", - "make_color_rgb", - "make_color_hsv", - "color_get_red", - "color_get_green", - "color_get_blue", - "color_get_hue", - "color_get_saturation", - "color_get_value", - "merge_color", - "screen_save", - "screen_save_part", + "draw_set_color_write_enable", + "draw_set_colour", "draw_set_font", "draw_set_halign", + "draw_set_lighting", + "draw_set_swf_aa_level", "draw_set_valign", + "draw_skeleton", + "draw_skeleton_collision", + "draw_skeleton_instance", + "draw_skeleton_time", + "draw_sprite", + "draw_sprite_ext", + "draw_sprite_general", + "draw_sprite_part", + "draw_sprite_part_ext", + "draw_sprite_pos", + "draw_sprite_stretched", + "draw_sprite_stretched_ext", + "draw_sprite_tiled", + "draw_sprite_tiled_ext", + "draw_surface", + "draw_surface_ext", + "draw_surface_general", + "draw_surface_part", + "draw_surface_part_ext", + "draw_surface_stretched", + "draw_surface_stretched_ext", + "draw_surface_tiled", + "draw_surface_tiled_ext", "draw_text", - "draw_text_ext", - "string_width", - "string_height", - "string_width_ext", - "string_height_ext", - "draw_text_transformed", - "draw_text_ext_transformed", + "draw_text_color", "draw_text_colour", + "draw_text_ext", + "draw_text_ext_color", "draw_text_ext_colour", - "draw_text_transformed_colour", + "draw_text_ext_transformed", + "draw_text_ext_transformed_color", "draw_text_ext_transformed_colour", - "draw_text_color", - "draw_text_ext_color", + "draw_text_transformed", "draw_text_transformed_color", - "draw_text_ext_transformed_color", - "draw_point_colour", - "draw_line_colour", - "draw_line_width_colour", - "draw_rectangle_colour", - "draw_roundrect_colour", - "draw_roundrect_colour_ext", - "draw_triangle_colour", - "draw_circle_colour", - "draw_ellipse_colour", - "draw_point_color", - "draw_line_color", - "draw_line_width_color", - "draw_rectangle_color", - "draw_roundrect_color", - "draw_roundrect_color_ext", + "draw_text_transformed_colour", + "draw_texture_flush", + "draw_tile", + "draw_tilemap", + "draw_triangle", "draw_triangle_color", - "draw_circle_color", - "draw_ellipse_color", - "draw_primitive_begin", + "draw_triangle_colour", "draw_vertex", - "draw_vertex_colour", "draw_vertex_color", - "draw_primitive_end", - "sprite_get_uvs", - "font_get_uvs", - "sprite_get_texture", - "font_get_texture", - "texture_get_width", - "texture_get_height", - "texture_get_uvs", - "draw_primitive_begin_texture", + "draw_vertex_colour", "draw_vertex_texture", - "draw_vertex_texture_colour", "draw_vertex_texture_color", - "texture_global_scale", - "surface_create", - "surface_create_ext", - "surface_resize", - "surface_free", - "surface_exists", - "surface_get_width", - "surface_get_height", - "surface_get_texture", - "surface_set_target", - "surface_set_target_ext", - "surface_reset_target", - "surface_depth_disable", - "surface_get_depth_disable", - "draw_surface", - "draw_surface_stretched", - "draw_surface_tiled", - "draw_surface_part", - "draw_surface_ext", - "draw_surface_stretched_ext", - "draw_surface_tiled_ext", - "draw_surface_part_ext", - "draw_surface_general", - "surface_getpixel", - "surface_getpixel_ext", - "surface_save", - "surface_save_part", - "surface_copy", - "surface_copy_part", - "application_surface_draw_enable", - "application_get_position", - "application_surface_enable", - "application_surface_is_enabled", - "display_get_width", - "display_get_height", - "display_get_orientation", - "display_get_gui_width", - "display_get_gui_height", - "display_reset", - "display_mouse_get_x", - "display_mouse_get_y", - "display_mouse_set", - "display_set_ui_visibility", - "window_set_fullscreen", - "window_get_fullscreen", - "window_set_caption", - "window_set_min_width", - "window_set_max_width", - "window_set_min_height", - "window_set_max_height", - "window_get_visible_rects", - "window_get_caption", - "window_set_cursor", - "window_get_cursor", - "window_set_colour", - "window_get_colour", - "window_set_color", - "window_get_color", - "window_set_position", - "window_set_size", - "window_set_rectangle", - "window_center", - "window_get_x", - "window_get_y", - "window_get_width", - "window_get_height", - "window_mouse_get_x", - "window_mouse_get_y", - "window_mouse_set", - "window_view_mouse_get_x", - "window_view_mouse_get_y", - "window_views_mouse_get_x", - "window_views_mouse_get_y", - "audio_listener_position", - "audio_listener_velocity", - "audio_listener_orientation", - "audio_emitter_position", - "audio_emitter_create", - "audio_emitter_free", - "audio_emitter_exists", - "audio_emitter_pitch", - "audio_emitter_velocity", - "audio_emitter_falloff", - "audio_emitter_gain", - "audio_play_sound", - "audio_play_sound_on", - "audio_play_sound_at", - "audio_stop_sound", - "audio_resume_music", - "audio_music_is_playing", - "audio_resume_sound", - "audio_pause_sound", - "audio_pause_music", - "audio_channel_num", - "audio_sound_length", - "audio_get_type", - "audio_falloff_set_model", - "audio_play_music", - "audio_stop_music", - "audio_master_gain", - "audio_music_gain", - "audio_sound_gain", - "audio_sound_pitch", - "audio_stop_all", - "audio_resume_all", - "audio_pause_all", - "audio_is_playing", - "audio_is_paused", - "audio_exists", - "audio_sound_set_track_position", - "audio_sound_get_track_position", - "audio_emitter_get_gain", - "audio_emitter_get_pitch", - "audio_emitter_get_x", - "audio_emitter_get_y", - "audio_emitter_get_z", - "audio_emitter_get_vx", - "audio_emitter_get_vy", - "audio_emitter_get_vz", - "audio_listener_set_position", - "audio_listener_set_velocity", - "audio_listener_set_orientation", - "audio_listener_get_data", - "audio_set_master_gain", - "audio_get_master_gain", - "audio_sound_get_gain", - "audio_sound_get_pitch", - "audio_get_name", - "audio_sound_set_track_position", - "audio_sound_get_track_position", - "audio_create_stream", - "audio_destroy_stream", - "audio_create_sync_group", - "audio_destroy_sync_group", - "audio_play_in_sync_group", - "audio_start_sync_group", - "audio_stop_sync_group", - "audio_pause_sync_group", - "audio_resume_sync_group", - "audio_sync_group_get_track_pos", - "audio_sync_group_debug", - "audio_sync_group_is_playing", - "audio_debug", - "audio_group_load", - "audio_group_unload", - "audio_group_is_loaded", - "audio_group_load_progress", - "audio_group_name", - "audio_group_stop_all", - "audio_group_set_gain", - "audio_create_buffer_sound", - "audio_free_buffer_sound", - "audio_create_play_queue", - "audio_free_play_queue", - "audio_queue_sound", - "audio_get_recorder_count", - "audio_get_recorder_info", - "audio_start_recording", - "audio_stop_recording", - "audio_sound_get_listener_mask", - "audio_emitter_get_listener_mask", - "audio_get_listener_mask", - "audio_sound_set_listener_mask", - "audio_emitter_set_listener_mask", - "audio_set_listener_mask", - "audio_get_listener_count", - "audio_get_listener_info", - "audio_system", - "show_message", - "show_message_async", - "clickable_add", - "clickable_add_ext", - "clickable_change", - "clickable_change_ext", - "clickable_delete", - "clickable_exists", - "clickable_set_style", - "show_question", - "show_question_async", - "get_integer", - "get_string", - "get_integer_async", - "get_string_async", - "get_login_async", - "get_open_filename", - "get_save_filename", - "get_open_filename_ext", - "get_save_filename_ext", - "show_error", - "highscore_clear", - "highscore_add", - "highscore_value", - "highscore_name", - "draw_highscore", - "sprite_exists", - "sprite_get_name", - "sprite_get_number", - "sprite_get_width", - "sprite_get_height", - "sprite_get_xoffset", - "sprite_get_yoffset", - "sprite_get_bbox_left", - "sprite_get_bbox_right", - "sprite_get_bbox_top", - "sprite_get_bbox_bottom", - "sprite_save", - "sprite_save_strip", - "sprite_set_cache_size", - "sprite_set_cache_size_ext", - "sprite_get_tpe", - "sprite_prefetch", - "sprite_prefetch_multi", - "sprite_flush", - "sprite_flush_multi", - "sprite_set_speed", - "sprite_get_speed_type", - "sprite_get_speed", + "draw_vertex_texture_colour", + "ds_exists", + "ds_grid_add", + "ds_grid_add_disk", + "ds_grid_add_grid_region", + "ds_grid_add_region", + "ds_grid_clear", + "ds_grid_copy", + "ds_grid_create", + "ds_grid_destroy", + "ds_grid_get", + "ds_grid_get_disk_max", + "ds_grid_get_disk_mean", + "ds_grid_get_disk_min", + "ds_grid_get_disk_sum", + "ds_grid_get_max", + "ds_grid_get_mean", + "ds_grid_get_min", + "ds_grid_get_sum", + "ds_grid_height", + "ds_grid_multiply", + "ds_grid_multiply_disk", + "ds_grid_multiply_grid_region", + "ds_grid_multiply_region", + "ds_grid_read", + "ds_grid_resize", + "ds_grid_set", + "ds_grid_set_disk", + "ds_grid_set_grid_region", + "ds_grid_set_region", + "ds_grid_shuffle", + "ds_grid_sort", + "ds_grid_value_disk_exists", + "ds_grid_value_disk_x", + "ds_grid_value_disk_y", + "ds_grid_value_exists", + "ds_grid_value_x", + "ds_grid_value_y", + "ds_grid_width", + "ds_grid_write", + "ds_list_add", + "ds_list_clear", + "ds_list_copy", + "ds_list_create", + "ds_list_delete", + "ds_list_destroy", + "ds_list_empty", + "ds_list_find_index", + "ds_list_find_value", + "ds_list_insert", + "ds_list_mark_as_list", + "ds_list_mark_as_map", + "ds_list_read", + "ds_list_replace", + "ds_list_set", + "ds_list_shuffle", + "ds_list_size", + "ds_list_sort", + "ds_list_write", + "ds_map_add", + "ds_map_add_list", + "ds_map_add_map", + "ds_map_clear", + "ds_map_copy", + "ds_map_create", + "ds_map_delete", + "ds_map_destroy", + "ds_map_empty", + "ds_map_exists", + "ds_map_find_first", + "ds_map_find_last", + "ds_map_find_next", + "ds_map_find_previous", + "ds_map_find_value", + "ds_map_read", + "ds_map_replace", + "ds_map_replace_list", + "ds_map_replace_map", + "ds_map_secure_load", + "ds_map_secure_load_buffer", + "ds_map_secure_save", + "ds_map_secure_save_buffer", + "ds_map_set", + "ds_map_size", + "ds_map_write", + "ds_priority_add", + "ds_priority_change_priority", + "ds_priority_clear", + "ds_priority_copy", + "ds_priority_create", + "ds_priority_delete_max", + "ds_priority_delete_min", + "ds_priority_delete_value", + "ds_priority_destroy", + "ds_priority_empty", + "ds_priority_find_max", + "ds_priority_find_min", + "ds_priority_find_priority", + "ds_priority_read", + "ds_priority_size", + "ds_priority_write", + "ds_queue_clear", + "ds_queue_copy", + "ds_queue_create", + "ds_queue_dequeue", + "ds_queue_destroy", + "ds_queue_empty", + "ds_queue_enqueue", + "ds_queue_head", + "ds_queue_read", + "ds_queue_size", + "ds_queue_tail", + "ds_queue_write", + "ds_set_precision", + "ds_stack_clear", + "ds_stack_copy", + "ds_stack_create", + "ds_stack_destroy", + "ds_stack_empty", + "ds_stack_pop", + "ds_stack_push", + "ds_stack_read", + "ds_stack_size", + "ds_stack_top", + "ds_stack_write", + "dsin", + "dtan", + "effect_clear", + "effect_create_above", + "effect_create_below", + "environment_get_variable", + "event_inherited", + "event_perform", + "event_perform_object", + "event_user", + "exp", + "external_call", + "external_define", + "external_free", + "facebook_accesstoken", + "facebook_check_permission", + "facebook_dialog", + "facebook_graph_request", + "facebook_init", + "facebook_launch_offerwall", + "facebook_login", + "facebook_logout", + "facebook_post_message", + "facebook_request_publish_permissions", + "facebook_request_read_permissions", + "facebook_send_invite", + "facebook_status", + "facebook_user_id", + "file_attributes", + "file_bin_close", + "file_bin_open", + "file_bin_position", + "file_bin_read_byte", + "file_bin_rewrite", + "file_bin_seek", + "file_bin_size", + "file_bin_write_byte", + "file_copy", + "file_delete", + "file_exists", + "file_find_close", + "file_find_first", + "file_find_next", + "file_rename", + "file_text_close", + "file_text_eof", + "file_text_eoln", + "file_text_open_append", + "file_text_open_from_string", + "file_text_open_read", + "file_text_open_write", + "file_text_read_real", + "file_text_read_string", + "file_text_readln", + "file_text_write_real", + "file_text_write_string", + "file_text_writeln", + "filename_change_ext", + "filename_dir", + "filename_drive", + "filename_ext", + "filename_name", + "filename_path", + "floor", + "font_add", + "font_add_enable_aa", + "font_add_get_enable_aa", + "font_add_sprite", + "font_add_sprite_ext", + "font_delete", "font_exists", - "font_get_name", - "font_get_fontname", "font_get_bold", - "font_get_italic", "font_get_first", + "font_get_fontname", + "font_get_italic", "font_get_last", + "font_get_name", "font_get_size", + "font_get_texture", + "font_get_uvs", + "font_replace", + "font_replace_sprite", + "font_replace_sprite_ext", "font_set_cache_size", - "path_exists", - "path_get_name", - "path_get_length", - "path_get_time", - "path_get_kind", - "path_get_closed", - "path_get_precision", - "path_get_number", - "path_get_point_x", - "path_get_point_y", - "path_get_point_speed", - "path_get_x", - "path_get_y", - "path_get_speed", - "script_exists", - "script_get_name", - "timeline_add", - "timeline_delete", - "timeline_clear", - "timeline_exists", - "timeline_get_name", - "timeline_moment_clear", - "timeline_moment_add_script", - "timeline_size", - "timeline_max_moment", - "object_exists", - "object_get_name", - "object_get_sprite", - "object_get_solid", - "object_get_visible", - "object_get_persistent", - "object_get_mask", - "object_get_parent", - "object_get_physics", - "object_is_ancestor", - "room_exists", - "room_get_name", - "sprite_set_offset", - "sprite_duplicate", - "sprite_assign", - "sprite_merge", - "sprite_add", - "sprite_replace", - "sprite_create_from_surface", - "sprite_add_from_surface", - "sprite_delete", - "sprite_set_alpha_from_sprite", - "sprite_collision_mask", - "font_add_enable_aa", - "font_add_get_enable_aa", - "font_add", - "font_add_sprite", - "font_add_sprite_ext", - "font_replace", - "font_replace_sprite", - "font_replace_sprite_ext", - "font_delete", - "path_set_kind", - "path_set_closed", - "path_set_precision", - "path_add", - "path_assign", - "path_duplicate", - "path_append", - "path_delete", - "path_add_point", - "path_insert_point", - "path_change_point", - "path_delete_point", - "path_clear_points", - "path_reverse", - "path_mirror", - "path_flip", - "path_rotate", - "path_rescale", - "path_shift", - "script_execute", - "object_set_sprite", - "object_set_solid", - "object_set_visible", - "object_set_persistent", - "object_set_mask", - "room_set_width", - "room_set_height", - "room_set_persistent", - "room_set_background_colour", - "room_set_background_color", - "room_set_view", - "room_set_viewport", - "room_get_viewport", - "room_set_view_enabled", - "room_add", - "room_duplicate", - "room_assign", - "room_instance_add", - "room_instance_clear", - "room_get_camera", - "room_set_camera", - "asset_get_index", - "asset_get_type", - "file_text_open_from_string", - "file_text_open_read", - "file_text_open_write", - "file_text_open_append", - "file_text_close", - "file_text_write_string", - "file_text_write_real", - "file_text_writeln", - "file_text_read_string", - "file_text_read_real", - "file_text_readln", - "file_text_eof", - "file_text_eoln", - "file_exists", - "file_delete", - "file_rename", - "file_copy", - "directory_exists", - "directory_create", - "directory_destroy", - "file_find_first", - "file_find_next", - "file_find_close", - "file_attributes", - "filename_name", - "filename_path", - "filename_dir", - "filename_drive", - "filename_ext", - "filename_change_ext", - "file_bin_open", - "file_bin_rewrite", - "file_bin_close", - "file_bin_position", - "file_bin_size", - "file_bin_seek", - "file_bin_write_byte", - "file_bin_read_byte", - "parameter_count", - "parameter_string", - "environment_get_variable", - "ini_open_from_string", - "ini_open", - "ini_close", - "ini_read_string", - "ini_read_real", - "ini_write_string", - "ini_write_real", - "ini_key_exists", - "ini_section_exists", - "ini_key_delete", - "ini_section_delete", - "ds_set_precision", - "ds_exists", - "ds_stack_create", - "ds_stack_destroy", - "ds_stack_clear", - "ds_stack_copy", - "ds_stack_size", - "ds_stack_empty", - "ds_stack_push", - "ds_stack_pop", - "ds_stack_top", - "ds_stack_write", - "ds_stack_read", - "ds_queue_create", - "ds_queue_destroy", - "ds_queue_clear", - "ds_queue_copy", - "ds_queue_size", - "ds_queue_empty", - "ds_queue_enqueue", - "ds_queue_dequeue", - "ds_queue_head", - "ds_queue_tail", - "ds_queue_write", - "ds_queue_read", - "ds_list_create", - "ds_list_destroy", - "ds_list_clear", - "ds_list_copy", - "ds_list_size", - "ds_list_empty", - "ds_list_add", - "ds_list_insert", - "ds_list_replace", - "ds_list_delete", - "ds_list_find_index", - "ds_list_find_value", - "ds_list_mark_as_list", - "ds_list_mark_as_map", - "ds_list_sort", - "ds_list_shuffle", - "ds_list_write", - "ds_list_read", - "ds_list_set", - "ds_map_create", - "ds_map_destroy", - "ds_map_clear", - "ds_map_copy", - "ds_map_size", - "ds_map_empty", - "ds_map_add", - "ds_map_add_list", - "ds_map_add_map", - "ds_map_replace", - "ds_map_replace_map", - "ds_map_replace_list", - "ds_map_delete", - "ds_map_exists", - "ds_map_find_value", - "ds_map_find_previous", - "ds_map_find_next", - "ds_map_find_first", - "ds_map_find_last", - "ds_map_write", - "ds_map_read", - "ds_map_secure_save", - "ds_map_secure_load", - "ds_map_secure_load_buffer", - "ds_map_secure_save_buffer", - "ds_map_set", - "ds_priority_create", - "ds_priority_destroy", - "ds_priority_clear", - "ds_priority_copy", - "ds_priority_size", - "ds_priority_empty", - "ds_priority_add", - "ds_priority_change_priority", - "ds_priority_find_priority", - "ds_priority_delete_value", - "ds_priority_delete_min", - "ds_priority_find_min", - "ds_priority_delete_max", - "ds_priority_find_max", - "ds_priority_write", - "ds_priority_read", - "ds_grid_create", - "ds_grid_destroy", - "ds_grid_copy", - "ds_grid_resize", - "ds_grid_width", - "ds_grid_height", - "ds_grid_clear", - "ds_grid_set", - "ds_grid_add", - "ds_grid_multiply", - "ds_grid_set_region", - "ds_grid_add_region", - "ds_grid_multiply_region", - "ds_grid_set_disk", - "ds_grid_add_disk", - "ds_grid_multiply_disk", - "ds_grid_set_grid_region", - "ds_grid_add_grid_region", - "ds_grid_multiply_grid_region", - "ds_grid_get", - "ds_grid_get_sum", - "ds_grid_get_max", - "ds_grid_get_min", - "ds_grid_get_mean", - "ds_grid_get_disk_sum", - "ds_grid_get_disk_min", - "ds_grid_get_disk_max", - "ds_grid_get_disk_mean", - "ds_grid_value_exists", - "ds_grid_value_x", - "ds_grid_value_y", - "ds_grid_value_disk_exists", - "ds_grid_value_disk_x", - "ds_grid_value_disk_y", - "ds_grid_shuffle", - "ds_grid_write", - "ds_grid_read", - "ds_grid_sort", - "ds_grid_set", - "ds_grid_get", - "effect_create_below", - "effect_create_above", - "effect_clear", - "part_type_create", - "part_type_destroy", - "part_type_exists", - "part_type_clear", - "part_type_shape", - "part_type_sprite", - "part_type_size", - "part_type_scale", - "part_type_orientation", - "part_type_life", - "part_type_step", - "part_type_death", - "part_type_speed", - "part_type_direction", - "part_type_gravity", - "part_type_colour1", - "part_type_colour2", - "part_type_colour3", - "part_type_colour_mix", - "part_type_colour_rgb", - "part_type_colour_hsv", - "part_type_color1", - "part_type_color2", - "part_type_color3", - "part_type_color_mix", - "part_type_color_rgb", - "part_type_color_hsv", - "part_type_alpha1", - "part_type_alpha2", - "part_type_alpha3", - "part_type_blend", - "part_system_create", - "part_system_create_layer", - "part_system_destroy", - "part_system_exists", - "part_system_clear", - "part_system_draw_order", - "part_system_depth", - "part_system_position", - "part_system_automatic_update", - "part_system_automatic_draw", - "part_system_update", - "part_system_drawit", - "part_system_get_layer", - "part_system_layer", - "part_particles_create", - "part_particles_create_colour", - "part_particles_create_color", - "part_particles_clear", - "part_particles_count", - "part_emitter_create", - "part_emitter_destroy", - "part_emitter_destroy_all", - "part_emitter_exists", - "part_emitter_clear", - "part_emitter_region", - "part_emitter_burst", - "part_emitter_stream", - "external_call", - "external_define", - "external_free", - "window_handle", - "window_device", - "matrix_get", - "matrix_set", - "matrix_build_identity", - "matrix_build", - "matrix_build_lookat", - "matrix_build_projection_ortho", - "matrix_build_projection_perspective", - "matrix_build_projection_perspective_fov", - "matrix_multiply", - "matrix_transform_vertex", - "matrix_stack_push", - "matrix_stack_pop", - "matrix_stack_multiply", - "matrix_stack_set", - "matrix_stack_clear", - "matrix_stack_top", - "matrix_stack_is_empty", - "browser_input_capture", - "os_get_config", - "os_get_info", - "os_get_language", - "os_get_region", - "os_lock_orientation", - "display_get_dpi_x", - "display_get_dpi_y", - "display_set_gui_size", - "display_set_gui_maximise", - "display_set_gui_maximize", - "device_mouse_dbclick_enable", - "display_set_timing_method", - "display_get_timing_method", - "display_set_sleep_margin", - "display_get_sleep_margin", - "virtual_key_add", - "virtual_key_hide", - "virtual_key_delete", - "virtual_key_show", - "draw_enable_drawevent", - "draw_enable_swf_aa", - "draw_set_swf_aa_level", - "draw_get_swf_aa_level", - "draw_texture_flush", - "draw_flush", - "gpu_set_blendenable", - "gpu_set_ztestenable", - "gpu_set_zfunc", - "gpu_set_zwriteenable", - "gpu_set_lightingenable", - "gpu_set_fog", - "gpu_set_cullmode", - "gpu_set_blendmode", - "gpu_set_blendmode_ext", - "gpu_set_blendmode_ext_sepalpha", - "gpu_set_colorwriteenable", - "gpu_set_colourwriteenable", - "gpu_set_alphatestenable", - "gpu_set_alphatestref", - "gpu_set_alphatestfunc", - "gpu_set_texfilter", - "gpu_set_texfilter_ext", - "gpu_set_texrepeat", - "gpu_set_texrepeat_ext", - "gpu_set_tex_filter", - "gpu_set_tex_filter_ext", - "gpu_set_tex_repeat", - "gpu_set_tex_repeat_ext", - "gpu_set_tex_mip_filter", - "gpu_set_tex_mip_filter_ext", - "gpu_set_tex_mip_bias", - "gpu_set_tex_mip_bias_ext", - "gpu_set_tex_min_mip", - "gpu_set_tex_min_mip_ext", - "gpu_set_tex_max_mip", - "gpu_set_tex_max_mip_ext", - "gpu_set_tex_max_aniso", - "gpu_set_tex_max_aniso_ext", - "gpu_set_tex_mip_enable", - "gpu_set_tex_mip_enable_ext", - "gpu_get_blendenable", - "gpu_get_ztestenable", - "gpu_get_zfunc", - "gpu_get_zwriteenable", - "gpu_get_lightingenable", - "gpu_get_fog", - "gpu_get_cullmode", - "gpu_get_blendmode", - "gpu_get_blendmode_ext", - "gpu_get_blendmode_ext_sepalpha", - "gpu_get_blendmode_src", - "gpu_get_blendmode_dest", - "gpu_get_blendmode_srcalpha", - "gpu_get_blendmode_destalpha", - "gpu_get_colorwriteenable", - "gpu_get_colourwriteenable", - "gpu_get_alphatestenable", - "gpu_get_alphatestref", - "gpu_get_alphatestfunc", - "gpu_get_texfilter", - "gpu_get_texfilter_ext", - "gpu_get_texrepeat", - "gpu_get_texrepeat_ext", - "gpu_get_tex_filter", - "gpu_get_tex_filter_ext", - "gpu_get_tex_repeat", - "gpu_get_tex_repeat_ext", - "gpu_get_tex_mip_filter", - "gpu_get_tex_mip_filter_ext", - "gpu_get_tex_mip_bias", - "gpu_get_tex_mip_bias_ext", - "gpu_get_tex_min_mip", - "gpu_get_tex_min_mip_ext", - "gpu_get_tex_max_mip", - "gpu_get_tex_max_mip_ext", - "gpu_get_tex_max_aniso", - "gpu_get_tex_max_aniso_ext", - "gpu_get_tex_mip_enable", - "gpu_get_tex_mip_enable_ext", - "gpu_push_state", - "gpu_pop_state", - "gpu_get_state", - "gpu_set_state", - "draw_light_define_ambient", - "draw_light_define_direction", - "draw_light_define_point", - "draw_light_enable", - "draw_set_lighting", - "draw_light_get_ambient", - "draw_light_get", - "draw_get_lighting", - "shop_leave_rating", - "url_get_domain", - "url_open", - "url_open_ext", - "url_open_full", - "get_timer", - "achievement_login", - "achievement_logout", - "achievement_post", - "achievement_increment", - "achievement_post_score", - "achievement_available", - "achievement_show_achievements", - "achievement_show_leaderboards", - "achievement_load_friends", - "achievement_load_leaderboard", - "achievement_send_challenge", - "achievement_load_progress", - "achievement_reset", - "achievement_login_status", - "achievement_get_pic", - "achievement_show_challenge_notifications", - "achievement_get_challenges", - "achievement_event", - "achievement_show", - "achievement_get_info", - "cloud_file_save", - "cloud_string_save", - "cloud_synchronise", - "ads_enable", - "ads_disable", - "ads_setup", - "ads_engagement_launch", - "ads_engagement_available", - "ads_engagement_active", - "ads_event", - "ads_event_preload", - "ads_set_reward_callback", - "ads_get_display_height", - "ads_get_display_width", - "ads_move", - "ads_interstitial_available", - "ads_interstitial_display", - "device_get_tilt_x", - "device_get_tilt_y", - "device_get_tilt_z", - "device_is_keypad_open", - "device_mouse_check_button", - "device_mouse_check_button_pressed", - "device_mouse_check_button_released", - "device_mouse_x", - "device_mouse_y", - "device_mouse_raw_x", - "device_mouse_raw_y", - "device_mouse_x_to_gui", - "device_mouse_y_to_gui", - "iap_activate", - "iap_status", - "iap_enumerate_products", - "iap_restore_all", - "iap_acquire", - "iap_consume", - "iap_product_details", - "iap_purchase_details", - "facebook_init", - "facebook_login", - "facebook_status", - "facebook_graph_request", - "facebook_dialog", - "facebook_logout", - "facebook_launch_offerwall", - "facebook_post_message", - "facebook_send_invite", - "facebook_user_id", - "facebook_accesstoken", - "facebook_check_permission", - "facebook_request_read_permissions", - "facebook_request_publish_permissions", - "gamepad_is_supported", - "gamepad_get_device_count", - "gamepad_is_connected", - "gamepad_get_description", - "gamepad_get_button_threshold", - "gamepad_set_button_threshold", - "gamepad_get_axis_deadzone", - "gamepad_set_axis_deadzone", - "gamepad_button_count", - "gamepad_button_check", - "gamepad_button_check_pressed", - "gamepad_button_check_released", - "gamepad_button_value", - "gamepad_axis_count", - "gamepad_axis_value", - "gamepad_set_vibration", - "gamepad_set_colour", - "gamepad_set_color", - "os_is_paused", - "window_has_focus", - "code_is_compiled", - "http_get", - "http_get_file", - "http_post_string", - "http_request", - "json_encode", - "json_decode", - "zip_unzip", - "load_csv", - "base64_encode", - "base64_decode", - "md5_string_unicode", - "md5_string_utf8", - "md5_file", - "os_is_network_connected", - "sha1_string_unicode", - "sha1_string_utf8", - "sha1_file", - "os_powersave_enable", - "analytics_event", - "analytics_event_ext", - "win8_livetile_tile_notification", - "win8_livetile_tile_clear", - "win8_livetile_badge_notification", - "win8_livetile_badge_clear", - "win8_livetile_queue_enable", - "win8_secondarytile_pin", - "win8_secondarytile_badge_notification", - "win8_secondarytile_delete", - "win8_livetile_notification_begin", - "win8_livetile_notification_secondary_begin", - "win8_livetile_notification_expiry", - "win8_livetile_notification_tag", - "win8_livetile_notification_text_add", - "win8_livetile_notification_image_add", - "win8_livetile_notification_end", - "win8_appbar_enable", - "win8_appbar_add_element", - "win8_appbar_remove_element", - "win8_settingscharm_add_entry", - "win8_settingscharm_add_html_entry", - "win8_settingscharm_add_xaml_entry", - "win8_settingscharm_set_xaml_property", - "win8_settingscharm_get_xaml_property", - "win8_settingscharm_remove_entry", - "win8_share_image", - "win8_share_screenshot", - "win8_share_file", - "win8_share_url", - "win8_share_text", - "win8_search_enable", - "win8_search_disable", - "win8_search_add_suggestions", - "win8_device_touchscreen_available", - "win8_license_initialize_sandbox", - "win8_license_trial_version", - "winphone_license_trial_version", - "winphone_tile_title", - "winphone_tile_count", - "winphone_tile_back_title", - "winphone_tile_back_content", - "winphone_tile_back_content_wide", - "winphone_tile_front_image", - "winphone_tile_front_image_small", - "winphone_tile_front_image_wide", - "winphone_tile_back_image", - "winphone_tile_back_image_wide", - "winphone_tile_background_colour", - "winphone_tile_background_color", - "winphone_tile_icon_image", - "winphone_tile_small_icon_image", - "winphone_tile_wide_content", - "winphone_tile_cycle_images", - "winphone_tile_small_background_image", - "physics_world_create", - "physics_world_gravity", - "physics_world_update_speed", - "physics_world_update_iterations", - "physics_world_draw_debug", - "physics_pause_enable", - "physics_fixture_create", - "physics_fixture_set_kinematic", - "physics_fixture_set_density", - "physics_fixture_set_awake", - "physics_fixture_set_restitution", - "physics_fixture_set_friction", - "physics_fixture_set_collision_group", - "physics_fixture_set_sensor", - "physics_fixture_set_linear_damping", - "physics_fixture_set_angular_damping", - "physics_fixture_set_circle_shape", - "physics_fixture_set_box_shape", - "physics_fixture_set_edge_shape", - "physics_fixture_set_polygon_shape", - "physics_fixture_set_chain_shape", - "physics_fixture_add_point", - "physics_fixture_bind", - "physics_fixture_bind_ext", - "physics_fixture_delete", - "physics_apply_force", - "physics_apply_impulse", - "physics_apply_angular_impulse", - "physics_apply_local_force", - "physics_apply_local_impulse", - "physics_apply_torque", - "physics_mass_properties", - "physics_draw_debug", - "physics_test_overlap", - "physics_remove_fixture", - "physics_set_friction", - "physics_set_density", - "physics_set_restitution", - "physics_get_friction", - "physics_get_density", - "physics_get_restitution", - "physics_joint_distance_create", - "physics_joint_rope_create", - "physics_joint_revolute_create", - "physics_joint_prismatic_create", - "physics_joint_pulley_create", - "physics_joint_wheel_create", - "physics_joint_weld_create", - "physics_joint_friction_create", - "physics_joint_gear_create", - "physics_joint_enable_motor", - "physics_joint_get_value", - "physics_joint_set_value", - "physics_joint_delete", - "physics_particle_create", - "physics_particle_delete", - "physics_particle_delete_region_circle", - "physics_particle_delete_region_box", - "physics_particle_delete_region_poly", - "physics_particle_set_flags", - "physics_particle_set_category_flags", - "physics_particle_draw", - "physics_particle_draw_ext", - "physics_particle_count", - "physics_particle_get_data", - "physics_particle_get_data_particle", - "physics_particle_group_begin", - "physics_particle_group_circle", - "physics_particle_group_box", - "physics_particle_group_polygon", - "physics_particle_group_add_point", - "physics_particle_group_end", - "physics_particle_group_join", - "physics_particle_group_delete", - "physics_particle_group_count", - "physics_particle_group_get_data", - "physics_particle_group_get_mass", - "physics_particle_group_get_inertia", - "physics_particle_group_get_centre_x", - "physics_particle_group_get_centre_y", - "physics_particle_group_get_vel_x", - "physics_particle_group_get_vel_y", - "physics_particle_group_get_ang_vel", - "physics_particle_group_get_x", - "physics_particle_group_get_y", - "physics_particle_group_get_angle", - "physics_particle_set_group_flags", - "physics_particle_get_group_flags", - "physics_particle_get_max_count", - "physics_particle_get_radius", - "physics_particle_get_density", - "physics_particle_get_damping", - "physics_particle_get_gravity_scale", - "physics_particle_set_max_count", - "physics_particle_set_radius", - "physics_particle_set_density", - "physics_particle_set_damping", - "physics_particle_set_gravity_scale", - "network_create_socket", - "network_create_socket_ext", - "network_create_server", - "network_create_server_raw", - "network_connect", - "network_connect_raw", - "network_send_packet", - "network_send_raw", - "network_send_broadcast", - "network_send_udp", - "network_send_udp_raw", - "network_set_timeout", - "network_set_config", - "network_resolve", - "network_destroy", - "buffer_create", - "buffer_write", - "buffer_read", - "buffer_seek", - "buffer_get_surface", - "buffer_set_surface", - "buffer_delete", - "buffer_exists", - "buffer_get_type", - "buffer_get_alignment", - "buffer_poke", - "buffer_peek", - "buffer_save", - "buffer_save_ext", - "buffer_load", - "buffer_load_ext", - "buffer_load_partial", - "buffer_copy", - "buffer_fill", - "buffer_get_size", - "buffer_tell", - "buffer_resize", - "buffer_md5", - "buffer_sha1", - "buffer_base64_encode", - "buffer_base64_decode", - "buffer_base64_decode_ext", - "buffer_sizeof", - "buffer_get_address", - "buffer_create_from_vertex_buffer", - "buffer_create_from_vertex_buffer_ext", - "buffer_copy_from_vertex_buffer", - "buffer_async_group_begin", - "buffer_async_group_option", - "buffer_async_group_end", - "buffer_load_async", - "buffer_save_async", - "gml_release_mode", - "gml_pragma", - "steam_activate_overlay", - "steam_is_overlay_enabled", - "steam_is_overlay_activated", - "steam_get_persona_name", - "steam_initialised", - "steam_is_cloud_enabled_for_app", - "steam_is_cloud_enabled_for_account", - "steam_file_persisted", - "steam_get_quota_total", - "steam_get_quota_free", - "steam_file_write", - "steam_file_write_file", - "steam_file_read", - "steam_file_delete", - "steam_file_exists", - "steam_file_size", - "steam_file_share", - "steam_is_screenshot_requested", - "steam_send_screenshot", - "steam_is_user_logged_on", - "steam_get_user_steam_id", - "steam_user_owns_dlc", - "steam_user_installed_dlc", - "steam_set_achievement", - "steam_get_achievement", - "steam_clear_achievement", - "steam_set_stat_int", - "steam_set_stat_float", - "steam_set_stat_avg_rate", - "steam_get_stat_int", - "steam_get_stat_float", - "steam_get_stat_avg_rate", - "steam_reset_all_stats", - "steam_reset_all_stats_achievements", - "steam_stats_ready", - "steam_create_leaderboard", - "steam_upload_score", - "steam_upload_score_ext", - "steam_download_scores_around_user", - "steam_download_scores", - "steam_download_friends_scores", - "steam_upload_score_buffer", - "steam_upload_score_buffer_ext", - "steam_current_game_language", - "steam_available_languages", - "steam_activate_overlay_browser", - "steam_activate_overlay_user", - "steam_activate_overlay_store", - "steam_get_user_persona_name", - "steam_get_app_id", - "steam_get_user_account_id", - "steam_ugc_download", - "steam_ugc_create_item", - "steam_ugc_start_item_update", - "steam_ugc_set_item_title", - "steam_ugc_set_item_description", - "steam_ugc_set_item_visibility", - "steam_ugc_set_item_tags", - "steam_ugc_set_item_content", - "steam_ugc_set_item_preview", - "steam_ugc_submit_item_update", - "steam_ugc_get_item_update_progress", - "steam_ugc_subscribe_item", - "steam_ugc_unsubscribe_item", - "steam_ugc_num_subscribed_items", - "steam_ugc_get_subscribed_items", - "steam_ugc_get_item_install_info", - "steam_ugc_get_item_update_info", - "steam_ugc_request_item_details", - "steam_ugc_create_query_user", - "steam_ugc_create_query_user_ex", - "steam_ugc_create_query_all", - "steam_ugc_create_query_all_ex", - "steam_ugc_query_set_cloud_filename_filter", - "steam_ugc_query_set_match_any_tag", - "steam_ugc_query_set_search_text", - "steam_ugc_query_set_ranked_by_trend_days", - "steam_ugc_query_add_required_tag", - "steam_ugc_query_add_excluded_tag", - "steam_ugc_query_set_return_long_description", - "steam_ugc_query_set_return_total_only", - "steam_ugc_query_set_allow_cached_response", - "steam_ugc_send_query", - "shader_set", - "shader_get_name", - "shader_reset", - "shader_current", - "shader_is_compiled", - "shader_get_sampler_index", - "shader_get_uniform", - "shader_set_uniform_i", - "shader_set_uniform_i_array", - "shader_set_uniform_f", - "shader_set_uniform_f_array", - "shader_set_uniform_matrix", - "shader_set_uniform_matrix_array", - "shader_enable_corner_id", - "texture_set_stage", - "texture_get_texel_width", - "texture_get_texel_height", - "shaders_are_supported", - "vertex_format_begin", - "vertex_format_end", - "vertex_format_delete", - "vertex_format_add_position", - "vertex_format_add_position_3d", - "vertex_format_add_colour", - "vertex_format_add_color", - "vertex_format_add_normal", - "vertex_format_add_texcoord", - "vertex_format_add_textcoord", - "vertex_format_add_custom", - "vertex_create_buffer", - "vertex_create_buffer_ext", - "vertex_delete_buffer", - "vertex_begin", - "vertex_end", - "vertex_position", - "vertex_position_3d", - "vertex_colour", - "vertex_color", - "vertex_argb", - "vertex_texcoord", - "vertex_normal", - "vertex_float1", - "vertex_float2", - "vertex_float3", - "vertex_float4", - "vertex_ubyte4", - "vertex_submit", - "vertex_freeze", - "vertex_get_number", - "vertex_get_buffer_size", - "vertex_create_buffer_from_buffer", - "vertex_create_buffer_from_buffer_ext", - "push_local_notification", - "push_get_first_local_notification", - "push_get_next_local_notification", - "push_cancel_local_notification", - "skeleton_animation_set", - "skeleton_animation_get", - "skeleton_animation_mix", - "skeleton_animation_set_ext", - "skeleton_animation_get_ext", - "skeleton_animation_get_duration", - "skeleton_animation_get_frames", - "skeleton_animation_clear", - "skeleton_skin_set", - "skeleton_skin_get", - "skeleton_attachment_set", - "skeleton_attachment_get", - "skeleton_attachment_create", - "skeleton_collision_draw_set", - "skeleton_bone_data_get", - "skeleton_bone_data_set", - "skeleton_bone_state_get", - "skeleton_bone_state_set", - "skeleton_get_minmax", - "skeleton_get_num_bounds", - "skeleton_get_bounds", - "skeleton_animation_get_frame", - "skeleton_animation_set_frame", - "draw_skeleton", - "draw_skeleton_time", - "draw_skeleton_instance", - "draw_skeleton_collision", - "skeleton_animation_list", - "skeleton_skin_list", - "skeleton_slot_data", - "layer_get_id", - "layer_get_id_at_depth", - "layer_get_depth", - "layer_create", - "layer_destroy", - "layer_destroy_instances", - "layer_add_instance", - "layer_has_instance", - "layer_set_visible", - "layer_get_visible", - "layer_exists", - "layer_x", - "layer_y", - "layer_get_x", - "layer_get_y", - "layer_hspeed", - "layer_vspeed", - "layer_get_hspeed", - "layer_get_vspeed", - "layer_script_begin", - "layer_script_end", - "layer_shader", - "layer_get_script_begin", - "layer_get_script_end", - "layer_get_shader", - "layer_set_target_room", - "layer_get_target_room", - "layer_reset_target_room", - "layer_get_all", - "layer_get_all_elements", - "layer_get_name", - "layer_depth", - "layer_get_element_layer", - "layer_get_element_type", - "layer_element_move", - "layer_force_draw_depth", - "layer_is_draw_depth_forced", - "layer_get_forced_depth", - "layer_background_get_id", - "layer_background_exists", - "layer_background_create", - "layer_background_destroy", - "layer_background_visible", - "layer_background_change", - "layer_background_sprite", - "layer_background_htiled", - "layer_background_vtiled", - "layer_background_stretch", - "layer_background_yscale", - "layer_background_xscale", - "layer_background_blend", - "layer_background_alpha", - "layer_background_index", - "layer_background_speed", - "layer_background_get_visible", - "layer_background_get_sprite", - "layer_background_get_htiled", - "layer_background_get_vtiled", - "layer_background_get_stretch", - "layer_background_get_yscale", - "layer_background_get_xscale", - "layer_background_get_blend", - "layer_background_get_alpha", - "layer_background_get_index", - "layer_background_get_speed", - "layer_sprite_get_id", - "layer_sprite_exists", - "layer_sprite_create", - "layer_sprite_destroy", - "layer_sprite_change", - "layer_sprite_index", - "layer_sprite_speed", - "layer_sprite_xscale", - "layer_sprite_yscale", - "layer_sprite_angle", - "layer_sprite_blend", - "layer_sprite_alpha", - "layer_sprite_x", - "layer_sprite_y", - "layer_sprite_get_sprite", - "layer_sprite_get_index", - "layer_sprite_get_speed", - "layer_sprite_get_xscale", - "layer_sprite_get_yscale", - "layer_sprite_get_angle", - "layer_sprite_get_blend", - "layer_sprite_get_alpha", - "layer_sprite_get_x", - "layer_sprite_get_y", - "layer_tilemap_get_id", - "layer_tilemap_exists", - "layer_tilemap_create", - "layer_tilemap_destroy", - "tilemap_tileset", - "tilemap_x", - "tilemap_y", - "tilemap_set", - "tilemap_set_at_pixel", - "tilemap_get_tileset", - "tilemap_get_tile_width", - "tilemap_get_tile_height", - "tilemap_get_width", - "tilemap_get_height", - "tilemap_get_x", - "tilemap_get_y", - "tilemap_get", - "tilemap_get_at_pixel", - "tilemap_get_cell_x_at_pixel", - "tilemap_get_cell_y_at_pixel", - "tilemap_clear", - "draw_tilemap", - "draw_tile", - "tilemap_set_global_mask", - "tilemap_get_global_mask", - "tilemap_set_mask", - "tilemap_get_mask", - "tilemap_get_frame", - "tile_set_empty", - "tile_set_index", - "tile_set_flip", - "tile_set_mirror", - "tile_set_rotate", - "tile_get_empty", - "tile_get_index", - "tile_get_flip", - "tile_get_mirror", - "tile_get_rotate", - "layer_tile_exists", - "layer_tile_create", - "layer_tile_destroy", - "layer_tile_change", - "layer_tile_xscale", - "layer_tile_yscale", - "layer_tile_blend", - "layer_tile_alpha", - "layer_tile_x", - "layer_tile_y", - "layer_tile_region", - "layer_tile_visible", - "layer_tile_get_sprite", - "layer_tile_get_xscale", - "layer_tile_get_yscale", - "layer_tile_get_blend", - "layer_tile_get_alpha", - "layer_tile_get_x", - "layer_tile_get_y", - "layer_tile_get_region", - "layer_tile_get_visible", - "layer_instance_get_instance", - "instance_activate_layer", - "instance_deactivate_layer", - "camera_create", - "camera_create_view", - "camera_destroy", - "camera_apply", - "camera_get_active", - "camera_get_default", - "camera_set_default", - "camera_set_view_mat", - "camera_set_proj_mat", - "camera_set_update_script", - "camera_set_begin_script", - "camera_set_end_script", - "camera_set_view_pos", - "camera_set_view_size", - "camera_set_view_speed", - "camera_set_view_border", - "camera_set_view_angle", - "camera_set_view_target", - "camera_get_view_mat", - "camera_get_proj_mat", - "camera_get_update_script", - "camera_get_begin_script", - "camera_get_end_script", - "camera_get_view_x", - "camera_get_view_y", - "camera_get_view_width", - "camera_get_view_height", - "camera_get_view_speed_x", - "camera_get_view_speed_y", - "camera_get_view_border_x", - "camera_get_view_border_y", - "camera_get_view_angle", - "camera_get_view_target", - "view_get_camera", - "view_get_visible", - "view_get_xport", - "view_get_yport", - "view_get_wport", - "view_get_hport", - "view_get_surface_id", - "view_set_camera", - "view_set_visible", - "view_set_xport", - "view_set_yport", - "view_set_wport", - "view_set_hport", - "view_set_surface_id", - "gesture_drag_time", - "gesture_drag_distance", - "gesture_flick_speed", - "gesture_double_tap_time", - "gesture_double_tap_distance", - "gesture_pinch_distance", - "gesture_pinch_angle_towards", - "gesture_pinch_angle_away", - "gesture_rotate_time", - "gesture_rotate_angle", - "gesture_tap_count", - "gesture_get_drag_time", - "gesture_get_drag_distance", - "gesture_get_flick_speed", - "gesture_get_double_tap_time", - "gesture_get_double_tap_distance", - "gesture_get_pinch_distance", - "gesture_get_pinch_angle_towards", - "gesture_get_pinch_angle_away", - "gesture_get_rotate_time", - "gesture_get_rotate_angle", - "gesture_get_tap_count", - "keyboard_virtual_show", - "keyboard_virtual_hide", - "keyboard_virtual_status", - "keyboard_virtual_height" - ]; - const LITERALS = [ - "true", - "false", - "all", - "noone", - "undefined", - "pointer_invalid", - "pointer_null" - ]; - // many of these look like enumerables to me (see comments below) - const SYMBOLS = [ - "other", - "global", - "local", - "path_action_stop", - "path_action_restart", - "path_action_continue", - "path_action_reverse", - "pi", - "GM_build_date", - "GM_version", - "GM_runtime_version", - "timezone_local", - "timezone_utc", - "gamespeed_fps", - "gamespeed_microseconds", - // for example ev_ are types of events - "ev_create", - "ev_destroy", - "ev_step", - "ev_alarm", - "ev_keyboard", - "ev_mouse", - "ev_collision", - "ev_other", - "ev_draw", - "ev_draw_begin", - "ev_draw_end", - "ev_draw_pre", - "ev_draw_post", - "ev_keypress", - "ev_keyrelease", - "ev_trigger", - "ev_left_button", - "ev_right_button", - "ev_middle_button", - "ev_no_button", - "ev_left_press", - "ev_right_press", - "ev_middle_press", - "ev_left_release", - "ev_right_release", - "ev_middle_release", - "ev_mouse_enter", - "ev_mouse_leave", - "ev_mouse_wheel_up", - "ev_mouse_wheel_down", - "ev_global_left_button", - "ev_global_right_button", - "ev_global_middle_button", - "ev_global_left_press", - "ev_global_right_press", - "ev_global_middle_press", - "ev_global_left_release", - "ev_global_right_release", - "ev_global_middle_release", - "ev_joystick1_left", - "ev_joystick1_right", - "ev_joystick1_up", - "ev_joystick1_down", - "ev_joystick1_button1", - "ev_joystick1_button2", - "ev_joystick1_button3", - "ev_joystick1_button4", - "ev_joystick1_button5", - "ev_joystick1_button6", - "ev_joystick1_button7", - "ev_joystick1_button8", - "ev_joystick2_left", - "ev_joystick2_right", - "ev_joystick2_up", - "ev_joystick2_down", - "ev_joystick2_button1", - "ev_joystick2_button2", - "ev_joystick2_button3", - "ev_joystick2_button4", - "ev_joystick2_button5", - "ev_joystick2_button6", - "ev_joystick2_button7", - "ev_joystick2_button8", - "ev_outside", - "ev_boundary", - "ev_game_start", - "ev_game_end", - "ev_room_start", - "ev_room_end", - "ev_no_more_lives", - "ev_animation_end", - "ev_end_of_path", - "ev_no_more_health", - "ev_close_button", - "ev_user0", - "ev_user1", - "ev_user2", - "ev_user3", - "ev_user4", - "ev_user5", - "ev_user6", - "ev_user7", - "ev_user8", - "ev_user9", - "ev_user10", - "ev_user11", - "ev_user12", - "ev_user13", - "ev_user14", - "ev_user15", - "ev_step_normal", - "ev_step_begin", - "ev_step_end", - "ev_gui", - "ev_gui_begin", - "ev_gui_end", - "ev_cleanup", - "ev_gesture", - "ev_gesture_tap", - "ev_gesture_double_tap", - "ev_gesture_drag_start", - "ev_gesture_dragging", - "ev_gesture_drag_end", - "ev_gesture_flick", - "ev_gesture_pinch_start", - "ev_gesture_pinch_in", - "ev_gesture_pinch_out", - "ev_gesture_pinch_end", - "ev_gesture_rotate_start", - "ev_gesture_rotating", - "ev_gesture_rotate_end", - "ev_global_gesture_tap", - "ev_global_gesture_double_tap", - "ev_global_gesture_drag_start", - "ev_global_gesture_dragging", - "ev_global_gesture_drag_end", - "ev_global_gesture_flick", - "ev_global_gesture_pinch_start", - "ev_global_gesture_pinch_in", - "ev_global_gesture_pinch_out", - "ev_global_gesture_pinch_end", - "ev_global_gesture_rotate_start", - "ev_global_gesture_rotating", - "ev_global_gesture_rotate_end", - "vk_nokey", - "vk_anykey", - "vk_enter", - "vk_return", - "vk_shift", - "vk_control", - "vk_alt", - "vk_escape", - "vk_space", - "vk_backspace", - "vk_tab", - "vk_pause", - "vk_printscreen", - "vk_left", - "vk_right", - "vk_up", - "vk_down", - "vk_home", - "vk_end", - "vk_delete", - "vk_insert", - "vk_pageup", - "vk_pagedown", - "vk_f1", - "vk_f2", - "vk_f3", - "vk_f4", - "vk_f5", - "vk_f6", - "vk_f7", - "vk_f8", - "vk_f9", - "vk_f10", - "vk_f11", - "vk_f12", - "vk_numpad0", - "vk_numpad1", - "vk_numpad2", - "vk_numpad3", - "vk_numpad4", - "vk_numpad5", - "vk_numpad6", - "vk_numpad7", - "vk_numpad8", - "vk_numpad9", - "vk_divide", - "vk_multiply", - "vk_subtract", - "vk_add", - "vk_decimal", - "vk_lshift", - "vk_lcontrol", - "vk_lalt", - "vk_rshift", - "vk_rcontrol", - "vk_ralt", - "mb_any", - "mb_none", - "mb_left", - "mb_right", - "mb_middle", + "font_texture_page_size", + "frac", + "game_end", + "game_get_speed", + "game_load", + "game_load_buffer", + "game_restart", + "game_save", + "game_save_buffer", + "game_set_speed", + "gamepad_axis_count", + "gamepad_axis_value", + "gamepad_button_check", + "gamepad_button_check_pressed", + "gamepad_button_check_released", + "gamepad_button_count", + "gamepad_button_value", + "gamepad_get_axis_deadzone", + "gamepad_get_button_threshold", + "gamepad_get_description", + "gamepad_get_device_count", + "gamepad_is_connected", + "gamepad_is_supported", + "gamepad_set_axis_deadzone", + "gamepad_set_button_threshold", + "gamepad_set_color", + "gamepad_set_colour", + "gamepad_set_vibration", + "gesture_double_tap_distance", + "gesture_double_tap_time", + "gesture_drag_distance", + "gesture_drag_time", + "gesture_flick_speed", + "gesture_get_double_tap_distance", + "gesture_get_double_tap_time", + "gesture_get_drag_distance", + "gesture_get_drag_time", + "gesture_get_flick_speed", + "gesture_get_pinch_angle_away", + "gesture_get_pinch_angle_towards", + "gesture_get_pinch_distance", + "gesture_get_rotate_angle", + "gesture_get_rotate_time", + "gesture_get_tap_count", + "gesture_pinch_angle_away", + "gesture_pinch_angle_towards", + "gesture_pinch_distance", + "gesture_rotate_angle", + "gesture_rotate_time", + "gesture_tap_count", + "get_integer", + "get_integer_async", + "get_login_async", + "get_open_filename", + "get_open_filename_ext", + "get_save_filename", + "get_save_filename_ext", + "get_string", + "get_string_async", + "get_timer", + "gml_pragma", + "gml_release_mode", + "gpu_get_alphatestenable", + "gpu_get_alphatestfunc", + "gpu_get_alphatestref", + "gpu_get_blendenable", + "gpu_get_blendmode", + "gpu_get_blendmode_dest", + "gpu_get_blendmode_destalpha", + "gpu_get_blendmode_ext", + "gpu_get_blendmode_ext_sepalpha", + "gpu_get_blendmode_src", + "gpu_get_blendmode_srcalpha", + "gpu_get_colorwriteenable", + "gpu_get_colourwriteenable", + "gpu_get_cullmode", + "gpu_get_fog", + "gpu_get_lightingenable", + "gpu_get_state", + "gpu_get_tex_filter", + "gpu_get_tex_filter_ext", + "gpu_get_tex_max_aniso", + "gpu_get_tex_max_aniso_ext", + "gpu_get_tex_max_mip", + "gpu_get_tex_max_mip_ext", + "gpu_get_tex_min_mip", + "gpu_get_tex_min_mip_ext", + "gpu_get_tex_mip_bias", + "gpu_get_tex_mip_bias_ext", + "gpu_get_tex_mip_enable", + "gpu_get_tex_mip_enable_ext", + "gpu_get_tex_mip_filter", + "gpu_get_tex_mip_filter_ext", + "gpu_get_tex_repeat", + "gpu_get_tex_repeat_ext", + "gpu_get_texfilter", + "gpu_get_texfilter_ext", + "gpu_get_texrepeat", + "gpu_get_texrepeat_ext", + "gpu_get_zfunc", + "gpu_get_ztestenable", + "gpu_get_zwriteenable", + "gpu_pop_state", + "gpu_push_state", + "gpu_set_alphatestenable", + "gpu_set_alphatestfunc", + "gpu_set_alphatestref", + "gpu_set_blendenable", + "gpu_set_blendmode", + "gpu_set_blendmode_ext", + "gpu_set_blendmode_ext_sepalpha", + "gpu_set_colorwriteenable", + "gpu_set_colourwriteenable", + "gpu_set_cullmode", + "gpu_set_fog", + "gpu_set_lightingenable", + "gpu_set_state", + "gpu_set_tex_filter", + "gpu_set_tex_filter_ext", + "gpu_set_tex_max_aniso", + "gpu_set_tex_max_aniso_ext", + "gpu_set_tex_max_mip", + "gpu_set_tex_max_mip_ext", + "gpu_set_tex_min_mip", + "gpu_set_tex_min_mip_ext", + "gpu_set_tex_mip_bias", + "gpu_set_tex_mip_bias_ext", + "gpu_set_tex_mip_enable", + "gpu_set_tex_mip_enable_ext", + "gpu_set_tex_mip_filter", + "gpu_set_tex_mip_filter_ext", + "gpu_set_tex_repeat", + "gpu_set_tex_repeat_ext", + "gpu_set_texfilter", + "gpu_set_texfilter_ext", + "gpu_set_texrepeat", + "gpu_set_texrepeat_ext", + "gpu_set_zfunc", + "gpu_set_ztestenable", + "gpu_set_zwriteenable", + "highscore_add", + "highscore_clear", + "highscore_name", + "highscore_value", + "http_get", + "http_get_file", + "http_post_string", + "http_request", + "iap_acquire", + "iap_activate", + "iap_consume", + "iap_enumerate_products", + "iap_product_details", + "iap_purchase_details", + "iap_restore_all", + "iap_status", + "ini_close", + "ini_key_delete", + "ini_key_exists", + "ini_open", + "ini_open_from_string", + "ini_read_real", + "ini_read_string", + "ini_section_delete", + "ini_section_exists", + "ini_write_real", + "ini_write_string", + "instance_activate_all", + "instance_activate_layer", + "instance_activate_object", + "instance_activate_region", + "instance_change", + "instance_copy", + "instance_create", + "instance_create_depth", + "instance_create_layer", + "instance_deactivate_all", + "instance_deactivate_layer", + "instance_deactivate_object", + "instance_deactivate_region", + "instance_destroy", + "instance_exists", + "instance_find", + "instance_furthest", + "instance_id_get", + "instance_nearest", + "instance_number", + "instance_place", + "instance_place_list", + "instance_position", + "instance_position_list", + "int64", + "io_clear", + "irandom", + "irandom_range", + "is_array", + "is_bool", + "is_infinity", + "is_int32", + "is_int64", + "is_matrix", + "is_method", + "is_nan", + "is_numeric", + "is_ptr", + "is_real", + "is_string", + "is_struct", + "is_undefined", + "is_vec3", + "is_vec4", + "json_decode", + "json_encode", + "keyboard_check", + "keyboard_check_direct", + "keyboard_check_pressed", + "keyboard_check_released", + "keyboard_clear", + "keyboard_get_map", + "keyboard_get_numlock", + "keyboard_key_press", + "keyboard_key_release", + "keyboard_set_map", + "keyboard_set_numlock", + "keyboard_unset_map", + "keyboard_virtual_height", + "keyboard_virtual_hide", + "keyboard_virtual_show", + "keyboard_virtual_status", + "layer_add_instance", + "layer_background_alpha", + "layer_background_blend", + "layer_background_change", + "layer_background_create", + "layer_background_destroy", + "layer_background_exists", + "layer_background_get_alpha", + "layer_background_get_blend", + "layer_background_get_htiled", + "layer_background_get_id", + "layer_background_get_index", + "layer_background_get_speed", + "layer_background_get_sprite", + "layer_background_get_stretch", + "layer_background_get_visible", + "layer_background_get_vtiled", + "layer_background_get_xscale", + "layer_background_get_yscale", + "layer_background_htiled", + "layer_background_index", + "layer_background_speed", + "layer_background_sprite", + "layer_background_stretch", + "layer_background_visible", + "layer_background_vtiled", + "layer_background_xscale", + "layer_background_yscale", + "layer_create", + "layer_depth", + "layer_destroy", + "layer_destroy_instances", + "layer_element_move", + "layer_exists", + "layer_force_draw_depth", + "layer_get_all", + "layer_get_all_elements", + "layer_get_depth", + "layer_get_element_layer", + "layer_get_element_type", + "layer_get_forced_depth", + "layer_get_hspeed", + "layer_get_id", + "layer_get_id_at_depth", + "layer_get_name", + "layer_get_script_begin", + "layer_get_script_end", + "layer_get_shader", + "layer_get_target_room", + "layer_get_visible", + "layer_get_vspeed", + "layer_get_x", + "layer_get_y", + "layer_has_instance", + "layer_hspeed", + "layer_instance_get_instance", + "layer_is_draw_depth_forced", + "layer_reset_target_room", + "layer_script_begin", + "layer_script_end", + "layer_set_target_room", + "layer_set_visible", + "layer_shader", + "layer_sprite_alpha", + "layer_sprite_angle", + "layer_sprite_blend", + "layer_sprite_change", + "layer_sprite_create", + "layer_sprite_destroy", + "layer_sprite_exists", + "layer_sprite_get_alpha", + "layer_sprite_get_angle", + "layer_sprite_get_blend", + "layer_sprite_get_id", + "layer_sprite_get_index", + "layer_sprite_get_speed", + "layer_sprite_get_sprite", + "layer_sprite_get_x", + "layer_sprite_get_xscale", + "layer_sprite_get_y", + "layer_sprite_get_yscale", + "layer_sprite_index", + "layer_sprite_speed", + "layer_sprite_x", + "layer_sprite_xscale", + "layer_sprite_y", + "layer_sprite_yscale", + "layer_tile_alpha", + "layer_tile_blend", + "layer_tile_change", + "layer_tile_create", + "layer_tile_destroy", + "layer_tile_exists", + "layer_tile_get_alpha", + "layer_tile_get_blend", + "layer_tile_get_region", + "layer_tile_get_sprite", + "layer_tile_get_visible", + "layer_tile_get_x", + "layer_tile_get_xscale", + "layer_tile_get_y", + "layer_tile_get_yscale", + "layer_tile_region", + "layer_tile_visible", + "layer_tile_x", + "layer_tile_xscale", + "layer_tile_y", + "layer_tile_yscale", + "layer_tilemap_create", + "layer_tilemap_destroy", + "layer_tilemap_exists", + "layer_tilemap_get_id", + "layer_vspeed", + "layer_x", + "layer_y", + "lengthdir_x", + "lengthdir_y", + "lerp", + "ln", + "load_csv", + "log10", + "log2", + "logn", + "make_color_hsv", + "make_color_rgb", + "make_colour_hsv", + "make_colour_rgb", + "math_get_epsilon", + "math_set_epsilon", + "matrix_build", + "matrix_build_identity", + "matrix_build_lookat", + "matrix_build_projection_ortho", + "matrix_build_projection_perspective", + "matrix_build_projection_perspective_fov", + "matrix_get", + "matrix_multiply", + "matrix_set", + "matrix_stack_clear", + "matrix_stack_is_empty", + "matrix_stack_multiply", + "matrix_stack_pop", + "matrix_stack_push", + "matrix_stack_set", + "matrix_stack_top", + "matrix_transform_vertex", + "max", + "md5_file", + "md5_string_unicode", + "md5_string_utf8", + "mean", + "median", + "merge_color", + "merge_colour", + "min", + "motion_add", + "motion_set", + "mouse_check_button", + "mouse_check_button_pressed", + "mouse_check_button_released", + "mouse_clear", + "mouse_wheel_down", + "mouse_wheel_up", + "move_bounce_all", + "move_bounce_solid", + "move_contact_all", + "move_contact_solid", + "move_outside_all", + "move_outside_solid", + "move_random", + "move_snap", + "move_towards_point", + "move_wrap", + "mp_grid_add_cell", + "mp_grid_add_instances", + "mp_grid_add_rectangle", + "mp_grid_clear_all", + "mp_grid_clear_cell", + "mp_grid_clear_rectangle", + "mp_grid_create", + "mp_grid_destroy", + "mp_grid_draw", + "mp_grid_get_cell", + "mp_grid_path", + "mp_grid_to_ds_grid", + "mp_linear_path", + "mp_linear_path_object", + "mp_linear_step", + "mp_linear_step_object", + "mp_potential_path", + "mp_potential_path_object", + "mp_potential_settings", + "mp_potential_step", + "mp_potential_step_object", + "network_connect", + "network_connect_raw", + "network_create_server", + "network_create_server_raw", + "network_create_socket", + "network_create_socket_ext", + "network_destroy", + "network_resolve", + "network_send_broadcast", + "network_send_packet", + "network_send_raw", + "network_send_udp", + "network_send_udp_raw", + "network_set_config", + "network_set_timeout", + "object_exists", + "object_get_depth", + "object_get_mask", + "object_get_name", + "object_get_parent", + "object_get_persistent", + "object_get_physics", + "object_get_solid", + "object_get_sprite", + "object_get_visible", + "object_is_ancestor", + "object_set_mask", + "object_set_persistent", + "object_set_solid", + "object_set_sprite", + "object_set_visible", + "ord", + "os_get_config", + "os_get_info", + "os_get_language", + "os_get_region", + "os_is_network_connected", + "os_is_paused", + "os_lock_orientation", + "os_powersave_enable", + "parameter_count", + "parameter_string", + "part_emitter_burst", + "part_emitter_clear", + "part_emitter_create", + "part_emitter_destroy", + "part_emitter_destroy_all", + "part_emitter_exists", + "part_emitter_region", + "part_emitter_stream", + "part_particles_clear", + "part_particles_count", + "part_particles_create", + "part_particles_create_color", + "part_particles_create_colour", + "part_system_automatic_draw", + "part_system_automatic_update", + "part_system_clear", + "part_system_create", + "part_system_create_layer", + "part_system_depth", + "part_system_destroy", + "part_system_draw_order", + "part_system_drawit", + "part_system_exists", + "part_system_get_layer", + "part_system_layer", + "part_system_position", + "part_system_update", + "part_type_alpha1", + "part_type_alpha2", + "part_type_alpha3", + "part_type_blend", + "part_type_clear", + "part_type_color1", + "part_type_color2", + "part_type_color3", + "part_type_color_hsv", + "part_type_color_mix", + "part_type_color_rgb", + "part_type_colour1", + "part_type_colour2", + "part_type_colour3", + "part_type_colour_hsv", + "part_type_colour_mix", + "part_type_colour_rgb", + "part_type_create", + "part_type_death", + "part_type_destroy", + "part_type_direction", + "part_type_exists", + "part_type_gravity", + "part_type_life", + "part_type_orientation", + "part_type_scale", + "part_type_shape", + "part_type_size", + "part_type_speed", + "part_type_sprite", + "part_type_step", + "path_add", + "path_add_point", + "path_append", + "path_assign", + "path_change_point", + "path_clear_points", + "path_delete", + "path_delete_point", + "path_duplicate", + "path_end", + "path_exists", + "path_flip", + "path_get_closed", + "path_get_kind", + "path_get_length", + "path_get_name", + "path_get_number", + "path_get_point_speed", + "path_get_point_x", + "path_get_point_y", + "path_get_precision", + "path_get_speed", + "path_get_time", + "path_get_x", + "path_get_y", + "path_insert_point", + "path_mirror", + "path_rescale", + "path_reverse", + "path_rotate", + "path_set_closed", + "path_set_kind", + "path_set_precision", + "path_shift", + "path_start", + "physics_apply_angular_impulse", + "physics_apply_force", + "physics_apply_impulse", + "physics_apply_local_force", + "physics_apply_local_impulse", + "physics_apply_torque", + "physics_draw_debug", + "physics_fixture_add_point", + "physics_fixture_bind", + "physics_fixture_bind_ext", + "physics_fixture_create", + "physics_fixture_delete", + "physics_fixture_set_angular_damping", + "physics_fixture_set_awake", + "physics_fixture_set_box_shape", + "physics_fixture_set_chain_shape", + "physics_fixture_set_circle_shape", + "physics_fixture_set_collision_group", + "physics_fixture_set_density", + "physics_fixture_set_edge_shape", + "physics_fixture_set_friction", + "physics_fixture_set_kinematic", + "physics_fixture_set_linear_damping", + "physics_fixture_set_polygon_shape", + "physics_fixture_set_restitution", + "physics_fixture_set_sensor", + "physics_get_density", + "physics_get_friction", + "physics_get_restitution", + "physics_joint_delete", + "physics_joint_distance_create", + "physics_joint_enable_motor", + "physics_joint_friction_create", + "physics_joint_gear_create", + "physics_joint_get_value", + "physics_joint_prismatic_create", + "physics_joint_pulley_create", + "physics_joint_revolute_create", + "physics_joint_rope_create", + "physics_joint_set_value", + "physics_joint_weld_create", + "physics_joint_wheel_create", + "physics_mass_properties", + "physics_particle_count", + "physics_particle_create", + "physics_particle_delete", + "physics_particle_delete_region_box", + "physics_particle_delete_region_circle", + "physics_particle_delete_region_poly", + "physics_particle_draw", + "physics_particle_draw_ext", + "physics_particle_get_damping", + "physics_particle_get_data", + "physics_particle_get_data_particle", + "physics_particle_get_density", + "physics_particle_get_gravity_scale", + "physics_particle_get_group_flags", + "physics_particle_get_max_count", + "physics_particle_get_radius", + "physics_particle_group_add_point", + "physics_particle_group_begin", + "physics_particle_group_box", + "physics_particle_group_circle", + "physics_particle_group_count", + "physics_particle_group_delete", + "physics_particle_group_end", + "physics_particle_group_get_ang_vel", + "physics_particle_group_get_angle", + "physics_particle_group_get_centre_x", + "physics_particle_group_get_centre_y", + "physics_particle_group_get_data", + "physics_particle_group_get_inertia", + "physics_particle_group_get_mass", + "physics_particle_group_get_vel_x", + "physics_particle_group_get_vel_y", + "physics_particle_group_get_x", + "physics_particle_group_get_y", + "physics_particle_group_join", + "physics_particle_group_polygon", + "physics_particle_set_category_flags", + "physics_particle_set_damping", + "physics_particle_set_density", + "physics_particle_set_flags", + "physics_particle_set_gravity_scale", + "physics_particle_set_group_flags", + "physics_particle_set_max_count", + "physics_particle_set_radius", + "physics_pause_enable", + "physics_remove_fixture", + "physics_set_density", + "physics_set_friction", + "physics_set_restitution", + "physics_test_overlap", + "physics_world_create", + "physics_world_draw_debug", + "physics_world_gravity", + "physics_world_update_iterations", + "physics_world_update_speed", + "place_empty", + "place_free", + "place_meeting", + "place_snapped", + "point_direction", + "point_distance", + "point_distance_3d", + "point_in_circle", + "point_in_rectangle", + "point_in_triangle", + "position_change", + "position_destroy", + "position_empty", + "position_meeting", + "power", + "ptr", + "push_cancel_local_notification", + "push_get_first_local_notification", + "push_get_next_local_notification", + "push_local_notification", + "radtodeg", + "random", + "random_get_seed", + "random_range", + "random_set_seed", + "randomise", + "randomize", + "real", + "rectangle_in_circle", + "rectangle_in_rectangle", + "rectangle_in_triangle", + "room_add", + "room_assign", + "room_duplicate", + "room_exists", + "room_get_camera", + "room_get_name", + "room_get_viewport", + "room_goto", + "room_goto_next", + "room_goto_previous", + "room_instance_add", + "room_instance_clear", + "room_next", + "room_previous", + "room_restart", + "room_set_background_color", + "room_set_background_colour", + "room_set_camera", + "room_set_height", + "room_set_persistent", + "room_set_view", + "room_set_view_enabled", + "room_set_viewport", + "room_set_width", + "round", + "screen_save", + "screen_save_part", + "script_execute", + "script_exists", + "script_get_name", + "sha1_file", + "sha1_string_unicode", + "sha1_string_utf8", + "shader_current", + "shader_enable_corner_id", + "shader_get_name", + "shader_get_sampler_index", + "shader_get_uniform", + "shader_is_compiled", + "shader_reset", + "shader_set", + "shader_set_uniform_f", + "shader_set_uniform_f_array", + "shader_set_uniform_i", + "shader_set_uniform_i_array", + "shader_set_uniform_matrix", + "shader_set_uniform_matrix_array", + "shaders_are_supported", + "shop_leave_rating", + "show_debug_message", + "show_debug_overlay", + "show_error", + "show_message", + "show_message_async", + "show_question", + "show_question_async", + "sign", + "sin", + "skeleton_animation_clear", + "skeleton_animation_get", + "skeleton_animation_get_duration", + "skeleton_animation_get_ext", + "skeleton_animation_get_frame", + "skeleton_animation_get_frames", + "skeleton_animation_list", + "skeleton_animation_mix", + "skeleton_animation_set", + "skeleton_animation_set_ext", + "skeleton_animation_set_frame", + "skeleton_attachment_create", + "skeleton_attachment_get", + "skeleton_attachment_set", + "skeleton_bone_data_get", + "skeleton_bone_data_set", + "skeleton_bone_state_get", + "skeleton_bone_state_set", + "skeleton_collision_draw_set", + "skeleton_get_bounds", + "skeleton_get_minmax", + "skeleton_get_num_bounds", + "skeleton_skin_get", + "skeleton_skin_list", + "skeleton_skin_set", + "skeleton_slot_data", + "sprite_add", + "sprite_add_from_surface", + "sprite_assign", + "sprite_collision_mask", + "sprite_create_from_surface", + "sprite_delete", + "sprite_duplicate", + "sprite_exists", + "sprite_flush", + "sprite_flush_multi", + "sprite_get_bbox_bottom", + "sprite_get_bbox_left", + "sprite_get_bbox_right", + "sprite_get_bbox_top", + "sprite_get_height", + "sprite_get_name", + "sprite_get_number", + "sprite_get_speed", + "sprite_get_speed_type", + "sprite_get_texture", + "sprite_get_tpe", + "sprite_get_uvs", + "sprite_get_width", + "sprite_get_xoffset", + "sprite_get_yoffset", + "sprite_merge", + "sprite_prefetch", + "sprite_prefetch_multi", + "sprite_replace", + "sprite_save", + "sprite_save_strip", + "sprite_set_alpha_from_sprite", + "sprite_set_cache_size", + "sprite_set_cache_size_ext", + "sprite_set_offset", + "sprite_set_speed", + "sqr", + "sqrt", + "steam_activate_overlay", + "steam_activate_overlay_browser", + "steam_activate_overlay_store", + "steam_activate_overlay_user", + "steam_available_languages", + "steam_clear_achievement", + "steam_create_leaderboard", + "steam_current_game_language", + "steam_download_friends_scores", + "steam_download_scores", + "steam_download_scores_around_user", + "steam_file_delete", + "steam_file_exists", + "steam_file_persisted", + "steam_file_read", + "steam_file_share", + "steam_file_size", + "steam_file_write", + "steam_file_write_file", + "steam_get_achievement", + "steam_get_app_id", + "steam_get_persona_name", + "steam_get_quota_free", + "steam_get_quota_total", + "steam_get_stat_avg_rate", + "steam_get_stat_float", + "steam_get_stat_int", + "steam_get_user_account_id", + "steam_get_user_persona_name", + "steam_get_user_steam_id", + "steam_initialised", + "steam_is_cloud_enabled_for_account", + "steam_is_cloud_enabled_for_app", + "steam_is_overlay_activated", + "steam_is_overlay_enabled", + "steam_is_screenshot_requested", + "steam_is_user_logged_on", + "steam_reset_all_stats", + "steam_reset_all_stats_achievements", + "steam_send_screenshot", + "steam_set_achievement", + "steam_set_stat_avg_rate", + "steam_set_stat_float", + "steam_set_stat_int", + "steam_stats_ready", + "steam_ugc_create_item", + "steam_ugc_create_query_all", + "steam_ugc_create_query_all_ex", + "steam_ugc_create_query_user", + "steam_ugc_create_query_user_ex", + "steam_ugc_download", + "steam_ugc_get_item_install_info", + "steam_ugc_get_item_update_info", + "steam_ugc_get_item_update_progress", + "steam_ugc_get_subscribed_items", + "steam_ugc_num_subscribed_items", + "steam_ugc_query_add_excluded_tag", + "steam_ugc_query_add_required_tag", + "steam_ugc_query_set_allow_cached_response", + "steam_ugc_query_set_cloud_filename_filter", + "steam_ugc_query_set_match_any_tag", + "steam_ugc_query_set_ranked_by_trend_days", + "steam_ugc_query_set_return_long_description", + "steam_ugc_query_set_return_total_only", + "steam_ugc_query_set_search_text", + "steam_ugc_request_item_details", + "steam_ugc_send_query", + "steam_ugc_set_item_content", + "steam_ugc_set_item_description", + "steam_ugc_set_item_preview", + "steam_ugc_set_item_tags", + "steam_ugc_set_item_title", + "steam_ugc_set_item_visibility", + "steam_ugc_start_item_update", + "steam_ugc_submit_item_update", + "steam_ugc_subscribe_item", + "steam_ugc_unsubscribe_item", + "steam_upload_score", + "steam_upload_score_buffer", + "steam_upload_score_buffer_ext", + "steam_upload_score_ext", + "steam_user_installed_dlc", + "steam_user_owns_dlc", + "string", + "string_byte_at", + "string_byte_length", + "string_char_at", + "string_copy", + "string_count", + "string_delete", + "string_digits", + "string_format", + "string_hash_to_newline", + "string_height", + "string_height_ext", + "string_insert", + "string_length", + "string_letters", + "string_lettersdigits", + "string_lower", + "string_ord_at", + "string_pos", + "string_repeat", + "string_replace", + "string_replace_all", + "string_set_byte_at", + "string_upper", + "string_width", + "string_width_ext", + "surface_copy", + "surface_copy_part", + "surface_create", + "surface_create_ext", + "surface_depth_disable", + "surface_exists", + "surface_free", + "surface_get_depth_disable", + "surface_get_height", + "surface_get_texture", + "surface_get_width", + "surface_getpixel", + "surface_getpixel_ext", + "surface_reset_target", + "surface_resize", + "surface_save", + "surface_save_part", + "surface_set_target", + "surface_set_target_ext", + "tan", + "texture_get_height", + "texture_get_texel_height", + "texture_get_texel_width", + "texture_get_uvs", + "texture_get_width", + "texture_global_scale", + "texture_set_stage", + "tile_get_empty", + "tile_get_flip", + "tile_get_index", + "tile_get_mirror", + "tile_get_rotate", + "tile_set_empty", + "tile_set_flip", + "tile_set_index", + "tile_set_mirror", + "tile_set_rotate", + "tilemap_clear", + "tilemap_get", + "tilemap_get_at_pixel", + "tilemap_get_cell_x_at_pixel", + "tilemap_get_cell_y_at_pixel", + "tilemap_get_frame", + "tilemap_get_global_mask", + "tilemap_get_height", + "tilemap_get_mask", + "tilemap_get_tile_height", + "tilemap_get_tile_width", + "tilemap_get_tileset", + "tilemap_get_width", + "tilemap_get_x", + "tilemap_get_y", + "tilemap_set", + "tilemap_set_at_pixel", + "tilemap_set_global_mask", + "tilemap_set_mask", + "tilemap_tileset", + "tilemap_x", + "tilemap_y", + "timeline_add", + "timeline_clear", + "timeline_delete", + "timeline_exists", + "timeline_get_name", + "timeline_max_moment", + "timeline_moment_add_script", + "timeline_moment_clear", + "timeline_size", + "typeof", + "url_get_domain", + "url_open", + "url_open_ext", + "url_open_full", + "variable_global_exists", + "variable_global_get", + "variable_global_set", + "variable_instance_exists", + "variable_instance_get", + "variable_instance_get_names", + "variable_instance_set", + "variable_struct_exists", + "variable_struct_get", + "variable_struct_get_names", + "variable_struct_names_count", + "variable_struct_remove", + "variable_struct_set", + "vertex_argb", + "vertex_begin", + "vertex_color", + "vertex_colour", + "vertex_create_buffer", + "vertex_create_buffer_ext", + "vertex_create_buffer_from_buffer", + "vertex_create_buffer_from_buffer_ext", + "vertex_delete_buffer", + "vertex_end", + "vertex_float1", + "vertex_float2", + "vertex_float3", + "vertex_float4", + "vertex_format_add_color", + "vertex_format_add_colour", + "vertex_format_add_custom", + "vertex_format_add_normal", + "vertex_format_add_position", + "vertex_format_add_position_3d", + "vertex_format_add_texcoord", + "vertex_format_add_textcoord", + "vertex_format_begin", + "vertex_format_delete", + "vertex_format_end", + "vertex_freeze", + "vertex_get_buffer_size", + "vertex_get_number", + "vertex_normal", + "vertex_position", + "vertex_position_3d", + "vertex_submit", + "vertex_texcoord", + "vertex_ubyte4", + "view_get_camera", + "view_get_hport", + "view_get_surface_id", + "view_get_visible", + "view_get_wport", + "view_get_xport", + "view_get_yport", + "view_set_camera", + "view_set_hport", + "view_set_surface_id", + "view_set_visible", + "view_set_wport", + "view_set_xport", + "view_set_yport", + "virtual_key_add", + "virtual_key_delete", + "virtual_key_hide", + "virtual_key_show", + "win8_appbar_add_element", + "win8_appbar_enable", + "win8_appbar_remove_element", + "win8_device_touchscreen_available", + "win8_license_initialize_sandbox", + "win8_license_trial_version", + "win8_livetile_badge_clear", + "win8_livetile_badge_notification", + "win8_livetile_notification_begin", + "win8_livetile_notification_end", + "win8_livetile_notification_expiry", + "win8_livetile_notification_image_add", + "win8_livetile_notification_secondary_begin", + "win8_livetile_notification_tag", + "win8_livetile_notification_text_add", + "win8_livetile_queue_enable", + "win8_livetile_tile_clear", + "win8_livetile_tile_notification", + "win8_search_add_suggestions", + "win8_search_disable", + "win8_search_enable", + "win8_secondarytile_badge_notification", + "win8_secondarytile_delete", + "win8_secondarytile_pin", + "win8_settingscharm_add_entry", + "win8_settingscharm_add_html_entry", + "win8_settingscharm_add_xaml_entry", + "win8_settingscharm_get_xaml_property", + "win8_settingscharm_remove_entry", + "win8_settingscharm_set_xaml_property", + "win8_share_file", + "win8_share_image", + "win8_share_screenshot", + "win8_share_text", + "win8_share_url", + "window_center", + "window_device", + "window_get_caption", + "window_get_color", + "window_get_colour", + "window_get_cursor", + "window_get_fullscreen", + "window_get_height", + "window_get_visible_rects", + "window_get_width", + "window_get_x", + "window_get_y", + "window_handle", + "window_has_focus", + "window_mouse_get_x", + "window_mouse_get_y", + "window_mouse_set", + "window_set_caption", + "window_set_color", + "window_set_colour", + "window_set_cursor", + "window_set_fullscreen", + "window_set_max_height", + "window_set_max_width", + "window_set_min_height", + "window_set_min_width", + "window_set_position", + "window_set_rectangle", + "window_set_size", + "window_view_mouse_get_x", + "window_view_mouse_get_y", + "window_views_mouse_get_x", + "window_views_mouse_get_y", + "winphone_license_trial_version", + "winphone_tile_back_content", + "winphone_tile_back_content_wide", + "winphone_tile_back_image", + "winphone_tile_back_image_wide", + "winphone_tile_back_title", + "winphone_tile_background_color", + "winphone_tile_background_colour", + "winphone_tile_count", + "winphone_tile_cycle_images", + "winphone_tile_front_image", + "winphone_tile_front_image_small", + "winphone_tile_front_image_wide", + "winphone_tile_icon_image", + "winphone_tile_small_background_image", + "winphone_tile_small_icon_image", + "winphone_tile_title", + "winphone_tile_wide_content", + "zip_unzip" + ]; + const LITERALS = [ + "all", + "false", + "noone", + "pointer_invalid", + "pointer_null", + "true", + "undefined" + ]; + // many of these look like enumerables to me (see comments below) + const SYMBOLS = [ + "ANSI_CHARSET", + "ARABIC_CHARSET", + "BALTIC_CHARSET", + "CHINESEBIG5_CHARSET", + "DEFAULT_CHARSET", + "EASTEUROPE_CHARSET", + "GB2312_CHARSET", + "GM_build_date", + "GM_runtime_version", + "GM_version", + "GREEK_CHARSET", + "HANGEUL_CHARSET", + "HEBREW_CHARSET", + "JOHAB_CHARSET", + "MAC_CHARSET", + "OEM_CHARSET", + "RUSSIAN_CHARSET", + "SHIFTJIS_CHARSET", + "SYMBOL_CHARSET", + "THAI_CHARSET", + "TURKISH_CHARSET", + "VIETNAMESE_CHARSET", + "achievement_achievement_info", + "achievement_filter_all_players", + "achievement_filter_favorites_only", + "achievement_filter_friends_only", + "achievement_friends_info", + "achievement_leaderboard_info", + "achievement_our_info", + "achievement_pic_loaded", + "achievement_show_achievement", + "achievement_show_bank", + "achievement_show_friend_picker", + "achievement_show_leaderboard", + "achievement_show_profile", + "achievement_show_purchase_prompt", + "achievement_show_ui", + "achievement_type_achievement_challenge", + "achievement_type_score_challenge", + "asset_font", + "asset_object", + "asset_path", + "asset_room", + "asset_script", + "asset_shader", + "asset_sound", + "asset_sprite", + "asset_tiles", + "asset_timeline", + "asset_unknown", + "audio_3d", + "audio_falloff_exponent_distance", + "audio_falloff_exponent_distance_clamped", + "audio_falloff_inverse_distance", + "audio_falloff_inverse_distance_clamped", + "audio_falloff_linear_distance", + "audio_falloff_linear_distance_clamped", + "audio_falloff_none", + "audio_mono", + "audio_new_system", + "audio_old_system", + "audio_stereo", + "bm_add", + "bm_complex", + "bm_dest_alpha", + "bm_dest_color", + "bm_dest_colour", + "bm_inv_dest_alpha", + "bm_inv_dest_color", + "bm_inv_dest_colour", + "bm_inv_src_alpha", + "bm_inv_src_color", + "bm_inv_src_colour", + "bm_max", + "bm_normal", + "bm_one", + "bm_src_alpha", + "bm_src_alpha_sat", + "bm_src_color", + "bm_src_colour", + "bm_subtract", + "bm_zero", + "browser_chrome", + "browser_edge", + "browser_firefox", + "browser_ie", + "browser_ie_mobile", + "browser_not_a_browser", + "browser_opera", + "browser_safari", + "browser_safari_mobile", + "browser_tizen", + "browser_unknown", + "browser_windows_store", + "buffer_bool", + "buffer_f16", + "buffer_f32", + "buffer_f64", + "buffer_fast", + "buffer_fixed", + "buffer_generalerror", + "buffer_grow", + "buffer_invalidtype", + "buffer_network", + "buffer_outofbounds", + "buffer_outofspace", + "buffer_s16", + "buffer_s32", + "buffer_s8", + "buffer_seek_end", + "buffer_seek_relative", + "buffer_seek_start", + "buffer_string", + "buffer_surface_copy", + "buffer_text", + "buffer_u16", + "buffer_u32", + "buffer_u64", + "buffer_u8", + "buffer_vbuffer", + "buffer_wrap", + "button_type", "c_aqua", "c_black", "c_blue", @@ -2095,503 +2027,582 @@ export default function(hljs) { "c_maroon", "c_navy", "c_olive", + "c_orange", "c_purple", "c_red", "c_silver", "c_teal", "c_white", "c_yellow", - "c_orange", - "fa_left", - "fa_center", - "fa_right", - "fa_top", - "fa_middle", - "fa_bottom", - "pr_pointlist", - "pr_linelist", - "pr_linestrip", - "pr_trianglelist", - "pr_trianglestrip", - "pr_trianglefan", - "bm_complex", - "bm_normal", - "bm_add", - "bm_max", - "bm_subtract", - "bm_zero", - "bm_one", - "bm_src_colour", - "bm_inv_src_colour", - "bm_src_color", - "bm_inv_src_color", - "bm_src_alpha", - "bm_inv_src_alpha", - "bm_dest_alpha", - "bm_inv_dest_alpha", - "bm_dest_colour", - "bm_inv_dest_colour", - "bm_dest_color", - "bm_inv_dest_color", - "bm_src_alpha_sat", - "tf_point", - "tf_linear", - "tf_anisotropic", - "mip_off", - "mip_on", - "mip_markedonly", - "audio_falloff_none", - "audio_falloff_inverse_distance", - "audio_falloff_inverse_distance_clamped", - "audio_falloff_linear_distance", - "audio_falloff_linear_distance_clamped", - "audio_falloff_exponent_distance", - "audio_falloff_exponent_distance_clamped", - "audio_old_system", - "audio_new_system", - "audio_mono", - "audio_stereo", - "audio_3d", - "cr_default", - "cr_none", + "cmpfunc_always", + "cmpfunc_equal", + "cmpfunc_greater", + "cmpfunc_greaterequal", + "cmpfunc_less", + "cmpfunc_lessequal", + "cmpfunc_never", + "cmpfunc_notequal", + "cr_appstart", "cr_arrow", - "cr_cross", "cr_beam", + "cr_cross", + "cr_default", + "cr_drag", + "cr_handpoint", + "cr_hourglass", + "cr_none", + "cr_size_all", "cr_size_nesw", "cr_size_ns", "cr_size_nwse", "cr_size_we", "cr_uparrow", - "cr_hourglass", - "cr_drag", - "cr_appstart", - "cr_handpoint", - "cr_size_all", - "spritespeed_framespersecond", - "spritespeed_framespergameframe", - "asset_object", - "asset_unknown", - "asset_sprite", - "asset_sound", - "asset_room", - "asset_path", - "asset_script", - "asset_font", - "asset_timeline", - "asset_tiles", - "asset_shader", - "fa_readonly", + "cull_clockwise", + "cull_counterclockwise", + "cull_noculling", + "device_emulator", + "device_ios_ipad", + "device_ios_ipad_retina", + "device_ios_iphone", + "device_ios_iphone5", + "device_ios_iphone6", + "device_ios_iphone6plus", + "device_ios_iphone_retina", + "device_ios_unknown", + "device_tablet", + "display_landscape", + "display_landscape_flipped", + "display_portrait", + "display_portrait_flipped", + "dll_cdecl", + "dll_stdcall", + "ds_type_grid", + "ds_type_list", + "ds_type_map", + "ds_type_priority", + "ds_type_queue", + "ds_type_stack", + "ef_cloud", + "ef_ellipse", + "ef_explosion", + "ef_firework", + "ef_flare", + "ef_rain", + "ef_ring", + "ef_smoke", + "ef_smokeup", + "ef_snow", + "ef_spark", + "ef_star", + // for example ev_ are types of events + "ev_alarm", + "ev_animation_end", + "ev_boundary", + "ev_cleanup", + "ev_close_button", + "ev_collision", + "ev_create", + "ev_destroy", + "ev_draw", + "ev_draw_begin", + "ev_draw_end", + "ev_draw_post", + "ev_draw_pre", + "ev_end_of_path", + "ev_game_end", + "ev_game_start", + "ev_gesture", + "ev_gesture_double_tap", + "ev_gesture_drag_end", + "ev_gesture_drag_start", + "ev_gesture_dragging", + "ev_gesture_flick", + "ev_gesture_pinch_end", + "ev_gesture_pinch_in", + "ev_gesture_pinch_out", + "ev_gesture_pinch_start", + "ev_gesture_rotate_end", + "ev_gesture_rotate_start", + "ev_gesture_rotating", + "ev_gesture_tap", + "ev_global_gesture_double_tap", + "ev_global_gesture_drag_end", + "ev_global_gesture_drag_start", + "ev_global_gesture_dragging", + "ev_global_gesture_flick", + "ev_global_gesture_pinch_end", + "ev_global_gesture_pinch_in", + "ev_global_gesture_pinch_out", + "ev_global_gesture_pinch_start", + "ev_global_gesture_rotate_end", + "ev_global_gesture_rotate_start", + "ev_global_gesture_rotating", + "ev_global_gesture_tap", + "ev_global_left_button", + "ev_global_left_press", + "ev_global_left_release", + "ev_global_middle_button", + "ev_global_middle_press", + "ev_global_middle_release", + "ev_global_right_button", + "ev_global_right_press", + "ev_global_right_release", + "ev_gui", + "ev_gui_begin", + "ev_gui_end", + "ev_joystick1_button1", + "ev_joystick1_button2", + "ev_joystick1_button3", + "ev_joystick1_button4", + "ev_joystick1_button5", + "ev_joystick1_button6", + "ev_joystick1_button7", + "ev_joystick1_button8", + "ev_joystick1_down", + "ev_joystick1_left", + "ev_joystick1_right", + "ev_joystick1_up", + "ev_joystick2_button1", + "ev_joystick2_button2", + "ev_joystick2_button3", + "ev_joystick2_button4", + "ev_joystick2_button5", + "ev_joystick2_button6", + "ev_joystick2_button7", + "ev_joystick2_button8", + "ev_joystick2_down", + "ev_joystick2_left", + "ev_joystick2_right", + "ev_joystick2_up", + "ev_keyboard", + "ev_keypress", + "ev_keyrelease", + "ev_left_button", + "ev_left_press", + "ev_left_release", + "ev_middle_button", + "ev_middle_press", + "ev_middle_release", + "ev_mouse", + "ev_mouse_enter", + "ev_mouse_leave", + "ev_mouse_wheel_down", + "ev_mouse_wheel_up", + "ev_no_button", + "ev_no_more_health", + "ev_no_more_lives", + "ev_other", + "ev_outside", + "ev_right_button", + "ev_right_press", + "ev_right_release", + "ev_room_end", + "ev_room_start", + "ev_step", + "ev_step_begin", + "ev_step_end", + "ev_step_normal", + "ev_trigger", + "ev_user0", + "ev_user1", + "ev_user2", + "ev_user3", + "ev_user4", + "ev_user5", + "ev_user6", + "ev_user7", + "ev_user8", + "ev_user9", + "ev_user10", + "ev_user11", + "ev_user12", + "ev_user13", + "ev_user14", + "ev_user15", + "fa_archive", + "fa_bottom", + "fa_center", + "fa_directory", "fa_hidden", + "fa_left", + "fa_middle", + "fa_readonly", + "fa_right", "fa_sysfile", + "fa_top", "fa_volumeid", - "fa_directory", - "fa_archive", - "ds_type_map", - "ds_type_list", - "ds_type_stack", - "ds_type_queue", - "ds_type_grid", - "ds_type_priority", - "ef_explosion", - "ef_ring", - "ef_ellipse", - "ef_firework", - "ef_smoke", - "ef_smokeup", - "ef_star", - "ef_spark", - "ef_flare", - "ef_cloud", - "ef_rain", - "ef_snow", - "pt_shape_pixel", - "pt_shape_disk", - "pt_shape_square", - "pt_shape_line", - "pt_shape_star", - "pt_shape_circle", - "pt_shape_ring", - "pt_shape_sphere", - "pt_shape_flare", - "pt_shape_spark", - "pt_shape_explosion", - "pt_shape_cloud", - "pt_shape_smoke", - "pt_shape_snow", - "ps_distr_linear", - "ps_distr_gaussian", - "ps_distr_invgaussian", - "ps_shape_rectangle", - "ps_shape_ellipse", - "ps_shape_diamond", - "ps_shape_line", - "ty_real", - "ty_string", - "dll_cdecl", - "dll_stdcall", - "matrix_view", - "matrix_projection", - "matrix_world", - "os_win32", - "os_windows", - "os_macosx", - "os_ios", - "os_android", - "os_symbian", - "os_linux", - "os_unknown", - "os_winphone", - "os_tizen", - "os_win8native", - "os_wiiu", - "os_3ds", - "os_psvita", - "os_bb10", - "os_ps4", - "os_xboxone", - "os_ps3", - "os_xbox360", - "os_uwp", - "os_tvos", - "os_switch", - "browser_not_a_browser", - "browser_unknown", - "browser_ie", - "browser_firefox", - "browser_chrome", - "browser_safari", - "browser_safari_mobile", - "browser_opera", - "browser_tizen", - "browser_edge", - "browser_windows_store", - "browser_ie_mobile", - "device_ios_unknown", - "device_ios_iphone", - "device_ios_iphone_retina", - "device_ios_ipad", - "device_ios_ipad_retina", - "device_ios_iphone5", - "device_ios_iphone6", - "device_ios_iphone6plus", - "device_emulator", - "device_tablet", - "display_landscape", - "display_landscape_flipped", - "display_portrait", - "display_portrait_flipped", - "tm_sleep", - "tm_countvsyncs", - "of_challenge_win", - "of_challen", + "fb_login_default", + "fb_login_fallback_to_webview", + "fb_login_forcing_safari", + "fb_login_forcing_webview", + "fb_login_no_fallback_to_webview", + "fb_login_use_system_account", + "gamespeed_fps", + "gamespeed_microseconds", "ge_lose", - "of_challenge_tie", - "leaderboard_type_number", - "leaderboard_type_time_mins_secs", - "cmpfunc_never", - "cmpfunc_less", - "cmpfunc_equal", - "cmpfunc_lessequal", - "cmpfunc_greater", - "cmpfunc_notequal", - "cmpfunc_greaterequal", - "cmpfunc_always", - "cull_noculling", - "cull_clockwise", - "cull_counterclockwise", - "lighttype_dir", - "lighttype_point", - "iap_ev_storeload", + "global", + "gp_axislh", + "gp_axislv", + "gp_axisrh", + "gp_axisrv", + "gp_face1", + "gp_face2", + "gp_face3", + "gp_face4", + "gp_padd", + "gp_padl", + "gp_padr", + "gp_padu", + "gp_select", + "gp_shoulderl", + "gp_shoulderlb", + "gp_shoulderr", + "gp_shoulderrb", + "gp_start", + "gp_stickl", + "gp_stickr", + "iap_available", + "iap_canceled", + "iap_ev_consume", "iap_ev_product", "iap_ev_purchase", - "iap_ev_consume", "iap_ev_restore", - "iap_storeload_ok", - "iap_storeload_failed", - "iap_status_uninitialised", - "iap_status_unavailable", - "iap_status_loading", + "iap_ev_storeload", + "iap_failed", + "iap_purchased", + "iap_refunded", "iap_status_available", + "iap_status_loading", "iap_status_processing", "iap_status_restoring", - "iap_failed", + "iap_status_unavailable", + "iap_status_uninitialised", + "iap_storeload_failed", + "iap_storeload_ok", "iap_unavailable", - "iap_available", - "iap_purchased", - "iap_canceled", - "iap_refunded", - "fb_login_default", - "fb_login_fallback_to_webview", - "fb_login_no_fallback_to_webview", - "fb_login_forcing_webview", - "fb_login_use_system_account", - "fb_login_forcing_safari", + "input_type", + "kbv_autocapitalize_characters", + "kbv_autocapitalize_none", + "kbv_autocapitalize_sentences", + "kbv_autocapitalize_words", + "kbv_returnkey_continue", + "kbv_returnkey_default", + "kbv_returnkey_done", + "kbv_returnkey_emergency", + "kbv_returnkey_go", + "kbv_returnkey_google", + "kbv_returnkey_join", + "kbv_returnkey_next", + "kbv_returnkey_route", + "kbv_returnkey_search", + "kbv_returnkey_send", + "kbv_returnkey_yahoo", + "kbv_type_ascii", + "kbv_type_default", + "kbv_type_email", + "kbv_type_numbers", + "kbv_type_phone", + "kbv_type_phone_name", + "kbv_type_url", + "layerelementtype_background", + "layerelementtype_instance", + "layerelementtype_oldtilemap", + "layerelementtype_particlesystem", + "layerelementtype_sprite", + "layerelementtype_tile", + "layerelementtype_tilemap", + "layerelementtype_undefined", + "lb_disp_none", + "lb_disp_numeric", + "lb_disp_time_ms", + "lb_disp_time_sec", + "lb_sort_ascending", + "lb_sort_descending", + "lb_sort_none", + "leaderboard_type_number", + "leaderboard_type_time_mins_secs", + "lighttype_dir", + "lighttype_point", + "local", + "matrix_projection", + "matrix_view", + "matrix_world", + "mb_any", + "mb_left", + "mb_middle", + "mb_none", + "mb_right", + "mip_markedonly", + "mip_off", + "mip_on", + "network_config_connect_timeout", + "network_config_disable_reliable_udp", + "network_config_enable_reliable_udp", + "network_config_use_non_blocking_socket", + "network_socket_bluetooth", + "network_socket_tcp", + "network_socket_udp", + "network_type_connect", + "network_type_data", + "network_type_disconnect", + "network_type_non_blocking_connect", + "of_challen", + "of_challenge_tie", + "of_challenge_win", + "os_3ds", + "os_android", + "os_bb10", + "os_ios", + "os_linux", + "os_macosx", + "os_ps3", + "os_ps4", + "os_psvita", + "os_switch", + "os_symbian", + "os_tizen", + "os_tvos", + "os_unknown", + "os_uwp", + "os_wiiu", + "os_win32", + "os_win8native", + "os_windows", + "os_winphone", + "os_xbox360", + "os_xboxone", + "other", + "ov_achievements", + "ov_community", + "ov_friends", + "ov_gamegroup", + "ov_players", + "ov_settings", + "path_action_continue", + "path_action_restart", + "path_action_reverse", + "path_action_stop", + "phy_debug_render_aabb", + "phy_debug_render_collision_pairs", + "phy_debug_render_coms", + "phy_debug_render_core_shapes", + "phy_debug_render_joints", + "phy_debug_render_obb", + "phy_debug_render_shapes", "phy_joint_anchor_1_x", "phy_joint_anchor_1_y", "phy_joint_anchor_2_x", "phy_joint_anchor_2_y", - "phy_joint_reaction_force_x", - "phy_joint_reaction_force_y", - "phy_joint_reaction_torque", - "phy_joint_motor_speed", "phy_joint_angle", - "phy_joint_motor_torque", - "phy_joint_max_motor_torque", - "phy_joint_translation", - "phy_joint_speed", - "phy_joint_motor_force", - "phy_joint_max_motor_force", - "phy_joint_length_1", - "phy_joint_length_2", + "phy_joint_angle_limits", "phy_joint_damping_ratio", "phy_joint_frequency", + "phy_joint_length_1", + "phy_joint_length_2", "phy_joint_lower_angle_limit", - "phy_joint_upper_angle_limit", - "phy_joint_angle_limits", + "phy_joint_max_force", "phy_joint_max_length", + "phy_joint_max_motor_force", + "phy_joint_max_motor_torque", "phy_joint_max_torque", - "phy_joint_max_force", - "phy_debug_render_aabb", - "phy_debug_render_collision_pairs", - "phy_debug_render_coms", - "phy_debug_render_core_shapes", - "phy_debug_render_joints", - "phy_debug_render_obb", - "phy_debug_render_shapes", - "phy_particle_flag_water", - "phy_particle_flag_zombie", - "phy_particle_flag_wall", - "phy_particle_flag_spring", + "phy_joint_motor_force", + "phy_joint_motor_speed", + "phy_joint_motor_torque", + "phy_joint_reaction_force_x", + "phy_joint_reaction_force_y", + "phy_joint_reaction_torque", + "phy_joint_speed", + "phy_joint_translation", + "phy_joint_upper_angle_limit", + "phy_particle_data_flag_category", + "phy_particle_data_flag_color", + "phy_particle_data_flag_colour", + "phy_particle_data_flag_position", + "phy_particle_data_flag_typeflags", + "phy_particle_data_flag_velocity", + "phy_particle_flag_colormixing", + "phy_particle_flag_colourmixing", "phy_particle_flag_elastic", - "phy_particle_flag_viscous", "phy_particle_flag_powder", + "phy_particle_flag_spring", "phy_particle_flag_tensile", - "phy_particle_flag_colourmixing", - "phy_particle_flag_colormixing", - "phy_particle_group_flag_solid", + "phy_particle_flag_viscous", + "phy_particle_flag_wall", + "phy_particle_flag_water", + "phy_particle_flag_zombie", "phy_particle_group_flag_rigid", - "phy_particle_data_flag_typeflags", - "phy_particle_data_flag_position", - "phy_particle_data_flag_velocity", - "phy_particle_data_flag_colour", - "phy_particle_data_flag_color", - "phy_particle_data_flag_category", - "achievement_our_info", - "achievement_friends_info", - "achievement_leaderboard_info", - "achievement_achievement_info", - "achievement_filter_all_players", - "achievement_filter_friends_only", - "achievement_filter_favorites_only", - "achievement_type_achievement_challenge", - "achievement_type_score_challenge", - "achievement_pic_loaded", - "achievement_show_ui", - "achievement_show_profile", - "achievement_show_leaderboard", - "achievement_show_achievement", - "achievement_show_bank", - "achievement_show_friend_picker", - "achievement_show_purchase_prompt", - "network_socket_tcp", - "network_socket_udp", - "network_socket_bluetooth", - "network_type_connect", - "network_type_disconnect", - "network_type_data", - "network_type_non_blocking_connect", - "network_config_connect_timeout", - "network_config_use_non_blocking_socket", - "network_config_enable_reliable_udp", - "network_config_disable_reliable_udp", - "buffer_fixed", - "buffer_grow", - "buffer_wrap", - "buffer_fast", - "buffer_vbuffer", - "buffer_network", - "buffer_u8", - "buffer_s8", - "buffer_u16", - "buffer_s16", - "buffer_u32", - "buffer_s32", - "buffer_u64", - "buffer_f16", - "buffer_f32", - "buffer_f64", - "buffer_bool", - "buffer_text", - "buffer_string", - "buffer_surface_copy", - "buffer_seek_start", - "buffer_seek_relative", - "buffer_seek_end", - "buffer_generalerror", - "buffer_outofspace", - "buffer_outofbounds", - "buffer_invalidtype", - "text_type", - "button_type", - "input_type", - "ANSI_CHARSET", - "DEFAULT_CHARSET", - "EASTEUROPE_CHARSET", - "RUSSIAN_CHARSET", - "SYMBOL_CHARSET", - "SHIFTJIS_CHARSET", - "HANGEUL_CHARSET", - "GB2312_CHARSET", - "CHINESEBIG5_CHARSET", - "JOHAB_CHARSET", - "HEBREW_CHARSET", - "ARABIC_CHARSET", - "GREEK_CHARSET", - "TURKISH_CHARSET", - "VIETNAMESE_CHARSET", - "THAI_CHARSET", - "MAC_CHARSET", - "BALTIC_CHARSET", - "OEM_CHARSET", - "gp_face1", - "gp_face2", - "gp_face3", - "gp_face4", - "gp_shoulderl", - "gp_shoulderr", - "gp_shoulderlb", - "gp_shoulderrb", - "gp_select", - "gp_start", - "gp_stickl", - "gp_stickr", - "gp_padu", - "gp_padd", - "gp_padl", - "gp_padr", - "gp_axislh", - "gp_axislv", - "gp_axisrh", - "gp_axisrv", - "ov_friends", - "ov_community", - "ov_players", - "ov_settings", - "ov_gamegroup", - "ov_achievements", - "lb_sort_none", - "lb_sort_ascending", - "lb_sort_descending", - "lb_disp_none", - "lb_disp_numeric", - "lb_disp_time_sec", - "lb_disp_time_ms", - "ugc_result_success", + "phy_particle_group_flag_solid", + "pi", + "pr_linelist", + "pr_linestrip", + "pr_pointlist", + "pr_trianglefan", + "pr_trianglelist", + "pr_trianglestrip", + "ps_distr_gaussian", + "ps_distr_invgaussian", + "ps_distr_linear", + "ps_shape_diamond", + "ps_shape_ellipse", + "ps_shape_line", + "ps_shape_rectangle", + "pt_shape_circle", + "pt_shape_cloud", + "pt_shape_disk", + "pt_shape_explosion", + "pt_shape_flare", + "pt_shape_line", + "pt_shape_pixel", + "pt_shape_ring", + "pt_shape_smoke", + "pt_shape_snow", + "pt_shape_spark", + "pt_shape_sphere", + "pt_shape_square", + "pt_shape_star", + "spritespeed_framespergameframe", + "spritespeed_framespersecond", + "text_type", + "tf_anisotropic", + "tf_linear", + "tf_point", + "tile_flip", + "tile_index_mask", + "tile_mirror", + "tile_rotate", + "timezone_local", + "timezone_utc", + "tm_countvsyncs", + "tm_sleep", + "ty_real", + "ty_string", "ugc_filetype_community", "ugc_filetype_microtrans", - "ugc_visibility_public", - "ugc_visibility_friends_only", - "ugc_visibility_private", - "ugc_query_RankedByVote", - "ugc_query_RankedByPublicationDate", - "ugc_query_AcceptedForGameRankedByAcceptanceDate", - "ugc_query_RankedByTrend", - "ugc_query_FavoritedByFriendsRankedByPublicationDate", - "ugc_query_CreatedByFriendsRankedByPublicationDate", - "ugc_query_RankedByNumTimesReported", - "ugc_query_CreatedByFollowedUsersRankedByPublicationDate", - "ugc_query_NotYetRated", - "ugc_query_RankedByTotalVotesAsc", - "ugc_query_RankedByVotesUp", - "ugc_query_RankedByTextSearch", - "ugc_sortorder_CreationOrderDesc", - "ugc_sortorder_CreationOrderAsc", - "ugc_sortorder_TitleAsc", - "ugc_sortorder_LastUpdatedDesc", - "ugc_sortorder_SubscriptionDateDesc", - "ugc_sortorder_VoteScoreDesc", - "ugc_sortorder_ForModeration", + "ugc_list_Favorited", + "ugc_list_Followed", "ugc_list_Published", + "ugc_list_Subscribed", + "ugc_list_UsedOrPlayed", + "ugc_list_VotedDown", "ugc_list_VotedOn", "ugc_list_VotedUp", - "ugc_list_VotedDown", "ugc_list_WillVoteLater", - "ugc_list_Favorited", - "ugc_list_Subscribed", - "ugc_list_UsedOrPlayed", - "ugc_list_Followed", + "ugc_match_AllGuides", + "ugc_match_Artwork", + "ugc_match_Collections", + "ugc_match_ControllerBindings", + "ugc_match_IntegratedGuides", "ugc_match_Items", "ugc_match_Items_Mtx", "ugc_match_Items_ReadyToUse", - "ugc_match_Collections", - "ugc_match_Artwork", - "ugc_match_Videos", "ugc_match_Screenshots", - "ugc_match_AllGuides", - "ugc_match_WebGuides", - "ugc_match_IntegratedGuides", "ugc_match_UsableInGame", - "ugc_match_ControllerBindings", - "vertex_usage_position", - "vertex_usage_colour", - "vertex_usage_color", - "vertex_usage_normal", - "vertex_usage_texcoord", - "vertex_usage_textcoord", - "vertex_usage_blendweight", - "vertex_usage_blendindices", - "vertex_usage_psize", - "vertex_usage_tangent", - "vertex_usage_binormal", - "vertex_usage_fog", - "vertex_usage_depth", - "vertex_usage_sample", + "ugc_match_Videos", + "ugc_match_WebGuides", + "ugc_query_AcceptedForGameRankedByAcceptanceDate", + "ugc_query_CreatedByFollowedUsersRankedByPublicationDate", + "ugc_query_CreatedByFriendsRankedByPublicationDate", + "ugc_query_FavoritedByFriendsRankedByPublicationDate", + "ugc_query_NotYetRated", + "ugc_query_RankedByNumTimesReported", + "ugc_query_RankedByPublicationDate", + "ugc_query_RankedByTextSearch", + "ugc_query_RankedByTotalVotesAsc", + "ugc_query_RankedByTrend", + "ugc_query_RankedByVote", + "ugc_query_RankedByVotesUp", + "ugc_result_success", + "ugc_sortorder_CreationOrderAsc", + "ugc_sortorder_CreationOrderDesc", + "ugc_sortorder_ForModeration", + "ugc_sortorder_LastUpdatedDesc", + "ugc_sortorder_SubscriptionDateDesc", + "ugc_sortorder_TitleAsc", + "ugc_sortorder_VoteScoreDesc", + "ugc_visibility_friends_only", + "ugc_visibility_private", + "ugc_visibility_public", + "vertex_type_color", + "vertex_type_colour", "vertex_type_float1", "vertex_type_float2", "vertex_type_float3", "vertex_type_float4", - "vertex_type_colour", - "vertex_type_color", "vertex_type_ubyte4", - "layerelementtype_undefined", - "layerelementtype_background", - "layerelementtype_instance", - "layerelementtype_oldtilemap", - "layerelementtype_sprite", - "layerelementtype_tilemap", - "layerelementtype_particlesystem", - "layerelementtype_tile", - "tile_rotate", - "tile_flip", - "tile_mirror", - "tile_index_mask", - "kbv_type_default", - "kbv_type_ascii", - "kbv_type_url", - "kbv_type_email", - "kbv_type_numbers", - "kbv_type_phone", - "kbv_type_phone_name", - "kbv_returnkey_default", - "kbv_returnkey_go", - "kbv_returnkey_google", - "kbv_returnkey_join", - "kbv_returnkey_next", - "kbv_returnkey_route", - "kbv_returnkey_search", - "kbv_returnkey_send", - "kbv_returnkey_yahoo", - "kbv_returnkey_done", - "kbv_returnkey_continue", - "kbv_returnkey_emergency", - "kbv_autocapitalize_none", - "kbv_autocapitalize_words", - "kbv_autocapitalize_sentences", - "kbv_autocapitalize_characters" + "vertex_usage_binormal", + "vertex_usage_blendindices", + "vertex_usage_blendweight", + "vertex_usage_color", + "vertex_usage_colour", + "vertex_usage_depth", + "vertex_usage_fog", + "vertex_usage_normal", + "vertex_usage_position", + "vertex_usage_psize", + "vertex_usage_sample", + "vertex_usage_tangent", + "vertex_usage_texcoord", + "vertex_usage_textcoord", + "vk_add", + "vk_alt", + "vk_anykey", + "vk_backspace", + "vk_control", + "vk_decimal", + "vk_delete", + "vk_divide", + "vk_down", + "vk_end", + "vk_enter", + "vk_escape", + "vk_f1", + "vk_f2", + "vk_f3", + "vk_f4", + "vk_f5", + "vk_f6", + "vk_f7", + "vk_f8", + "vk_f9", + "vk_f10", + "vk_f11", + "vk_f12", + "vk_home", + "vk_insert", + "vk_lalt", + "vk_lcontrol", + "vk_left", + "vk_lshift", + "vk_multiply", + "vk_nokey", + "vk_numpad0", + "vk_numpad1", + "vk_numpad2", + "vk_numpad3", + "vk_numpad4", + "vk_numpad5", + "vk_numpad6", + "vk_numpad7", + "vk_numpad8", + "vk_numpad9", + "vk_pagedown", + "vk_pageup", + "vk_pause", + "vk_printscreen", + "vk_ralt", + "vk_rcontrol", + "vk_return", + "vk_right", + "vk_rshift", + "vk_shift", + "vk_space", + "vk_subtract", + "vk_tab", + "vk_up" ]; const LANGUAGE_VARIABLES = [ - "self", - "argument_relative", + "alarm", + "application_surface", "argument", "argument0", "argument1", @@ -2610,176 +2621,176 @@ export default function(hljs) { "argument14", "argument15", "argument_count", - "x|0", - "y|0", - "xprevious", - "yprevious", - "xstart", - "ystart", - "hspeed", - "vspeed", + "argument_relative", + "async_load", + "background_color", + "background_colour", + "background_showcolor", + "background_showcolour", + "bbox_bottom", + "bbox_left", + "bbox_right", + "bbox_top", + "browser_height", + "browser_width", + "caption_health", + "caption_lives", + "caption_score", + "current_day", + "current_hour", + "current_minute", + "current_month", + "current_second", + "current_time", + "current_weekday", + "current_year", + "cursor_sprite", + "debug_mode", + "delta_time", + "depth", "direction", - "speed", + "display_aa", + "error_last", + "error_occurred", + "event_action", + "event_data", + "event_number", + "event_object", + "event_type", + "fps", + "fps_real", "friction", + "game_display_name", + "game_id", + "game_project_name", + "game_save_id", + "gamemaker_pro", + "gamemaker_registered", + "gamemaker_version", "gravity", "gravity_direction", + "health", + "hspeed", + "iap_data", + "id|0", + "image_alpha", + "image_angle", + "image_blend", + "image_index", + "image_number", + "image_speed", + "image_xscale", + "image_yscale", + "instance_count", + "instance_id", + "keyboard_key", + "keyboard_lastchar", + "keyboard_lastkey", + "keyboard_string", + "layer", + "lives", + "mask_index", + "mouse_button", + "mouse_lastbutton", + "mouse_x", + "mouse_y", + "object_index", + "os_browser", + "os_device", + "os_type", + "os_version", + "path_endaction", "path_index", + "path_orientation", "path_position", "path_positionprevious", - "path_speed", "path_scale", - "path_orientation", - "path_endaction", - "object_index", - "id|0", - "solid", + "path_speed", "persistent", - "mask_index", - "instance_count", - "instance_id", - "room_speed", - "fps", - "fps_real", - "current_time", - "current_year", - "current_month", - "current_day", - "current_weekday", - "current_hour", - "current_minute", - "current_second", - "alarm", - "timeline_index", - "timeline_position", - "timeline_speed", - "timeline_running", - "timeline_loop", + "phy_active", + "phy_angular_damping", + "phy_angular_velocity", + "phy_bullet", + "phy_col_normal_x", + "phy_col_normal_y", + "phy_collision_points", + "phy_collision_x", + "phy_collision_y", + "phy_com_x", + "phy_com_y", + "phy_dynamic", + "phy_fixed_rotation", + "phy_inertia", + "phy_kinematic", + "phy_linear_damping", + "phy_linear_velocity_x", + "phy_linear_velocity_y", + "phy_mass", + "phy_position_x", + "phy_position_xprevious", + "phy_position_y", + "phy_position_yprevious", + "phy_rotation", + "phy_sleeping", + "phy_speed", + "phy_speed_x", + "phy_speed_y", + "program_directory", "room", + "room_caption", "room_first", - "room_last", - "room_width", "room_height", - "room_caption", + "room_last", "room_persistent", + "room_speed", + "room_width", "score", - "lives", - "health", - "show_score", - "show_lives", + "self", "show_health", - "caption_score", - "caption_lives", - "caption_health", - "event_type", - "event_number", - "event_object", - "event_action", - "application_surface", - "gamemaker_pro", - "gamemaker_registered", - "gamemaker_version", - "error_occurred", - "error_last", - "debug_mode", - "keyboard_key", - "keyboard_lastkey", - "keyboard_lastchar", - "keyboard_string", - "mouse_x", - "mouse_y", - "mouse_button", - "mouse_lastbutton", - "cursor_sprite", - "visible", + "show_lives", + "show_score", + "solid", + "speed", + "sprite_height", "sprite_index", "sprite_width", - "sprite_height", "sprite_xoffset", "sprite_yoffset", - "image_number", - "image_index", - "image_speed", - "depth", - "image_xscale", - "image_yscale", - "image_angle", - "image_alpha", - "image_blend", - "bbox_left", - "bbox_right", - "bbox_top", - "bbox_bottom", - "layer", - "background_colour", - "background_showcolour", - "background_color", - "background_showcolor", - "view_enabled", - "view_current", - "view_visible", - "view_xview", - "view_yview", - "view_wview", - "view_hview", - "view_xport", - "view_yport", - "view_wport", - "view_hport", + "temp_directory", + "timeline_index", + "timeline_loop", + "timeline_position", + "timeline_running", + "timeline_speed", "view_angle", + "view_camera", + "view_current", + "view_enabled", "view_hborder", - "view_vborder", + "view_hport", "view_hspeed", - "view_vspeed", + "view_hview", "view_object", "view_surface_id", - "view_camera", - "game_id", - "game_display_name", - "game_project_name", - "game_save_id", - "working_directory", - "temp_directory", - "program_directory", - "browser_width", - "browser_height", - "os_type", - "os_device", - "os_browser", - "os_version", - "display_aa", - "async_load", - "delta_time", + "view_vborder", + "view_visible", + "view_vspeed", + "view_wport", + "view_wview", + "view_xport", + "view_xview", + "view_yport", + "view_yview", + "visible", + "vspeed", "webgl_enabled", - "event_data", - "iap_data", - "phy_rotation", - "phy_position_x", - "phy_position_y", - "phy_angular_velocity", - "phy_linear_velocity_x", - "phy_linear_velocity_y", - "phy_speed_x", - "phy_speed_y", - "phy_speed", - "phy_angular_damping", - "phy_linear_damping", - "phy_bullet", - "phy_fixed_rotation", - "phy_active", - "phy_mass", - "phy_inertia", - "phy_com_x", - "phy_com_y", - "phy_dynamic", - "phy_kinematic", - "phy_sleeping", - "phy_collision_points", - "phy_collision_x", - "phy_collision_y", - "phy_col_normal_x", - "phy_col_normal_y", - "phy_position_xprevious", - "phy_position_yprevious" + "working_directory", + "xprevious", + "xstart", + "x|0", + "yprevious", + "ystart", + "y|0" ]; return { From 2180d1db705c6c5ce818a08c277635c2fc24db6d Mon Sep 17 00:00:00 2001 From: Thomas Pani Date: Wed, 13 Jul 2022 14:16:49 +0200 Subject: [PATCH 196/227] (chore) Fix repo URL (#3579) --- extra/3RD_PARTY_QUICK_START.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/3RD_PARTY_QUICK_START.md b/extra/3RD_PARTY_QUICK_START.md index 691685f54e..9bbf5b7d84 100644 --- a/extra/3RD_PARTY_QUICK_START.md +++ b/extra/3RD_PARTY_QUICK_START.md @@ -7,7 +7,7 @@ So you'd like to create and share your own language definition for Highlight.js. - [ ] Have a look at some real-life examples first - https://github.com/highlightjs/highlightjs-cypher - https://github.com/highlightjs/highlightjs-robots-txt -- [ ] Clone the main [highlight-js](https://github.com/highlightjs/highlightjs) repository from GitHub +- [ ] Clone the main [highlight-js](https://github.com/highlightjs/highlight.js) repository from GitHub - [ ] Read our [Language Contributor Checklist](https://highlightjs.readthedocs.io/en/latest/language-contribution.html) - [ ] Review the [Language Definition Guide](https://highlightjs.readthedocs.io/en/latest/language-guide.html) - [ ] Start with our [repository template](https://github.com/highlightjs/highlightjs-language-template) to more easily follow the suggested layout. (this isn't ready yet!) From 5e395bb9c5db1db02563046d21ad2dded7cc2d7f Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 13 Jul 2022 10:13:09 -0400 Subject: [PATCH 197/227] (chore) fix colors require --- package-lock.json | 52 ++++++++++++++++++++++++++++++++++++++++ tools/checkAutoDetect.js | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 109f2438ea..acf5b1cc04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -241,6 +241,9 @@ "dev": true, "dependencies": { "@rollup/pluginutils": "^3.0.8" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" } }, "node_modules/@rollup/plugin-node-resolve": { @@ -284,6 +287,9 @@ }, "engines": { "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" } }, "node_modules/@rollup/pluginutils/node_modules/estree-walker": { @@ -882,6 +888,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/chalk/node_modules/ansi-styles": { @@ -894,6 +903,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/chalk/node_modules/color-convert": { @@ -1552,6 +1564,9 @@ }, "engines": { "node": ">=8.10.0" + }, + "peerDependencies": { + "eslint": ">=4.19.1" } }, "node_modules/eslint-plugin-import": { @@ -1714,6 +1729,9 @@ }, "engines": { "node": ">=8.10.0" + }, + "peerDependencies": { + "eslint": ">=5.16.0" } }, "node_modules/eslint-plugin-node/node_modules/semver": { @@ -1760,6 +1778,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, "node_modules/eslint-visitor-keys": { @@ -2087,6 +2108,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/find-up/node_modules/path-exists": { @@ -2882,6 +2906,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { @@ -3033,6 +3060,9 @@ "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/glob": { @@ -3252,6 +3282,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { @@ -3264,6 +3297,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { @@ -3276,6 +3312,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-try": { @@ -3509,6 +3548,9 @@ }, "bin": { "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rollup": { @@ -3722,6 +3764,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", "dev": true, "dependencies": { "atob": "^2.1.2", @@ -3821,6 +3864,9 @@ "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-preserve-symlinks-flag": { @@ -4331,6 +4377,9 @@ "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yargs-unparser/node_modules/decamelize": { @@ -4340,6 +4389,9 @@ "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } } }, diff --git a/tools/checkAutoDetect.js b/tools/checkAutoDetect.js index 0da66c8dfd..1b4715e45a 100755 --- a/tools/checkAutoDetect.js +++ b/tools/checkAutoDetect.js @@ -6,7 +6,7 @@ const hljs = require('../build/lib/index.js'); const path = require('path'); const utility = require('../test/utility.js'); const Table = require('cli-table'); -const colors = require('colors/safe.js'); +const colors = require('@colors/colors/safe.js'); const resultTable = new Table({ head: ['expected', 'actual', 'score', '2nd best', 'score', 'info'], From f5f97fb2fb78fea06a952ed620f3cfce15dcfa23 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 13 Jul 2022 10:27:16 -0400 Subject: [PATCH 198/227] (chore) bump deps --- package-lock.json | 405 ++++++++++++++++++++++++---------------------- package.json | 4 +- 2 files changed, 218 insertions(+), 191 deletions(-) diff --git a/package-lock.json b/package-lock.json index acf5b1cc04..dff0f823b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@typescript-eslint/parser": "^5.27.1", "clean-css": "^5.3.0", "cli-table": "^0.3.1", - "commander": "8.2", + "commander": "9.3", "css": "^3.0.0", "css-color-names": "^1.0.1", "deep-freeze-es6": "^1.4.1", @@ -32,7 +32,7 @@ "glob": "^7.2.3", "glob-promise": "^4.2.2", "handlebars": "^4.7.6", - "jsdom": "^19.0.0", + "jsdom": "^20.0.0", "lodash": "^4.17.20", "mocha": "^10.0.0", "refa": "^0.4.1", @@ -190,9 +190,9 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", - "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.1.tgz", + "integrity": "sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", @@ -354,14 +354,14 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz", - "integrity": "sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.6.tgz", + "integrity": "sha512-J4zYMIhgrx4MgnZrSDD7sEnQp7FmhKNOaqaOpaoQ/SfdMfRB/0yvK74hTnvH+VQxndZynqs5/Hn4t+2/j9bADg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/type-utils": "5.27.1", - "@typescript-eslint/utils": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.6", + "@typescript-eslint/type-utils": "5.30.6", + "@typescript-eslint/utils": "5.30.6", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -387,14 +387,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.27.1.tgz", - "integrity": "sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.6.tgz", + "integrity": "sha512-gfF9lZjT0p2ZSdxO70Xbw8w9sPPJGfAdjK7WikEjB3fcUI/yr9maUVEdqigBjKincUYNKOmf7QBMiTf719kbrA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/typescript-estree": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.6", + "@typescript-eslint/types": "5.30.6", + "@typescript-eslint/typescript-estree": "5.30.6", "debug": "^4.3.4" }, "engines": { @@ -414,13 +414,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz", - "integrity": "sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.6.tgz", + "integrity": "sha512-Hkq5PhLgtVoW1obkqYH0i4iELctEKixkhWLPTYs55doGUKCASvkjOXOd/pisVeLdO24ZX9D6yymJ/twqpJiG3g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/visitor-keys": "5.27.1" + "@typescript-eslint/types": "5.30.6", + "@typescript-eslint/visitor-keys": "5.30.6" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -431,12 +431,12 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz", - "integrity": "sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.6.tgz", + "integrity": "sha512-GFVVzs2j0QPpM+NTDMXtNmJKlF842lkZKDSanIxf+ArJsGeZUIaeT4jGg+gAgHt7AcQSFwW7htzF/rbAh2jaVA==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.27.1", + "@typescript-eslint/utils": "5.30.6", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -457,9 +457,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.27.1.tgz", - "integrity": "sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.6.tgz", + "integrity": "sha512-HdnP8HioL1F7CwVmT4RaaMX57RrfqsOMclZc08wGMiDYJBsLGBM7JwXM4cZJmbWLzIR/pXg1kkrBBVpxTOwfUg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -470,13 +470,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz", - "integrity": "sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.6.tgz", + "integrity": "sha512-Z7TgPoeYUm06smfEfYF0RBkpF8csMyVnqQbLYiGgmUSTaSXTP57bt8f0UFXstbGxKIreTwQCujtaH0LY9w9B+A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/visitor-keys": "5.27.1", + "@typescript-eslint/types": "5.30.6", + "@typescript-eslint/visitor-keys": "5.30.6", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -497,15 +497,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.27.1.tgz", - "integrity": "sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.6.tgz", + "integrity": "sha512-xFBLc/esUbLOJLk9jKv0E9gD/OH966M40aY9jJ8GiqpSkP2xOV908cokJqqhVd85WoIvHVHYXxSFE4cCSDzVvA==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/typescript-estree": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.6", + "@typescript-eslint/types": "5.30.6", + "@typescript-eslint/typescript-estree": "5.30.6", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -548,12 +548,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz", - "integrity": "sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.6.tgz", + "integrity": "sha512-41OiCjdL2mCaSDi2SvYbzFLlqqlm5v1ZW9Ym55wXKL/Rx6OOB1IbuFGo71Fj6Xy90gJDFTlgOS+vbmtGHPTQQA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/types": "5.30.6", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -580,9 +580,9 @@ "dev": true }, "node_modules/abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, "node_modules/acorn": { @@ -975,9 +975,9 @@ } }, "node_modules/clean-css": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.0.tgz", - "integrity": "sha512-YYuuxv4H/iNb1Z/5IbMRoxgrzjWGhOEFfd+groZ5dMCVkpENiMZmwspdrzBo9286JjM1gZJPAyL7ZIdzuvu2AQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz", + "integrity": "sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg==", "dev": true, "dependencies": { "source-map": "~0.6.0" @@ -1040,12 +1040,12 @@ } }, "node_modules/commander": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.2.0.tgz", - "integrity": "sha512-LLKxDvHeL91/8MIyTAD5BFMNtoIwztGPMiM/7Bl8rIPmHCZXRxmSWr91h57dpOpnQ6jIUqEWdXE/uBYMfiVZDA==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", "dev": true, "engines": { - "node": ">= 12" + "node": "^12.20.0 || >=14" } }, "node_modules/commondir": { @@ -1119,14 +1119,14 @@ "dev": true }, "node_modules/data-urls": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.1.tgz", - "integrity": "sha512-Ds554NeT5Gennfoo9KN50Vh6tpgtvYEwraYjejXnyTpu1C7oXKxdFk75REooENHE8ndTVOJuv+BEs4/J/xcozw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", "dev": true, "dependencies": { - "abab": "^2.0.3", + "abab": "^2.0.6", "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0" + "whatwg-url": "^11.0.0" }, "engines": { "node": ">=12" @@ -1285,6 +1285,18 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/entities": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", + "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/es-abstract": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", @@ -1377,9 +1389,9 @@ } }, "node_modules/eslint": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.17.0.tgz", - "integrity": "sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz", + "integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.3.0", @@ -2432,9 +2444,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { "agent-base": "6", @@ -2814,28 +2826,28 @@ } }, "node_modules/jsdom": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz", - "integrity": "sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A==", + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.0.tgz", + "integrity": "sha512-x4a6CKCgx00uCmP+QakBDFXwjAJ69IkkIWHmtmjd3wvXPcdOS44hfX2vqkOQrVrq8l9DhNNADZRXaCEWvgXtVA==", "dev": true, "dependencies": { - "abab": "^2.0.5", - "acorn": "^8.5.0", + "abab": "^2.0.6", + "acorn": "^8.7.1", "acorn-globals": "^6.0.0", "cssom": "^0.5.0", "cssstyle": "^2.3.0", - "data-urls": "^3.0.1", + "data-urls": "^3.0.2", "decimal.js": "^10.3.1", "domexception": "^4.0.0", "escodegen": "^2.0.0", "form-data": "^4.0.0", "html-encoding-sniffer": "^3.0.0", "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", + "parse5": "^7.0.0", + "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^4.0.0", "w3c-hr-time": "^1.0.2", @@ -2843,12 +2855,12 @@ "webidl-conversions": "^7.0.0", "whatwg-encoding": "^2.0.0", "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0", - "ws": "^8.2.3", + "whatwg-url": "^11.0.0", + "ws": "^8.8.0", "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=12" + "node": ">=14" }, "peerDependencies": { "canvas": "^2.5.0" @@ -3339,10 +3351,16 @@ } }, "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", + "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", + "dev": true, + "dependencies": { + "entities": "^4.3.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } }, "node_modules/path-exists": { "version": "3.0.0", @@ -3554,9 +3572,9 @@ } }, "node_modules/rollup": { - "version": "2.75.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", - "integrity": "sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==", + "version": "2.76.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.76.0.tgz", + "integrity": "sha512-9jwRIEY1jOzKLj3nsY/yot41r19ITdQrhs+q3ggNWhr9TQgduHqANvPpS32RNpzGklJu3G1AJfvlZLi/6wFgWA==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -3618,15 +3636,15 @@ "dev": true }, "node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, "dependencies": { "xmlchars": "^2.2.0" }, "engines": { - "node": ">=10" + "node": ">=v12.22.7" } }, "node_modules/semver": { @@ -4022,9 +4040,9 @@ } }, "node_modules/typescript": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", - "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -4157,9 +4175,9 @@ } }, "node_modules/whatwg-url": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", - "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "dev": true, "dependencies": { "tr46": "^3.0.0", @@ -4278,9 +4296,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", + "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", "dev": true, "engines": { "node": ">=10.0.0" @@ -4512,9 +4530,9 @@ } }, "@rollup/plugin-commonjs": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", - "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.1.tgz", + "integrity": "sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", @@ -4658,14 +4676,14 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz", - "integrity": "sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.6.tgz", + "integrity": "sha512-J4zYMIhgrx4MgnZrSDD7sEnQp7FmhKNOaqaOpaoQ/SfdMfRB/0yvK74hTnvH+VQxndZynqs5/Hn4t+2/j9bADg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/type-utils": "5.27.1", - "@typescript-eslint/utils": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.6", + "@typescript-eslint/type-utils": "5.30.6", + "@typescript-eslint/utils": "5.30.6", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -4675,52 +4693,52 @@ } }, "@typescript-eslint/parser": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.27.1.tgz", - "integrity": "sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.6.tgz", + "integrity": "sha512-gfF9lZjT0p2ZSdxO70Xbw8w9sPPJGfAdjK7WikEjB3fcUI/yr9maUVEdqigBjKincUYNKOmf7QBMiTf719kbrA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/typescript-estree": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.6", + "@typescript-eslint/types": "5.30.6", + "@typescript-eslint/typescript-estree": "5.30.6", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz", - "integrity": "sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.6.tgz", + "integrity": "sha512-Hkq5PhLgtVoW1obkqYH0i4iELctEKixkhWLPTYs55doGUKCASvkjOXOd/pisVeLdO24ZX9D6yymJ/twqpJiG3g==", "dev": true, "requires": { - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/visitor-keys": "5.27.1" + "@typescript-eslint/types": "5.30.6", + "@typescript-eslint/visitor-keys": "5.30.6" } }, "@typescript-eslint/type-utils": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz", - "integrity": "sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.6.tgz", + "integrity": "sha512-GFVVzs2j0QPpM+NTDMXtNmJKlF842lkZKDSanIxf+ArJsGeZUIaeT4jGg+gAgHt7AcQSFwW7htzF/rbAh2jaVA==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.27.1", + "@typescript-eslint/utils": "5.30.6", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.27.1.tgz", - "integrity": "sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.6.tgz", + "integrity": "sha512-HdnP8HioL1F7CwVmT4RaaMX57RrfqsOMclZc08wGMiDYJBsLGBM7JwXM4cZJmbWLzIR/pXg1kkrBBVpxTOwfUg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz", - "integrity": "sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.6.tgz", + "integrity": "sha512-Z7TgPoeYUm06smfEfYF0RBkpF8csMyVnqQbLYiGgmUSTaSXTP57bt8f0UFXstbGxKIreTwQCujtaH0LY9w9B+A==", "dev": true, "requires": { - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/visitor-keys": "5.27.1", + "@typescript-eslint/types": "5.30.6", + "@typescript-eslint/visitor-keys": "5.30.6", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -4729,15 +4747,15 @@ } }, "@typescript-eslint/utils": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.27.1.tgz", - "integrity": "sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.6.tgz", + "integrity": "sha512-xFBLc/esUbLOJLk9jKv0E9gD/OH966M40aY9jJ8GiqpSkP2xOV908cokJqqhVd85WoIvHVHYXxSFE4cCSDzVvA==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/typescript-estree": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.6", + "@typescript-eslint/types": "5.30.6", + "@typescript-eslint/typescript-estree": "5.30.6", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -4760,12 +4778,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz", - "integrity": "sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ==", + "version": "5.30.6", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.6.tgz", + "integrity": "sha512-41OiCjdL2mCaSDi2SvYbzFLlqqlm5v1ZW9Ym55wXKL/Rx6OOB1IbuFGo71Fj6Xy90gJDFTlgOS+vbmtGHPTQQA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.27.1", + "@typescript-eslint/types": "5.30.6", "eslint-visitor-keys": "^3.3.0" }, "dependencies": { @@ -4784,9 +4802,9 @@ "dev": true }, "abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, "acorn": { @@ -5076,9 +5094,9 @@ } }, "clean-css": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.0.tgz", - "integrity": "sha512-YYuuxv4H/iNb1Z/5IbMRoxgrzjWGhOEFfd+groZ5dMCVkpENiMZmwspdrzBo9286JjM1gZJPAyL7ZIdzuvu2AQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz", + "integrity": "sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg==", "dev": true, "requires": { "source-map": "~0.6.0" @@ -5128,9 +5146,9 @@ } }, "commander": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.2.0.tgz", - "integrity": "sha512-LLKxDvHeL91/8MIyTAD5BFMNtoIwztGPMiM/7Bl8rIPmHCZXRxmSWr91h57dpOpnQ6jIUqEWdXE/uBYMfiVZDA==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", "dev": true }, "commondir": { @@ -5197,14 +5215,14 @@ } }, "data-urls": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.1.tgz", - "integrity": "sha512-Ds554NeT5Gennfoo9KN50Vh6tpgtvYEwraYjejXnyTpu1C7oXKxdFk75REooENHE8ndTVOJuv+BEs4/J/xcozw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", "dev": true, "requires": { - "abab": "^2.0.3", + "abab": "^2.0.6", "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0" + "whatwg-url": "^11.0.0" } }, "debug": { @@ -5322,6 +5340,12 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "entities": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", + "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "dev": true + }, "es-abstract": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", @@ -5389,9 +5413,9 @@ } }, "eslint": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.17.0.tgz", - "integrity": "sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz", + "integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==", "dev": true, "requires": { "@eslint/eslintrc": "^1.3.0", @@ -6159,9 +6183,9 @@ } }, "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "requires": { "agent-base": "6", @@ -6424,28 +6448,28 @@ } }, "jsdom": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz", - "integrity": "sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A==", + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.0.tgz", + "integrity": "sha512-x4a6CKCgx00uCmP+QakBDFXwjAJ69IkkIWHmtmjd3wvXPcdOS44hfX2vqkOQrVrq8l9DhNNADZRXaCEWvgXtVA==", "dev": true, "requires": { - "abab": "^2.0.5", - "acorn": "^8.5.0", + "abab": "^2.0.6", + "acorn": "^8.7.1", "acorn-globals": "^6.0.0", "cssom": "^0.5.0", "cssstyle": "^2.3.0", - "data-urls": "^3.0.1", + "data-urls": "^3.0.2", "decimal.js": "^10.3.1", "domexception": "^4.0.0", "escodegen": "^2.0.0", "form-data": "^4.0.0", "html-encoding-sniffer": "^3.0.0", "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", + "parse5": "^7.0.0", + "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^4.0.0", "w3c-hr-time": "^1.0.2", @@ -6453,8 +6477,8 @@ "webidl-conversions": "^7.0.0", "whatwg-encoding": "^2.0.0", "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0", - "ws": "^8.2.3", + "whatwg-url": "^11.0.0", + "ws": "^8.8.0", "xml-name-validator": "^4.0.0" } }, @@ -6816,10 +6840,13 @@ } }, "parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", + "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", + "dev": true, + "requires": { + "entities": "^4.3.0" + } }, "path-exists": { "version": "3.0.0", @@ -6962,9 +6989,9 @@ } }, "rollup": { - "version": "2.75.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", - "integrity": "sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==", + "version": "2.76.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.76.0.tgz", + "integrity": "sha512-9jwRIEY1jOzKLj3nsY/yot41r19ITdQrhs+q3ggNWhr9TQgduHqANvPpS32RNpzGklJu3G1AJfvlZLi/6wFgWA==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -6992,9 +7019,9 @@ "dev": true }, "saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, "requires": { "xmlchars": "^2.2.0" @@ -7315,9 +7342,9 @@ "dev": true }, "typescript": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", - "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true }, "uglify-js": { @@ -7421,9 +7448,9 @@ "dev": true }, "whatwg-url": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", - "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "dev": true, "requires": { "tr46": "^3.0.0", @@ -7514,9 +7541,9 @@ "dev": true }, "ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", + "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index 71b5f4fcfd..a9bee9f100 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@typescript-eslint/parser": "^5.27.1", "clean-css": "^5.3.0", "cli-table": "^0.3.1", - "commander": "8.2", + "commander": "9.3", "css": "^3.0.0", "css-color-names": "^1.0.1", "deep-freeze-es6": "^1.4.1", @@ -78,7 +78,7 @@ "glob": "^7.2.3", "glob-promise": "^4.2.2", "handlebars": "^4.7.6", - "jsdom": "^19.0.0", + "jsdom": "^20.0.0", "lodash": "^4.17.20", "mocha": "^10.0.0", "refa": "^0.4.1", From af412170afee446d3706bbcd88b9f777cdb54377 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 13 Jul 2022 10:34:39 -0400 Subject: [PATCH 199/227] (chore) drop support for node v12 --- .github/workflows/{node.js.yml => tests.js.yml} | 2 +- CHANGES.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) rename .github/workflows/{node.js.yml => tests.js.yml} (97%) diff --git a/.github/workflows/node.js.yml b/.github/workflows/tests.js.yml similarity index 97% rename from .github/workflows/node.js.yml rename to .github/workflows/tests.js.yml index 0b1d4f8166..e83995697c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/tests.js.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x, 18.x] build-how: ["node", "browser", "browser -n", "cdn :common"] steps: diff --git a/CHANGES.md b/CHANGES.md index 90fd437c5e..3005bf7c19 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,16 @@ ## Version 11.6.0 (maybe) +Supported Node.js versions: + +- (chore) Drops support for Node 12.x, which is no longer supported by Node.js. + + Grammars: - enh(gml) reorganized and added additional keywords [Bluecoreg][] - enh(csharp) Added support for the new `scoped` keyword in C# (#3571) [David Pine][] - enh(scala) add `transparent` keyword [Matt Bovel][] -- fix(rust) highlight types immediately preceeding `::` (#3540) [Josh Goebel][] +- fix(rust) highlight types immediately preceeding `::` (#3540) [Josh Goebel][] - Added 3rd party Apex grammar to SUPPORTED_LANGUAGES (#3546) [David Schach][] - fix(rust) recognize `include_bytes!` macro (#3541) [Serial-ATA][] - fix(java) do not intepret `==` as a variable declaration [Mousetail][] From ed25668a3d728309f33b49d9c9c4c74dada5510c Mon Sep 17 00:00:00 2001 From: Shikhar <75368010+shikhar13012001@users.noreply.github.com> Date: Wed, 13 Jul 2022 20:32:29 +0530 Subject: [PATCH 200/227] fix(JSON) null/booleans are keywords but should be literals --- CHANGES.md | 3 +- package-lock.json | 82 ++-------------------------- src/languages/json.js | 23 +++++--- test/markup/http/default.expect.txt | 4 +- test/markup/json/comments.expect.txt | 6 +- 5 files changed, 26 insertions(+), 92 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3005bf7c19..20234dc042 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,7 +6,7 @@ Supported Node.js versions: Grammars: - +- fix(json) changed null/booleans from `keyword` to `literal` [shikhar13012001][] - enh(gml) reorganized and added additional keywords [Bluecoreg][] - enh(csharp) Added support for the new `scoped` keyword in C# (#3571) [David Pine][] - enh(scala) add `transparent` keyword [Matt Bovel][] @@ -22,6 +22,7 @@ Grammars: - Added 3rd party Oak grammar to SUPPORTED_LANGUAGES [Tim Smith][] - enh(python) add `match` and `case` keywords [Avrumy Lunger][] +[shikhar13012001]: https://github.com/shikhar13012001 [Bluecoreg]: https://github.com/Bluecoreg [Matt Bovel]: https://github.com/mbovel [David Schach]: https://github.com/dschach diff --git a/package-lock.json b/package-lock.json index dff0f823b9..fec2ae47ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,7 +1,7 @@ { "name": "highlight.js", "version": "11.5.0", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, "packages": { "": { @@ -4835,8 +4835,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} + "dev": true }, "acorn-walk": { "version": "7.2.0", @@ -5000,16 +4999,6 @@ "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true }, - "builtins": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", - "dev": true, - "peer": true, - "requires": { - "semver": "^7.0.0" - } - }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -5554,8 +5543,7 @@ "version": "17.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", "integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==", - "dev": true, - "requires": {} + "dev": true }, "eslint-import-resolver-node": { "version": "0.3.6", @@ -5699,67 +5687,6 @@ } } }, - "eslint-plugin-n": { - "version": "15.2.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.2.tgz", - "integrity": "sha512-MLjZVAv4TiCIoXqjibNqCJjLkGHfrOY3XZ0ZBLoW0OnS3o98PUBnzB/kfp8dCz/4A4Y18jjX50PRnqI4ACFY1Q==", - "dev": true, - "peer": true, - "requires": { - "builtins": "^5.0.1", - "eslint-plugin-es": "^4.1.0", - "eslint-utils": "^3.0.0", - "ignore": "^5.1.1", - "is-core-module": "^2.9.0", - "minimatch": "^3.1.2", - "resolve": "^1.10.1", - "semver": "^7.3.7" - }, - "dependencies": { - "eslint-plugin-es": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", - "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", - "dev": true, - "peer": true, - "requires": { - "eslint-utils": "^2.0.0", - "regexpp": "^3.0.0" - }, - "dependencies": { - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - } - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true - } - } - } - } - }, "eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -5786,8 +5713,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.0.0.tgz", "integrity": "sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw==", - "dev": true, - "requires": {} + "dev": true }, "eslint-scope": { "version": "5.1.1", diff --git a/src/languages/json.js b/src/languages/json.js index 354572869b..41242f6888 100644 --- a/src/languages/json.js +++ b/src/languages/json.js @@ -17,24 +17,31 @@ export default function(hljs) { className: "punctuation", relevance: 0 }; - // normally we would rely on `keywords` for this but using a mode here allows us - // to use the very tight `illegal: \S` rule later to flag any other character - // as illegal indicating that despite looking like JSON we do not truly have - // JSON and thus improve false-positively greatly since JSON will try and claim - // all sorts of JSON looking stuff - const LITERALS = { beginKeywords: [ + const LITERALS = [ "true", "false", "null" - ].join(" ") }; + ]; + // NOTE: normally we would rely on `keywords` for this but using a mode here allows us + // - to use the very tight `illegal: \S` rule later to flag any other character + // - as illegal indicating that despite looking like JSON we do not truly have + // - JSON and thus improve false-positively greatly since JSON will try and claim + // - all sorts of JSON looking stuff + const LITERALS_MODE = { + scope: "literal", + beginKeywords: LITERALS.join(" "), + }; return { name: 'JSON', + keywords:{ + literal: LITERALS, + }, contains: [ ATTRIBUTE, PUNCTUATION, hljs.QUOTE_STRING_MODE, - LITERALS, + LITERALS_MODE, hljs.C_NUMBER_MODE, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE diff --git a/test/markup/http/default.expect.txt b/test/markup/http/default.expect.txt index 0792b984c7..73c696acff 100644 --- a/test/markup/http/default.expect.txt +++ b/test/markup/http/default.expect.txt @@ -3,5 +3,5 @@ Content-Type: application/json; charset=utf-8 Content-Length: 19 -{"status": "ok", "extended": true} - \ No newline at end of file +{"status": "ok", "extended": true} + diff --git a/test/markup/json/comments.expect.txt b/test/markup/json/comments.expect.txt index a07b1ff479..ac28c5d450 100644 --- a/test/markup/json/comments.expect.txt +++ b/test/markup/json/comments.expect.txt @@ -3,12 +3,12 @@ { "title": "apples", // yum "count": [12000, 20000], /* so many? */ - "description": {"text": "...", "sensitive": false} + "description": {"text": "...", "sensitive": false} }, { "title": "oranges", - "count": [17500, null], - "description": {"text": "...", "sensitive": false} + "count": [17500, null], + "description": {"text": "...", "sensitive": false} } // { // "title" : "brocolli" From 6960557859c54f98ff7e370d5dcec9d0c6fec517 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 13 Jul 2022 10:43:13 -0400 Subject: [PATCH 201/227] (chore) update contributors --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index da33993e97..80de42ee4c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -4,7 +4,6 @@ ### Core Team - Josh Goebel (maintainer) -- Egor Rogov - Vladimir Jimenez ### Former Maintainers @@ -15,6 +14,7 @@ ### Former Core Team +- Egor Rogov - Gidi Meir Morris - Jan T. Sott - Li Xuanji From 5a815ee387ac25ad131a0dddb20a5b84d72ccd3f Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 13 Jul 2022 10:48:40 -0400 Subject: [PATCH 202/227] (enh) add WASM and GraphQL to common build --- CHANGES.md | 6 ++++++ src/languages/graphql.js | 6 +++--- src/languages/wasm.js | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 20234dc042..d1f33d73b1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,12 @@ Supported Node.js versions: - (chore) Drops support for Node 12.x, which is no longer supported by Node.js. +Default build changes: + +- add `wasm` to default `:common` build (#3526) [Josh Goebel][] +- add `graphql` to default `:common` build (#3526) [Josh Goebel][] + + Grammars: - fix(json) changed null/booleans from `keyword` to `literal` [shikhar13012001][] - enh(gml) reorganized and added additional keywords [Bluecoreg][] diff --git a/src/languages/graphql.js b/src/languages/graphql.js index 5298f3299d..2b9c476b99 100644 --- a/src/languages/graphql.js +++ b/src/languages/graphql.js @@ -1,8 +1,8 @@ /* - Language: graphql - Category: scripting, protocols, web + Language: GraphQL Author: John Foster (GH jf990), and others - Description: Highlight GraphQL queries with highlight.js. + Description: GraphQL is a query language for APIs + Category: web, common */ /** @type LanguageFn */ diff --git a/src/languages/wasm.js b/src/languages/wasm.js index b9c3ad8b0a..dc89519a42 100644 --- a/src/languages/wasm.js +++ b/src/languages/wasm.js @@ -2,7 +2,7 @@ Language: WebAssembly Website: https://webassembly.org Description: Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications. -Category: web +Category: web, common Audit: 2020 */ From 8869ede171b8de99ddfc4560f6c6f58b228088f7 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 13 Jul 2022 11:05:37 -0400 Subject: [PATCH 203/227] (release) 11.6.0 --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index d1f33d73b1..d73e78fa60 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## Version 11.6.0 (maybe) +## Version 11.6.0 Supported Node.js versions: From bed790f3f3515ebcb92896ab23a518f835008233 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 13 Jul 2022 11:09:49 -0400 Subject: [PATCH 204/227] (release) 11.6.0 (attempt two) --- README.md | 36 ++++++++++---------- docs/conf.py | 2 +- package-lock.json | 86 +++++++++++++++++++++++++++++++++++++++++++---- package.json | 2 +- 4 files changed, 100 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 39e7743d6b..035677118c 100644 --- a/README.md +++ b/README.md @@ -328,20 +328,20 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ````html - + @@ -353,20 +353,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` @@ -376,20 +376,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` diff --git a/docs/conf.py b/docs/conf.py index a191d91276..cc3cf1a1bd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,7 @@ # built documents. # The full version, including alpha/beta/rc tags. -release = '11.5.0' +release = '11.6.0' # The short X.Y version. version = ".".join(release.split(".")[:2]) diff --git a/package-lock.json b/package-lock.json index fec2ae47ba..5e18692e2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "highlight.js", - "version": "11.5.0", - "lockfileVersion": 1, + "version": "11.6.0", + "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "highlight.js", - "version": "11.5.0", + "version": "11.6.0", "license": "BSD-3-Clause", "devDependencies": { "@colors/colors": "^1.5.0", @@ -4835,7 +4835,8 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true + "dev": true, + "requires": {} }, "acorn-walk": { "version": "7.2.0", @@ -4999,6 +5000,16 @@ "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true }, + "builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "peer": true, + "requires": { + "semver": "^7.0.0" + } + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -5543,7 +5554,8 @@ "version": "17.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", "integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==", - "dev": true + "dev": true, + "requires": {} }, "eslint-import-resolver-node": { "version": "0.3.6", @@ -5687,6 +5699,67 @@ } } }, + "eslint-plugin-n": { + "version": "15.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.2.tgz", + "integrity": "sha512-MLjZVAv4TiCIoXqjibNqCJjLkGHfrOY3XZ0ZBLoW0OnS3o98PUBnzB/kfp8dCz/4A4Y18jjX50PRnqI4ACFY1Q==", + "dev": true, + "peer": true, + "requires": { + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", + "ignore": "^5.1.1", + "is-core-module": "^2.9.0", + "minimatch": "^3.1.2", + "resolve": "^1.10.1", + "semver": "^7.3.7" + }, + "dependencies": { + "eslint-plugin-es": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", + "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", + "dev": true, + "peer": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "peer": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + } + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "peer": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "peer": true + } + } + } + } + }, "eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -5713,7 +5786,8 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.0.0.tgz", "integrity": "sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw==", - "dev": true + "dev": true, + "requires": {} }, "eslint-scope": { "version": "5.1.1", diff --git a/package.json b/package.json index a9bee9f100..9af5ce8189 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "11.5.0", + "version": "11.6.0", "author": "Josh Goebel ", "contributors": [ "Josh Goebel ", From 3209cca58146c1287123c3d3bb3eb982174d64fd Mon Sep 17 00:00:00 2001 From: Keith Taylor <73310001+KTSnowy@users.noreply.github.com> Date: Thu, 14 Jul 2022 10:18:21 -0300 Subject: [PATCH 205/227] (docs) Add COBOL to supported languages (#3581) GitHub repo: https://github.com/otterkit/highlightjs-cobol NPM: https://www.npmjs.com/package/highlightjs-cobol CDN links like unpkg.com are also working and I made a codepen to test syntax highlighting: https://codepen.io/ktsnowy/pen/vYRXxov --- CHANGES.md | 2 ++ SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d73e78fa60..b15d33fb49 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,7 @@ Grammars: - Use substring() instead of deprecated substr() [Tobias Buschor][] - Added 3rd party Oak grammar to SUPPORTED_LANGUAGES [Tim Smith][] - enh(python) add `match` and `case` keywords [Avrumy Lunger][] +- Added 3rd party COBOL grammar to SUPPORTED_LANGUAGES [Gabriel Gonçalves][] [shikhar13012001]: https://github.com/shikhar13012001 [Bluecoreg]: https://github.com/Bluecoreg @@ -41,6 +42,7 @@ Grammars: [Tim Smith]: https://github.com/timlabs [Avrumy Lunger]: https://github.com/vrumger [Mousetail]: https://github.com/mousetail +[Gabriel Gonçalves]: https://github.com/KTSnowy ## Version 11.5.0 diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index a8c5278053..9ef934b325 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -41,6 +41,7 @@ The table below shows the full list of languages (and corresponding classes/alia | C/AL | cal | | | Cache Object Script | cos, cls | | | CMake | cmake, cmake.in | | +| COBOL | cobol, standard-cobol | [highlightjs-cobol](https://github.com/otterkit/highlightjs-cobol) | | Coq | coq | | | CSP | csp | | | CSS | css | | From 50a1947662cb8e4b77b9f5df041fcf1ff1a6f3b4 Mon Sep 17 00:00:00 2001 From: Josh Temple <8672171+joshtemple@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:22:05 -0400 Subject: [PATCH 206/227] (docs) Add LookML to supported languages (#3610) --- CHANGES.md | 7 +++++++ SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 8 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index b15d33fb49..8a96a5c0f6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +## Version 11.7.0 + +Grammars: +- Added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] + +[Josh Temple]: https://github.com/joshtemple + ## Version 11.6.0 Supported Node.js versions: diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 9ef934b325..bc541a1f3f 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -118,6 +118,7 @@ The table below shows the full list of languages (and corresponding classes/alia | Lisp | lisp | | | LiveCode Server | livecodeserver | | | LiveScript | livescript, ls | | +| LookML | lookml | [highlightjs-lookml](https://github.com/spectacles-ci/highlightjs-lookml) | | Lua | lua | | | Macaulay2 | macaulay2 | [highlightjs-macaulay2](https://github.com/d-torrance/highlightjs-macaulay2) | | Makefile | makefile, mk, mak, make | | From 1e4e053f51df772a67d7a06e53d2026720ab3b40 Mon Sep 17 00:00:00 2001 From: Mikhail Lebedinets <99194003+iwalfy@users.noreply.github.com> Date: Tue, 13 Sep 2022 07:48:55 +0300 Subject: [PATCH 207/227] Fix typo (#3618) --- src/languages/routeros.js | 4 ++-- src/styles/routeros.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languages/routeros.js b/src/languages/routeros.js index feee347a26..025fdc481f 100644 --- a/src/languages/routeros.js +++ b/src/languages/routeros.js @@ -1,5 +1,5 @@ /* -Language: Microtik RouterOS script +Language: MikroTik RouterOS script Author: Ivan Dementev Description: Scripting host provides a way to automate some router maintenance tasks by means of executing user-defined scripts bounded to some event occurrence Website: https://wiki.mikrotik.com/wiki/Manual:Scripting @@ -67,7 +67,7 @@ export default function(hljs) { const IPADDR_wBITMASK = IPADDR + '/(3[0-2]|[1-2][0-9]|\\d)'; return { - name: 'Microtik RouterOS script', + name: 'MikroTik RouterOS script', aliases: [ 'mikrotik' ], case_insensitive: true, keywords: { diff --git a/src/styles/routeros.css b/src/styles/routeros.css index 5bbf4ca14a..21fbdd5f02 100644 --- a/src/styles/routeros.css +++ b/src/styles/routeros.css @@ -1,6 +1,6 @@ /* - highlight.js style for Microtik RouterOS script + highlight.js style for MikroTik RouterOS script */ From be8765adf500167a163485056c351d2c464b0452 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Wed, 14 Sep 2022 12:42:59 +0800 Subject: [PATCH 208/227] (chore) fix type notation (#3608) --- src/lib/compile_keywords.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/compile_keywords.js b/src/lib/compile_keywords.js index 31d9a7fb17..d5ff87e898 100644 --- a/src/lib/compile_keywords.js +++ b/src/lib/compile_keywords.js @@ -22,7 +22,7 @@ const DEFAULT_KEYWORD_SCOPE = "keyword"; * @param {boolean} caseInsensitive */ export function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) { - /** @type KeywordDict */ + /** @type {import("highlight.js/private").KeywordDict} */ const compiledKeywords = Object.create(null); // input can be a string of keywords, an array of keywords, or a object with From c9dc579982abb0e6dcf80d5bd13b7524507d3709 Mon Sep 17 00:00:00 2001 From: Nicholas Chambers Date: Wed, 14 Sep 2022 11:01:34 -0500 Subject: [PATCH 209/227] fix(bash) arithmetic detection of `((` (#3622) * Fix arithmetic detection * Test that the (( keyword highlights properly --- CHANGES.md | 2 ++ src/languages/bash.js | 2 +- test/markup/bash/arithmetic.expect.txt | 8 ++++++++ test/markup/bash/arithmetic.txt | 8 ++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 8a96a5c0f6..b7dbfa8556 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,8 +2,10 @@ Grammars: - Added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] +- fix(bash) recognize the `((` keyword [Nick Chambers][] [Josh Temple]: https://github.com/joshtemple +[Nick Chambers]: https://github.com/uplime ## Version 11.6.0 diff --git a/src/languages/bash.js b/src/languages/bash.js index 38a08e0432..9d8c00bf0e 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -70,7 +70,7 @@ export default function(hljs) { end: /'/ }; const ARITHMETIC = { - begin: /\$\(\(/, + begin: /\$?\(\(/, end: /\)\)/, contains: [ { diff --git a/test/markup/bash/arithmetic.expect.txt b/test/markup/bash/arithmetic.expect.txt index 28ebd37413..573b97aa29 100644 --- a/test/markup/bash/arithmetic.expect.txt +++ b/test/markup/bash/arithmetic.expect.txt @@ -6,3 +6,11 @@ yumi=deadbeef B=20 yumi=deadbeef echo $(( $B#$yumi / 1003 )) + +# test that << within an expression doesn't false positively as a heredoc... +(( 19 << 42 )) +printf 'Line 1\n' +printf 'Line 2\n' + +fubar=42 +(( x = 19 * fubar / 2 )) diff --git a/test/markup/bash/arithmetic.txt b/test/markup/bash/arithmetic.txt index d44dea465e..e6a87ca7a0 100644 --- a/test/markup/bash/arithmetic.txt +++ b/test/markup/bash/arithmetic.txt @@ -6,3 +6,11 @@ echo $(( 16#$yumi / 1003 )) B=20 yumi=deadbeef echo $(( $B#$yumi / 1003 )) + +# test that << within an expression doesn't false positively as a heredoc... +(( 19 << 42 )) +printf 'Line 1\n' +printf 'Line 2\n' + +fubar=42 +(( x = 19 * fubar / 2 )) From f76dbb8d5f797fed51805fa0e27d3675b3e28a42 Mon Sep 17 00:00:00 2001 From: nathnolt Date: Fri, 16 Sep 2022 21:50:21 +0200 Subject: [PATCH 210/227] fix(js) do not flag `import()` as a function, rather a keyword (#3587) Co-authored-by: Josh Goebel --- CHANGES.md | 6 +++++- src/languages/javascript.js | 3 ++- test/markup/javascript/modules.expect.txt | 2 ++ test/markup/javascript/modules.txt | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b7dbfa8556..2acb66bd40 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,10 +1,14 @@ ## Version 11.7.0 +New Grammars: +- added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] + Grammars: -- Added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] +- fix(js) do not flag `import()` as a function, rather a keyword [nathnolt][] - fix(bash) recognize the `((` keyword [Nick Chambers][] [Josh Temple]: https://github.com/joshtemple +[nathnolt]: https://github.com/nathnolt [Nick Chambers]: https://github.com/uplime ## Version 11.6.0 diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 1b1ff4c30e..5bba1a22a0 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -360,7 +360,8 @@ export default function(hljs) { /\b/, noneOf([ ...ECMAScript.BUILT_IN_GLOBALS, - "super" + "super", + "import" ]), IDENT_RE, regex.lookahead(/\(/)), className: "title.function", diff --git a/test/markup/javascript/modules.expect.txt b/test/markup/javascript/modules.expect.txt index 0e1b5dad7d..4ddf183b9f 100644 --- a/test/markup/javascript/modules.expect.txt +++ b/test/markup/javascript/modules.expect.txt @@ -6,3 +6,5 @@ //------ main.js ------ import _, { each, something as otherthing } from 'underscore'; + +const file = import("https://file.io/file.js") diff --git a/test/markup/javascript/modules.txt b/test/markup/javascript/modules.txt index c0c8e35606..71651d339e 100644 --- a/test/markup/javascript/modules.txt +++ b/test/markup/javascript/modules.txt @@ -6,3 +6,5 @@ export function something() {}; //------ main.js ------ import _, { each, something as otherthing } from 'underscore'; + +const file = import("https://file.io/file.js") From 57600cc57654fcaa5fd4c872a373c81c3d9b6c59 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 22 Sep 2022 14:35:49 +0300 Subject: [PATCH 211/227] Add `FunC` to the list of supported languages (#3630) - Refs: https://github.com/highlightjs/highlight.js/issues/3629 --- CHANGES.md | 2 ++ SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 2acb66bd40..bc03ac4e2f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ New Grammars: - added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] +- added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][] Grammars: - fix(js) do not flag `import()` as a function, rather a keyword [nathnolt][] @@ -56,6 +57,7 @@ Grammars: [Avrumy Lunger]: https://github.com/vrumger [Mousetail]: https://github.com/mousetail [Gabriel Gonçalves]: https://github.com/KTSnowy +[Nikita Sobolev]: https://github.com/sobolevn ## Version 11.5.0 diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index bc541a1f3f..4ecc39ec13 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -78,6 +78,7 @@ The table below shows the full list of languages (and corresponding classes/alia | F# | fsharp, fs | | | FIX | fix | | | Fortran | fortran, f90, f95 | | +| FunC | func | [highlightjs-func](https://github.com/highlightjs/highlightjs-func) | | G-Code | gcode, nc | | | Gams | gams, gms | | | GAUSS | gauss, gss | | From 1b6a4051bc3c5885c52db8fe530b84dfc84b61c6 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 24 Sep 2022 08:21:47 +0200 Subject: [PATCH 212/227] (security) harden GitHub Workflow permissions (#3627) --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f787fe86f9..97bb5b10b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,8 +8,14 @@ on: - "*beta*" - "1[0-9]+.[0-9]+.[0-9]+" +permissions: + contents: read + jobs: prerelease: + permissions: + contents: write # for git push + name: Release runs-on: ubuntu-latest steps: From 01e096544b09d2248de9d942efefa9ad92228f52 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 15 Oct 2022 14:10:52 +0200 Subject: [PATCH 213/227] fix(nix) Support escaped dollar sign in strings (#3636) --- CHANGES.md | 2 ++ src/languages/nix.js | 6 +++++- test/markup/nix/default.expect.txt | 1 + test/markup/nix/default.txt | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index bc03ac4e2f..7547d4f806 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,10 +7,12 @@ New Grammars: Grammars: - fix(js) do not flag `import()` as a function, rather a keyword [nathnolt][] - fix(bash) recognize the `((` keyword [Nick Chambers][] +- fix(nix) support escaped dollar signs in strings [h7x4][] [Josh Temple]: https://github.com/joshtemple [nathnolt]: https://github.com/nathnolt [Nick Chambers]: https://github.com/uplime +[h7x4]: https://github.com/h7x4 ## Version 11.6.0 diff --git a/src/languages/nix.js b/src/languages/nix.js index 27232ec7a8..5f7eceae4f 100644 --- a/src/languages/nix.js +++ b/src/languages/nix.js @@ -45,6 +45,10 @@ export default function(hljs) { end: /\}/, keywords: KEYWORDS }; + const ESCAPED_DOLLAR = { + className: 'char.escape', + begin: /''\$/, + }; const ATTRS = { begin: /[a-zA-Z0-9-_]+(\s*=)/, returnBegin: true, @@ -59,7 +63,7 @@ export default function(hljs) { }; const STRING = { className: 'string', - contains: [ ANTIQUOTE ], + contains: [ ESCAPED_DOLLAR, ANTIQUOTE ], variants: [ { begin: "''", diff --git a/test/markup/nix/default.expect.txt b/test/markup/nix/default.expect.txt index 97d6b3cb6a..bd90c5c422 100644 --- a/test/markup/nix/default.expect.txt +++ b/test/markup/nix/default.expect.txt @@ -16,6 +16,7 @@ postInstall = '' ${ if true then "--${test}" else false } + ''${ escaped } ''; meta = with stdenv.lib; { diff --git a/test/markup/nix/default.txt b/test/markup/nix/default.txt index ae8b8f7531..21b2080ae9 100644 --- a/test/markup/nix/default.txt +++ b/test/markup/nix/default.txt @@ -16,6 +16,7 @@ in stdenv.mkDerivation rec { postInstall = '' ${ if true then "--${test}" else false } + ''${ escaped } ''; meta = with stdenv.lib; { From a73dfa679ddf2f170322c71e60a34c7addda6739 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 16 Oct 2022 06:08:23 -0400 Subject: [PATCH 214/227] enh(Ruby) misc improvements (#3617) --- CHANGES.md | 5 +++ src/languages/ruby.js | 52 ++++++++++++++++++++++++----- test/markup/haml/default.expect.txt | 2 +- test/markup/http/default.expect.txt | 2 +- test/markup/ruby/prompt.expect.txt | 6 ++-- 5 files changed, 54 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7547d4f806..dfa9ca8fe3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,19 +1,24 @@ ## Version 11.7.0 New Grammars: + - added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][] Grammars: + +- enh(Ruby) misc improvements (kws, class names, etc) [Josh Goebel][] - fix(js) do not flag `import()` as a function, rather a keyword [nathnolt][] - fix(bash) recognize the `((` keyword [Nick Chambers][] - fix(nix) support escaped dollar signs in strings [h7x4][] +[Josh Goebel]: https://github.com/joshgoebel [Josh Temple]: https://github.com/joshtemple [nathnolt]: https://github.com/nathnolt [Nick Chambers]: https://github.com/uplime [h7x4]: https://github.com/h7x4 + ## Version 11.6.0 Supported Node.js versions: diff --git a/src/languages/ruby.js b/src/languages/ruby.js index 0504039a0a..07af86ed33 100644 --- a/src/languages/ruby.js +++ b/src/languages/ruby.js @@ -18,10 +18,23 @@ export default function(hljs) { ) ; const CLASS_NAME_WITH_NAMESPACE_RE = regex.concat(CLASS_NAME_RE, /(::\w+)*/) + // very popular ruby built-ins that one might even assume + // are actual keywords (despite that not being the case) + const PSEUDO_KWS = [ + "include", + "extend", + "prepend", + "public", + "private", + "protected", + "raise", + "throw" + ]; const RUBY_KEYWORDS = { "variable.constant": [ "__FILE__", - "__LINE__" + "__LINE__", + "__ENCODING__" ], "variable.language": [ "self", @@ -30,9 +43,6 @@ export default function(hljs) { keyword: [ "alias", "and", - "attr_accessor", - "attr_reader", - "attr_writer", "begin", "BEGIN", "break", @@ -48,7 +58,6 @@ export default function(hljs) { "for", "if", "in", - "include", "module", "next", "not", @@ -65,10 +74,17 @@ export default function(hljs) { "when", "while", "yield", + ...PSEUDO_KWS ], built_in: [ "proc", - "lambda" + "lambda", + "attr_accessor", + "attr_reader", + "attr_writer", + "define_method", + "private_constant", + "module_function" ], literal: [ "true", @@ -227,6 +243,17 @@ export default function(hljs) { ] }; + const INCLUDE_EXTEND = { + match: [ + /(include|extend)\s+/, + CLASS_NAME_WITH_NAMESPACE_RE + ], + scope: { + 2: "title.class" + }, + keywords: RUBY_KEYWORDS + }; + const CLASS_DEFINITION = { variants: [ { @@ -239,7 +266,7 @@ export default function(hljs) { }, { match: [ - /class\s+/, + /\b(class|module)\s+/, CLASS_NAME_WITH_NAMESPACE_RE ] } @@ -275,18 +302,27 @@ export default function(hljs) { relevance: 0, match: [ CLASS_NAME_WITH_NAMESPACE_RE, - /\.new[ (]/ + /\.new[. (]/ ], scope: { 1: "title.class" } }; + // CamelCase + const CLASS_REFERENCE = { + relevance: 0, + match: CLASS_NAME_RE, + scope: "title.class" + }; + const RUBY_DEFAULT_CONTAINS = [ STRING, CLASS_DEFINITION, + INCLUDE_EXTEND, OBJECT_CREATION, UPPER_CASE_CONSTANT, + CLASS_REFERENCE, METHOD_DEFINITION, { // swallow namespace qualifiers before symbols diff --git a/test/markup/haml/default.expect.txt b/test/markup/haml/default.expect.txt index 7a422eb11f..486ea2a173 100644 --- a/test/markup/haml/default.expect.txt +++ b/test/markup/haml/default.expect.txt @@ -11,4 +11,4 @@ =variable2 ~ variable3 ~variable4 - The current year is #{DataTime.now.year}. + The current year is #{DataTime.now.year}. diff --git a/test/markup/http/default.expect.txt b/test/markup/http/default.expect.txt index 73c696acff..06f037c0c5 100644 --- a/test/markup/http/default.expect.txt +++ b/test/markup/http/default.expect.txt @@ -4,4 +4,4 @@ Content-Length: 19 {"status": "ok", "extended": true} - +
\ No newline at end of file diff --git a/test/markup/ruby/prompt.expect.txt b/test/markup/ruby/prompt.expect.txt index bef182b866..a2242b73d1 100644 --- a/test/markup/ruby/prompt.expect.txt +++ b/test/markup/ruby/prompt.expect.txt @@ -28,9 +28,9 @@ irb(main):004:1* end irb(main):005:0> end => :[] -irb(main):006:0> Secret.new[0] +irb(main):006:0> Secret.new[0] => nil -irb(main):008:0> Secret.new[2239232] +irb(main):008:0> Secret.new[2239232] => nil -irb(main):009:0> Secret.new[42] +irb(main):009:0> Secret.new[42] => "TREASURE" From 3b8e56780842e813aee85a4685f5acfb776f0e61 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 16 Oct 2022 06:14:27 -0400 Subject: [PATCH 215/227] fix(typescript) patterns like ` --- CHANGES.md | 3 +++ src/languages/javascript.js | 15 ++++++++++++--- test/markup/typescript/generics.expect.txt | 10 ++++++++++ test/markup/typescript/generics.txt | 10 ++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 test/markup/typescript/generics.expect.txt create mode 100644 test/markup/typescript/generics.txt diff --git a/CHANGES.md b/CHANGES.md index dfa9ca8fe3..d27774f08f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,11 +2,14 @@ New Grammars: +- Added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][] Grammars: +- fix(typescript) patterns like `` - nextChar === ",") { + nextChar === "," + ) { response.ignoreMatch(); return; } @@ -65,10 +66,18 @@ export default function(hljs) { // `` (self-closing) // handled by simpleSelfClosing rule - // `` - // technically this could be HTML, but it smells like a type let m; const afterMatch = match.input.substring(afterMatchIndex); + + // some more template typing stuff + // (key?: string) => Modify< + if ((m = afterMatch.match(/^\s*=/))) { + response.ignoreMatch(); + return; + } + + // `` + // technically this could be HTML, but it smells like a type // NOTE: This is ugh, but added specifically for https://github.com/highlightjs/highlight.js/issues/3276 if ((m = afterMatch.match(/^\s+extends\s+/))) { if (m.index === 0) { diff --git a/test/markup/typescript/generics.expect.txt b/test/markup/typescript/generics.expect.txt new file mode 100644 index 0000000000..8b7705bff6 --- /dev/null +++ b/test/markup/typescript/generics.expect.txt @@ -0,0 +1,10 @@ +import { useWeb3React as useWeb3React_ } from '@web3-react/core' + +export const useWeb3React: <T = any>(key?: string) => Modify< + ReturnType<typeof useWeb3React_<T>>, + { chainId: SupportedChainIds } +> = useWeb3React_ as any + +declare global { + type SupportedChainIds = 1 | 4 +} diff --git a/test/markup/typescript/generics.txt b/test/markup/typescript/generics.txt new file mode 100644 index 0000000000..218c5f0ddc --- /dev/null +++ b/test/markup/typescript/generics.txt @@ -0,0 +1,10 @@ +import { useWeb3React as useWeb3React_ } from '@web3-react/core' + +export const useWeb3React: (key?: string) => Modify< + ReturnType>, + { chainId: SupportedChainIds } +> = useWeb3React_ as any + +declare global { + type SupportedChainIds = 1 | 4 +} From 4a381cc41974f0f5972623a100820b0f8a93161c Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sun, 16 Oct 2022 13:16:18 +0300 Subject: [PATCH 216/227] (chore) Remove travis artifacts (#3628) * Remove travis artifacts --- .travis.yml | 35 ----------------------------------- README.md | 3 +-- test/builds/package.js | 2 +- 3 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 01429794df..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: node_js -node_js: - - "lts/*" - - "node" -env: - # we current only test "use strict" for our NPM builds - - BUILD=node TEST_STRICT_BUNDLE=1 - - BUILD=browser - - BUILD=browser NO_MINIFY=1 -script: - - | - export BUILD_PARAMS="-t $BUILD" - - if [ "x$NO_MINIFY" = "x1" ]; then - export BUILD_PARAMS="$BUILD_PARAMS -n" - fi - - node tools/build.js $BUILD_PARAMS - - # test that our build is "use strict" safe for use with packaging - # systems importing our source thru ES6 modules (rollup, etc.) - if [ "x$TEST_STRICT_BUNDLE" = "x1" ]; then - ./node_modules/.bin/rollup -c test/builds/rollup_import_via_commonjs.js - node build/bundle.js || exit 1 - rm build/bundle.js - fi - - if [ "x$BUILD" = "xnode" ]; then - npm run test - else - npm run test-browser || exit 1 - # our browser build should also work fine as a Node.js CommonJS module - node test/builds/browser_build_as_commonjs.js - fi -sudo: false # Use container-based architecture diff --git a/README.md b/README.md index 035677118c..47a15eaabd 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,7 @@ [![NPM downloads weekly](https://badgen.net/npm/dw/highlight.js?label=npm+downloads&color=purple)](https://www.npmjs.com/package/highlight.js) [![jsDelivr CDN downloads](https://badgen.net/jsdelivr/hits/gh/highlightjs/cdn-release?label=jsDelivr+CDN&color=purple)](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release) - -![build and CI status](https://badgen.net/github/checks/highlightjs/highlight.js/main?label=build) +[![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) [![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) diff --git a/test/builds/package.js b/test/builds/package.js index eaff262ce0..9edaa6778d 100644 --- a/test/builds/package.js +++ b/test/builds/package.js @@ -2,7 +2,7 @@ This file is used by import_via_commonjs.js to build a single "package" and acts as a sanity check that all our code is "use strict" safe -See .travis.yml +See .github/workflows/tests.js.yml */ import hljs from '../../build/lib/index.js'; From 71f5cb2970e26e0b7f9b115368cfff1e13a97fd3 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 16 Oct 2022 06:55:38 -0400 Subject: [PATCH 217/227] fix(markdown) strong/emphasis requires whitespace after (#3520) * Don't let newlines exist in bold+italic for now Let's fix the immediate false positives by disallowing newlines inside of bolds and italics. And in the future, come up with a more robust expression that matches the markdown spec and can handle newlines (or whatever new APIs that may be added). Co-authored-by: Vladimir Jimenez --- src/languages/markdown.js | 8 ++++---- test/markup/markdown/bold_italics.expect.txt | 12 ++++++++++++ test/markup/markdown/bold_italics.txt | 12 ++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/languages/markdown.js b/src/languages/markdown.js index 427f6eab22..7d5a15062f 100644 --- a/src/languages/markdown.js +++ b/src/languages/markdown.js @@ -138,11 +138,11 @@ export default function(hljs) { contains: [], // defined later variants: [ { - begin: /_{2}/, + begin: /_{2}(?!\s)/, end: /_{2}/ }, { - begin: /\*{2}/, + begin: /\*{2}(?!\s)/, end: /\*{2}/ } ] @@ -152,11 +152,11 @@ export default function(hljs) { contains: [], // defined later variants: [ { - begin: /\*(?!\*)/, + begin: /\*(?![*\s])/, end: /\*/ }, { - begin: /_(?!_)/, + begin: /_(?![_\s])/, end: /_/, relevance: 0 } diff --git a/test/markup/markdown/bold_italics.expect.txt b/test/markup/markdown/bold_italics.expect.txt index ddc8a59558..a08ae07756 100644 --- a/test/markup/markdown/bold_italics.expect.txt +++ b/test/markup/markdown/bold_italics.expect.txt @@ -19,3 +19,15 @@ ***This is bold and italic*** ___This is bold and italic___ + +** i shouldn't be italic** + +* and I shouldn't be italic either* + +__ not really bold__ + +_ not italic_ + +> * One (this point is italic) +> * Two +> * Three diff --git a/test/markup/markdown/bold_italics.txt b/test/markup/markdown/bold_italics.txt index 5f15ea0d7b..c85202e554 100644 --- a/test/markup/markdown/bold_italics.txt +++ b/test/markup/markdown/bold_italics.txt @@ -19,3 +19,15 @@ __Bold *then italic*__ ***This is bold and italic*** ___This is bold and italic___ + +** i shouldn't be italic** + +* and I shouldn't be italic either* + +__ not really bold__ + +_ not italic_ + +> * One (this point is italic) +> * Two +> * Three From abcb53deafd07aaa4ef787c8a9285acb25912051 Mon Sep 17 00:00:00 2001 From: Jan Pilzer Date: Sat, 22 Oct 2022 20:41:03 -0700 Subject: [PATCH 218/227] enh(cmake) support bracket comments (#3644) --- CHANGES.md | 3 ++- src/languages/cmake.js | 1 + test/markup/cmake/default.expect.txt | 4 ++++ test/markup/cmake/default.txt | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index d27774f08f..87eba192ed 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,6 @@ New Grammars: -- Added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][] @@ -14,12 +13,14 @@ Grammars: - fix(js) do not flag `import()` as a function, rather a keyword [nathnolt][] - fix(bash) recognize the `((` keyword [Nick Chambers][] - fix(nix) support escaped dollar signs in strings [h7x4][] +- enh(cmake) support bracket comments [Hirse][] [Josh Goebel]: https://github.com/joshgoebel [Josh Temple]: https://github.com/joshtemple [nathnolt]: https://github.com/nathnolt [Nick Chambers]: https://github.com/uplime [h7x4]: https://github.com/h7x4 +[Hirse]: https://github.com/Hirse ## Version 11.6.0 diff --git a/src/languages/cmake.js b/src/languages/cmake.js index dddbfc0dde..e5ba49b8cc 100644 --- a/src/languages/cmake.js +++ b/src/languages/cmake.js @@ -52,6 +52,7 @@ export default function(hljs) { begin: /\$\{/, end: /\}/ }, + hljs.COMMENT(/#\[\[/, /]]/), hljs.HASH_COMMENT_MODE, hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE diff --git a/test/markup/cmake/default.expect.txt b/test/markup/cmake/default.expect.txt index 638923c572..fd6c45401d 100644 --- a/test/markup/cmake/default.expect.txt +++ b/test/markup/cmake/default.expect.txt @@ -17,3 +17,7 @@ add_executable(myproject main.cpp mainwindow.cpp) qt5_use_modules(myproject Widgets) + +#[[This is a bracket comment. +It runs until the close bracket.]] +message("First Argument\n" #[[Bracket Comment]] "Second Argument") diff --git a/test/markup/cmake/default.txt b/test/markup/cmake/default.txt index 2bbea38c9d..1f4d7faa69 100644 --- a/test/markup/cmake/default.txt +++ b/test/markup/cmake/default.txt @@ -17,3 +17,7 @@ find_package(Qt5Widgets REQUIRED) add_executable(myproject main.cpp mainwindow.cpp) qt5_use_modules(myproject Widgets) + +#[[This is a bracket comment. +It runs until the close bracket.]] +message("First Argument\n" #[[Bracket Comment]] "Second Argument") From f035aabe4249e65bddf23e04de8cbcab7712c104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Merlin=20B=C3=B6gershausen?= Date: Sun, 30 Oct 2022 17:51:17 +0100 Subject: [PATCH 219/227] (java) add `permits` keyword (#3649) --- CHANGES.md | 2 ++ src/languages/java.js | 3 ++- test/markup/java/titles.expect.txt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 87eba192ed..3dc5275583 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Grammars: - fix(bash) recognize the `((` keyword [Nick Chambers][] - fix(nix) support escaped dollar signs in strings [h7x4][] - enh(cmake) support bracket comments [Hirse][] +- enh(java) add permits keyword to java [MBoegers][] [Josh Goebel]: https://github.com/joshgoebel [Josh Temple]: https://github.com/joshtemple @@ -21,6 +22,7 @@ Grammars: [Nick Chambers]: https://github.com/uplime [h7x4]: https://github.com/h7x4 [Hirse]: https://github.com/Hirse +[MBoegers]: https://github.com/MBoegers ## Version 11.6.0 diff --git a/src/languages/java.js b/src/languages/java.js index 9a0cf137f5..9a766eeb29 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -72,7 +72,8 @@ export default function(hljs) { 'requires', 'exports', 'do', - 'sealed' + 'sealed', + 'permits' ]; const BUILT_INS = [ diff --git a/test/markup/java/titles.expect.txt b/test/markup/java/titles.expect.txt index 2043511c9a..5162edadf6 100644 --- a/test/markup/java/titles.expect.txt +++ b/test/markup/java/titles.expect.txt @@ -9,7 +9,7 @@ } } -sealed interface Command permits LoginCommand { +sealed interface Command permits LoginCommand { void run(); } From bc88ed5c03c9d9f1255bd420a08784c5e9db62b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Merlin=20B=C3=B6gershausen?= Date: Sun, 30 Oct 2022 17:57:31 +0100 Subject: [PATCH 220/227] (java) add Java 14 switch expression keyword `yield` (#3650) --- CHANGES.md | 1 + src/languages/java.js | 1 + test/markup/java/switch.expect.txt | 13 +++++++++++++ test/markup/java/switch.txt | 13 +++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 test/markup/java/switch.expect.txt create mode 100644 test/markup/java/switch.txt diff --git a/CHANGES.md b/CHANGES.md index 3dc5275583..4f892a69b8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Grammars: - fix(bash) recognize the `((` keyword [Nick Chambers][] - fix(nix) support escaped dollar signs in strings [h7x4][] - enh(cmake) support bracket comments [Hirse][] +- enh(java) add yield keyword to java [MBoegers][] - enh(java) add permits keyword to java [MBoegers][] [Josh Goebel]: https://github.com/joshgoebel diff --git a/src/languages/java.js b/src/languages/java.js index 9a766eeb29..cdbb1e9f94 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -73,6 +73,7 @@ export default function(hljs) { 'exports', 'do', 'sealed', + 'yield', 'permits' ]; diff --git a/test/markup/java/switch.expect.txt b/test/markup/java/switch.expect.txt new file mode 100644 index 0000000000..63950d1ad8 --- /dev/null +++ b/test/markup/java/switch.expect.txt @@ -0,0 +1,13 @@ +switch(a) { + case null -> yield "n"; + case String s -> yield "s"; + case Object o -> yield "o"; + default: yield "d", +} + +switch(a) { + case null: return "n"; + case "s": return "s"; + case "o": return "o"; + default: return "d"; +} diff --git a/test/markup/java/switch.txt b/test/markup/java/switch.txt new file mode 100644 index 0000000000..de7fd24061 --- /dev/null +++ b/test/markup/java/switch.txt @@ -0,0 +1,13 @@ +switch(a) { + case null -> yield "n"; + case String s -> yield "s"; + case Object o -> yield "o"; + default: yield "d", +} + +switch(a) { + case null: return "n"; + case "s": return "s"; + case "o": return "o"; + default: return "d"; +} From 14b550dae4341150609ae2340d86046b46b1fc95 Mon Sep 17 00:00:00 2001 From: Asai Toshiya Date: Wed, 2 Nov 2022 07:24:59 +0900 Subject: [PATCH 221/227] (docs) Add tsx alias (#3651) --- SUPPORTED_LANGUAGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 4ecc39ec13..361bc9da4b 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -213,7 +213,7 @@ The table below shows the full list of languages (and corresponding classes/alia | TP | tp | | | Transact-SQL | tsql | [highlightjs-tsql](https://github.com/highlightjs/highlightjs-tsql) | | Twig | twig, craftcms | | -| TypeScript | typescript, ts | | +| TypeScript | typescript, ts, tsx | | | Unicorn Rails log | unicorn-rails-log | [highlightjs-unicorn-rails-log](https://github.com/sweetppro/highlightjs-unicorn-rails-log) | | VB.Net | vbnet, vb | | | VBA | vba | [highlightjs-vba](https://github.com/dullin/highlightjs-vba) | From e0f75779513fd6fd112cc08e326785a3e04d0635 Mon Sep 17 00:00:00 2001 From: Jakob Schneider <60233376+jaschdoc@users.noreply.github.com> Date: Tue, 1 Nov 2022 23:28:32 +0100 Subject: [PATCH 222/227] Add Flix to SUPPORTED_LANGUAGES.md (#3637) --- CHANGES.md | 3 ++- SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 4f892a69b8..3b74e41ab3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ New Grammars: - added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][] +- Added 3rd party Flix grammar to SUPPORTED_LANGUAGES [The Flix Organisation][] Grammars: @@ -23,9 +24,9 @@ Grammars: [Nick Chambers]: https://github.com/uplime [h7x4]: https://github.com/h7x4 [Hirse]: https://github.com/Hirse +[The Flix Organisation]: https://github.com/flix [MBoegers]: https://github.com/MBoegers - ## Version 11.6.0 Supported Node.js versions: diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 361bc9da4b..ed25267b0f 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -77,6 +77,7 @@ The table below shows the full list of languages (and corresponding classes/alia | Extempore | extempore, xtlang, xtm | [highlightjs-xtlang](https://github.com/highlightjs/highlightjs-xtlang) | | F# | fsharp, fs | | | FIX | fix | | +| Flix | flix | [highlightjs-flix](https://github.com/flix/highlightjs-flix) | | Fortran | fortran, f90, f95 | | | FunC | func | [highlightjs-func](https://github.com/highlightjs/highlightjs-func) | | G-Code | gcode, nc | | From 4f5b769f2e8eb668a0aac90998d16c99d119fdd3 Mon Sep 17 00:00:00 2001 From: Lachlan Heywood Date: Fri, 4 Nov 2022 18:30:01 -0400 Subject: [PATCH 223/227] fix(js/ts) prevent `$[number]` variables as false positives as numeric (#3648) --- CHANGES.md | 2 ++ src/languages/javascript.js | 4 ++++ test/markup/javascript/numbers.expect.txt | 21 +++++++++++++++++++++ test/markup/javascript/numbers.txt | 21 +++++++++++++++++++++ 4 files changed, 48 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 3b74e41ab3..7d32ad5dec 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ Grammars: - enh(cmake) support bracket comments [Hirse][] - enh(java) add yield keyword to java [MBoegers][] - enh(java) add permits keyword to java [MBoegers][] +- fix(javascript/typescript) correct identifier matching when using numbers [Lachlan Heywood][] [Josh Goebel]: https://github.com/joshgoebel [Josh Temple]: https://github.com/joshtemple @@ -26,6 +27,7 @@ Grammars: [Hirse]: https://github.com/Hirse [The Flix Organisation]: https://github.com/flix [MBoegers]: https://github.com/MBoegers +[Lachlan Heywood]: https://github.com/lachieh ## Version 11.6.0 diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 6db241a4af..e999cc66fe 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -220,6 +220,8 @@ export default function(hljs) { HTML_TEMPLATE, CSS_TEMPLATE, TEMPLATE_STRING, + // Skip numbers when they are part of a variable name + { match: /\$\d+/ }, NUMBER, // This is intentional: // See https://github.com/highlightjs/highlight.js/issues/3288 @@ -453,6 +455,8 @@ export default function(hljs) { CSS_TEMPLATE, TEMPLATE_STRING, COMMENT, + // Skip numbers when they are part of a variable name + { match: /\$\d+/ }, NUMBER, CLASS_REFERENCE, { diff --git a/test/markup/javascript/numbers.expect.txt b/test/markup/javascript/numbers.expect.txt index 1fd58c42fa..f15c1081d6 100644 --- a/test/markup/javascript/numbers.expect.txt +++ b/test/markup/javascript/numbers.expect.txt @@ -75,3 +75,24 @@ x0.e1 0b1e1 0N 00. + +// numbers in identifiers +const num = $1 +const num = $0n9 +const num = $abc012 +const num = $0x9 +const num = $0o0 +const num = $09 +const num = $9.09 +const num = $a9 +const num = 1 +const num = 0n9 +const num = 0x9 +const num = 0o0 +const num = 09 +const num = 9.09 +const num = a9 + +// numbers in identifiers in template strings +cosnt string = `${$0}` +cosnt string = `${0}` diff --git a/test/markup/javascript/numbers.txt b/test/markup/javascript/numbers.txt index 05baf74710..daa651082b 100644 --- a/test/markup/javascript/numbers.txt +++ b/test/markup/javascript/numbers.txt @@ -75,3 +75,24 @@ x0.e1 0b1e1 0N 00. + +// numbers in identifiers +const num = $1 +const num = $0n9 +const num = $abc012 +const num = $0x9 +const num = $0o0 +const num = $09 +const num = $9.09 +const num = $a9 +const num = 1 +const num = 0n9 +const num = 0x9 +const num = 0o0 +const num = 09 +const num = 9.09 +const num = a9 + +// numbers in identifiers in template strings +cosnt string = `${$0}` +cosnt string = `${0}` From 3997c9b430a568d5ad46d96693b90a74fc01ea7f Mon Sep 17 00:00:00 2001 From: matyklug18 <32399575+matyklug18@users.noreply.github.com> Date: Wed, 9 Nov 2022 00:23:58 +0100 Subject: [PATCH 224/227] (end) Added `scm` alias to scheme (#3654) --- CHANGES.md | 3 ++- src/languages/scheme.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 7d32ad5dec..3e14eb1cfe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,7 +7,7 @@ New Grammars: - Added 3rd party Flix grammar to SUPPORTED_LANGUAGES [The Flix Organisation][] Grammars: - +- enh(scheme) add `scm` alias for Scheme [matyklug18][] - fix(typescript) patterns like ` Date: Sun, 13 Nov 2022 21:14:50 +0000 Subject: [PATCH 225/227] (docs) fixed typo (#3660) --- CHANGES.md | 5 +++++ docs/api.rst | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3e14eb1cfe..ab0bf5a79f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,10 @@ Grammars: - enh(java) add permits keyword to java [MBoegers][] - fix(javascript/typescript) correct identifier matching when using numbers [Lachlan Heywood][] +Improvements: + +- Documentation typo fix by [Eddymens][] + [matyklug18]: https://github.com/matyklug18 [Josh Goebel]: https://github.com/joshgoebel [Josh Temple]: https://github.com/joshtemple @@ -29,6 +33,7 @@ Grammars: [The Flix Organisation]: https://github.com/flix [MBoegers]: https://github.com/MBoegers [Lachlan Heywood]: https://github.com/lachieh +[Eddymens]: https://github.com/eddymens ## Version 11.6.0 diff --git a/docs/api.rst b/docs/api.rst index f4301a2889..fc5c9dc81e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -15,7 +15,7 @@ highlight Core highlighting function. Accepts the code to highlight (string) and a list of options (object). The ``language`` parameter must be present and specify the language name or alias of the grammar to be used for highlighting. -The ``ignoreIllegals`` is an optional parameter than when true forces highlighting +The ``ignoreIllegals`` is an optional parameter that when ``true`` forces highlighting to finish even in case of detecting illegal syntax for the language instead of throwing an exception. From e57bf136de722b1b55679732be19aa19eaccb702 Mon Sep 17 00:00:00 2001 From: Sopitive <30811278+Sopitive@users.noreply.github.com> Date: Sat, 19 Nov 2022 17:06:09 -0700 Subject: [PATCH 226/227] (docs) add RVT Script to SUPPORTED_LANGUAGES (#3666) --- CHANGES.md | 2 ++ SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index ab0bf5a79f..d697963d77 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ New Grammars: - added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][] - Added 3rd party Flix grammar to SUPPORTED_LANGUAGES [The Flix Organisation][] +- Added 3rd party RVT grammar to SUPPORTED_LANGUAGES [Sopitive][] Grammars: - enh(scheme) add `scm` alias for Scheme [matyklug18][] @@ -34,6 +35,7 @@ Improvements: [MBoegers]: https://github.com/MBoegers [Lachlan Heywood]: https://github.com/lachieh [Eddymens]: https://github.com/eddymens +[Sopitive]: https://github.com/Sopitive ## Version 11.6.0 diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index ed25267b0f..60a834d162 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -184,6 +184,7 @@ The table below shows the full list of languages (and corresponding classes/alia | RPM spec files | rpm-specfile, rpm, spec, rpm-spec, specfile | [highlightjs-rpm-specfile](https://github.com/highlightjs/highlightjs-rpm-specfile) | | Ruby | ruby, rb, gemspec, podspec, thor, irb | | | Rust | rust, rs | | +| RVT Script | rvt, rvt-script | [highlightjs-rvt-script](https://github.com/Sopitive/highlightjs-rvt-script) | | SAS | SAS, sas | | | SCSS | scss | | | SQL | sql | | From 82688fad1880f0bf8bbd80b470cddaad61bbcc2d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 23 Nov 2022 17:05:22 -0500 Subject: [PATCH 227/227] (release) bump 11.7.0 --- CHANGES.md | 2 ++ README.md | 36 ++++++++++++++++++------------------ docs/conf.py | 2 +- package-lock.json | 16 ++++++++-------- package.json | 2 +- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d697963d77..a239d1fa98 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ New Grammars: - Added 3rd party RVT grammar to SUPPORTED_LANGUAGES [Sopitive][] Grammars: + - enh(scheme) add `scm` alias for Scheme [matyklug18][] - fix(typescript) patterns like ` ```html - - + + - + ``` ##### ES6 Modules ````html - + @@ -352,20 +352,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` @@ -375,20 +375,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` diff --git a/docs/conf.py b/docs/conf.py index cc3cf1a1bd..b111ed9bf3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,7 @@ # built documents. # The full version, including alpha/beta/rc tags. -release = '11.6.0' +release = '11.7.0' # The short X.Y version. version = ".".join(release.split(".")[:2]) diff --git a/package-lock.json b/package-lock.json index 5e18692e2a..53fa144c56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "highlight.js", - "version": "11.6.0", + "version": "11.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "highlight.js", - "version": "11.6.0", + "version": "11.7.0", "license": "BSD-3-Clause", "devDependencies": { "@colors/colors": "^1.5.0", @@ -3906,9 +3906,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz", - "integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", + "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.2", @@ -7236,9 +7236,9 @@ "dev": true }, "terser": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz", - "integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", + "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.2", diff --git a/package.json b/package.json index 9af5ce8189..2ab70f829f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "11.6.0", + "version": "11.7.0", "author": "Josh Goebel ", "contributors": [ "Josh Goebel ",