Socket
Socket
Sign inDemoInstall

highlight.js

Package Overview
Dependencies
Maintainers
2
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

highlight.js - npm Package Compare versions

Comparing version 9.9.0 to 9.10.0

lib/languages/hy.js

28

lib/highlight.js

@@ -105,11 +105,13 @@ /*

function inherit(parent, obj) {
function inherit(parent) { // inherit(parent, override_obj, override_obj, ...)
var key;
var result = {};
var objects = Array.prototype.slice.call(arguments, 1);
for (key in parent)
result[key] = parent[key];
if (obj)
objects.forEach(function(obj) {
for (key in obj)
result[key] = obj[key];
});
return result;

@@ -225,2 +227,11 @@ }

function expand_mode(mode) {
if (mode.variants && !mode.cached_variants) {
mode.cached_variants = mode.variants.map(function(variant) {
return inherit(mode, {variants: null}, variant);
});
}
return mode.cached_variants || (mode.endsWithParent && [inherit(mode)]) || [mode];
}
function compileLanguage(language) {

@@ -291,11 +302,5 @@

}
var expanded_contains = [];
mode.contains.forEach(function(c) {
if (c.variants) {
c.variants.forEach(function(v) {expanded_contains.push(inherit(c, v));});
} else {
expanded_contains.push(c === 'self' ? mode : c);
}
});
mode.contains = expanded_contains;
mode.contains = Array.prototype.concat.apply([], mode.contains.map(function(c) {
return expand_mode(c === 'self' ? mode : c)
}));
mode.contains.forEach(function(c) {compileMode(c, mode);});

@@ -599,2 +604,3 @@

}
return '';
});

@@ -601,0 +607,0 @@ }

@@ -80,2 +80,3 @@ var hljs = require('./highlight');

hljs.registerLanguage('http', require('./languages/http'));
hljs.registerLanguage('hy', require('./languages/hy'));
hljs.registerLanguage('inform7', require('./languages/inform7'));

@@ -91,2 +92,3 @@ hljs.registerLanguage('ini', require('./languages/ini'));

hljs.registerLanguage('ldif', require('./languages/ldif'));
hljs.registerLanguage('leaf', require('./languages/leaf'));
hljs.registerLanguage('less', require('./languages/less'));

@@ -111,2 +113,3 @@ hljs.registerLanguage('lisp', require('./languages/lisp'));

hljs.registerLanguage('moonscript', require('./languages/moonscript'));
hljs.registerLanguage('n1ql', require('./languages/n1ql'));
hljs.registerLanguage('nginx', require('./languages/nginx'));

@@ -113,0 +116,0 @@ hljs.registerLanguage('nimrod', require('./languages/nimrod'));

@@ -51,3 +51,3 @@ module.exports = function(hljs) {

className: 'meta-string',
begin: '<', end: '>',
begin: /<[^\n>]*>/, end: /$/,
illegal: '\\n',

@@ -54,0 +54,0 @@ },

@@ -53,3 +53,3 @@ module.exports = function(hljs) {

'hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 ' +
'indicesf indicesfn indnv indsav indx integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 ' +
'indicesf indicesfn indnv indsav integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 ' +
'inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf ' +

@@ -94,3 +94,5 @@ 'isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv ' +

'writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM ' +
'xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics',
'xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics cdfEmpirical dot h5create h5open h5read h5readAttribute ' +
'h5write h5writeAttribute ldl plotAddErrorBar plotAddSurface plotCDFEmpirical plotSetColormap plotSetContourLabels ' +
'plotSetLegendFont plotSetTextInterpreter plotSetXTicCount plotSetYTicCount plotSetZLevels powerm strjoin strtrim sylvester',
literal: 'DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS ' +

@@ -97,0 +99,0 @@ 'DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 ' +

@@ -1,2 +0,2 @@

module.exports = function (hljs) {
module.exports = function(hljs) {
var KEYWORDS = {

@@ -6,3 +6,3 @@ keyword:

'crossinline dynamic final enum if else do while for when throw try catch finally ' +
'import package is in fun override companion reified inline ' +
'import package is in fun override companion reified inline lateinit init' +
'interface annotation data sealed internal infix operator out by constructor super ' +

@@ -9,0 +9,0 @@ // to be deleted soon

@@ -22,10 +22,20 @@ module.exports = function(hljs) {

keywords: {
keyword:
'and break do else elseif end false for if in local nil not or repeat return then ' +
'true until while',
literal: "true false nil",
keyword: "and break do else elseif end for goto if in local not or repeat return then until while",
built_in:
'_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load ' +
'loadfile loadstring module next pairs pcall print rawequal rawget rawset require ' +
'select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug ' +
'io math os package string table'
//Metatags and globals:
'_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len ' +
'__gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert ' +
//Standard methods and properties:
'collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring' +
'module next pairs pcall print rawequal rawget rawset require select setfenv' +
'setmetatable tonumber tostring type unpack xpcall arg self' +
//Library methods and properties (one line per library):
'coroutine resume yield status wrap create running debug getupvalue' +
'debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv' +
'io lines write close flush open output type read stderr stdin input stdout popen tmpfile' +
'math, log, max, acos, huge, ldexp, pi, cos, tanh, pow, deg, tan, cosh, sinh, random, randomseed, frexp, ceil, floor, rad, abs, sqrt, modf, asin, min, mod, fmod, log10, atan2, exp, sin, atan' +
'os, exit, setlocale, date, getenv, difftime, remove, time, clock, tmpname, rename, execute, package, preload, loadlib, loaded, loaders, cpath, config path, seeall' +
'string, sub, upper, len, gfind, rep, find, match, char, dump, gmatch, reverse, byte, format, gsub, lower' +
'table, setn, insert, getn, foreachi, maxn, foreach, concat, sort, remove'
},

@@ -32,0 +42,0 @@ contains: COMMENTS.concat([

module.exports = function(hljs) {
var KEYWORDS = {
keyword:
'and elif is global as in if from raise for except finally print import pass return ' +
'exec else break not with class assert yield try while continue del or def lambda ' +
'async await nonlocal|10 None True False',
built_in:
'Ellipsis NotImplemented'
};
var PROMPT = {
className: 'meta', begin: /^(>>>|\.\.\.) /
};
var SUBST = {
className: 'subst',
begin: /\{/, end: /\}/,
keywords: KEYWORDS,
illegal: /#/
};
var STRING = {

@@ -20,2 +34,10 @@ className: 'string',

{
begin: /(fr|rf|f)'''/, end: /'''/,
contains: [PROMPT, SUBST]
},
{
begin: /(fr|rf|f)"""/, end: /"""/,
contains: [PROMPT, SUBST]
},
{
begin: /(u|r|ur)'/, end: /'/,

@@ -34,2 +56,10 @@ relevance: 10

},
{
begin: /(fr|rf|f)'/, end: /'/,
contains: [SUBST]
},
{
begin: /(fr|rf|f)"/, end: /"/,
contains: [SUBST]
},
hljs.APOS_STRING_MODE,

@@ -52,12 +82,6 @@ hljs.QUOTE_STRING_MODE

};
SUBST.contains = [STRING, NUMBER, PROMPT];
return {
aliases: ['py', 'gyp'],
keywords: {
keyword:
'and elif is global as in if from raise for except finally print import pass return ' +
'exec else break not with class assert yield try while continue del or def lambda ' +
'async await nonlocal|10 None True False',
built_in:
'Ellipsis NotImplemented'
},
keywords: KEYWORDS,
illegal: /(<\/|->|\?)|=>/,

@@ -64,0 +88,0 @@ contains: [

module.exports = function(hljs) {
var NUM_SUFFIX = '([uif](8|16|32|64|size))\?';
var NUM_SUFFIX = '([ui](8|16|32|64|128|size)|f(32|64))\?';
var KEYWORDS =

@@ -7,13 +7,17 @@ 'alignof as be box break const continue crate do else enum extern ' +

'proc pub pure ref return self Self sizeof static struct super trait true ' +
'type typeof unsafe unsized use virtual while where yield move default ' +
'int i8 i16 i32 i64 isize ' +
'uint u8 u32 u64 usize ' +
'float f32 f64 ' +
'str char bool'
'type typeof unsafe unsized use virtual while where yield move default';
var BUILTINS =
// prelude
'Copy Send Sized Sync Drop Fn FnMut FnOnce drop Box ToOwned Clone ' +
// functions
'drop ' +
// types
'i8 i16 i32 i64 i128 isize ' +
'u8 u16 u32 u64 u128 usize ' +
'f32 f64 ' +
'str char bool ' +
'Box Option Result String Vec ' +
// traits
'Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug ' +
'PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator ' +
'Extend IntoIterator DoubleEndedIterator ExactSizeIterator Option ' +
'Result SliceConcatExt String ToString Vec ' +
'Extend IntoIterator DoubleEndedIterator ExactSizeIterator ' +
'SliceConcatExt ToString ' +
// macros

@@ -24,3 +28,3 @@ 'assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! ' +

'option_env! print! println! select! stringify! try! unimplemented! ' +
'unreachable! vec! write! writeln! macro_rules!';
'unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!';
return {

@@ -90,3 +94,3 @@ aliases: ['rs'],

className: 'class',
beginKeywords: 'trait enum struct', end: '{',
beginKeywords: 'trait enum struct union', end: '{',
contains: [

@@ -93,0 +97,0 @@ hljs.inherit(hljs.UNDERSCORE_TITLE_MODE, {endsParent: true})

@@ -99,3 +99,6 @@ module.exports = function(hljs) {

var QUOTED_LIST = {
begin: /'/,
variants: [
{ begin: /'/ },
{ begin: '`' }
],
contains: [

@@ -102,0 +105,0 @@ {

@@ -7,3 +7,4 @@ module.exports = function(hljs) {

'let yield const class public private protected get set super ' +
'static implements enum export import declare type namespace abstract',
'static implements enum export import declare type namespace abstract ' +
'as from extends async await',
literal:

@@ -18,3 +19,3 @@ 'true false null undefined NaN Infinity',

'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
'module console window document any number boolean string void'
'module console window document any number boolean string void Promise'
};

@@ -60,3 +61,31 @@

hljs.C_BLOCK_COMMENT_MODE,
hljs.REGEXP_MODE
hljs.REGEXP_MODE,
{
className: 'function',
begin: '(\\(.*?\\)|' + hljs.IDENT_RE + ')\\s*=>', returnBegin: true,
end: '\\s*=>',
contains: [
{
className: 'params',
variants: [
{
begin: hljs.IDENT_RE
},
{
begin: /\(\s*\)/,
},
{
begin: /\(/, end: /\)/,
excludeBegin: true, excludeEnd: true,
keywords: KEYWORDS,
contains: [
'self',
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
}
]
}
]
}
],

@@ -63,0 +92,0 @@ relevance: 0

module.exports = function(hljs) {
var LITERALS = {literal: '{ } true false yes no Yes No True False null'};
var LITERALS = 'true false yes no null';

@@ -27,3 +27,4 @@ var keyPrefix = '^[ \\-]*';

{begin: /'/, end: /'/},
{begin: /"/, end: /"/}
{begin: /"/, end: /"/},
{begin: /\S+/}
],

@@ -78,8 +79,11 @@ contains: [

},
STRING,
hljs.HASH_COMMENT_MODE,
hljs.C_NUMBER_MODE
],
keywords: LITERALS
{
beginKeywords: LITERALS,
keywords: {literal: LITERALS}
},
hljs.C_NUMBER_MODE,
STRING
]
};
};

@@ -9,3 +9,3 @@ {

"homepage": "https://highlightjs.org/",
"version": "9.9.0",
"version": "9.10.0",
"author": {

@@ -919,2 +919,42 @@ "name": "Ivan Sagalaev",

"email": "contact@f0rki.at"
},
{
"name": "Sergey Sobko",
"email": "s.sobko@profitware.ru"
},
{
"name": "Hale Chan",
"email": "halechan@qq.com"
},
{
"name": "Matt Evans",
"email": "syrius3@gmail.com"
},
{
"name": "Kasper Andersen",
"email": "kma_untrusted@protonmail.com"
},
{
"name": "Philipp A.",
"email": "flying-sheep@web.de"
},
{
"name": "Guannan Wei",
"email": "guannanwei@outlook.com"
},
{
"name": "Sam Wu",
"email": "samsam2310@gmail.com"
},
{
"name": "Ike Ku",
"email": "dempfi@yahoo.com"
},
{
"name": "Andres Täht",
"email": "andres.taht@gmail.com"
},
{
"name": "Rene Saarsoo",
"email": "nene@triin.net"
}

@@ -921,0 +961,0 @@ ],

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc