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.2.0 to 9.3.0

lib/languages/moonscript.js

9

lib/highlight.js

@@ -228,3 +228,3 @@ /*

}
mode.lexemesRe = langRe(mode.lexemes || /\b\w+\b/, true);
mode.lexemesRe = langRe(mode.lexemes || /\w+/, true);

@@ -521,6 +521,3 @@ if (parent) {

var second_best = result;
languageSubset.forEach(function(name) {
if (!getLanguage(name)) {
return;
}
languageSubset.filter(getLanguage).forEach(function(name) {
var current = highlight(name, text, false);

@@ -709,3 +706,3 @@ current.language = name;

hljs.PHRASAL_WORDS_MODE = {
begin: /\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\b/
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\b/
};

@@ -712,0 +709,0 @@ hljs.COMMENT = function (begin, end, inherits) {

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

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

@@ -136,2 +137,3 @@ hljs.registerLanguage('nimrod', require('./languages/nimrod'));

hljs.registerLanguage('swift', require('./languages/swift'));
hljs.registerLanguage('taggerscript', require('./languages/taggerscript'));
hljs.registerLanguage('tcl', require('./languages/tcl'));

@@ -138,0 +140,0 @@ hljs.registerLanguage('tex', require('./languages/tex'));

@@ -83,2 +83,10 @@ module.exports = function(hljs) {

var EXPRESSION_CONTAINS = [
CPP_PRIMATIVE_TYPES,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
NUMBERS,
STRINGS
];
return {

@@ -88,8 +96,3 @@ aliases: ['c', 'cc', 'h', 'c++', 'h++', 'hpp'],

illegal: '</',
contains: [
CPP_PRIMATIVE_TYPES,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
NUMBERS,
STRINGS,
contains: EXPRESSION_CONTAINS.concat([
PREPROCESSOR,

@@ -106,5 +109,18 @@ {

{
// Expression keywords prevent 'keyword Name(...) or else if(...)' from
// being recognized as a function definition
beginKeywords: 'new throw return else',
// This mode covers expression context where we can't expect a function
// definition and shouldn't highlight anything that looks like one:
// `return some()`, `else if()`, `(x*sum(1, 2))`
variants: [
{begin: /=/, end: /;/},
{begin: /\(/, end: /\)/},
{beginKeywords: 'new throw return else', end: /;/}
],
keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat([
{
begin: /\(/, end: /\)/,
contains: EXPRESSION_CONTAINS.concat(['self']),
relevance: 0
}
]),
relevance: 0

@@ -142,4 +158,4 @@ },

}
]
])
};
};

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

variants: [
{begin: '//[a-z]*', relevance: 0},
{begin: '/', end: '/[a-z]*'},

@@ -94,3 +95,5 @@ {begin: '%r\\(', end: '\\)', contains: recursiveParen('\\(', '\\)')},

begin: '@\\[', end: '\\]',
relevance: 5
contains: [
hljs.inherit(hljs.QUOTE_STRING_MODE, {className: 'meta-string'})
]
};

@@ -168,3 +171,2 @@ var CRYSTAL_DEFAULT_CONTAINS = [

SUBST.contains = CRYSTAL_DEFAULT_CONTAINS;
ATTRIBUTE.contains = CRYSTAL_DEFAULT_CONTAINS;
EXPANSION.contains = CRYSTAL_DEFAULT_CONTAINS.slice(1); // without EXPANSION

@@ -171,0 +173,0 @@

module.exports = function(hljs) {
var KEYWORDS =
// Normal keywords.
'abstract as base bool break byte case catch char checked const continue decimal dynamic ' +
'default delegate do double else enum event explicit extern false finally fixed float ' +
'for foreach goto if implicit in int interface internal is lock long null when ' +
'object operator out override params private protected public readonly ref sbyte ' +
'sealed short sizeof stackalloc static string struct switch this true try typeof ' +
'uint ulong unchecked unsafe ushort using virtual volatile void while async ' +
'protected public private internal ' +
// Contextual keywords.
'ascending descending from get group into join let orderby partial select set value var ' +
'where yield';
var GENERIC_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '>)?';
var KEYWORDS = {
keyword:
// Normal keywords.
'abstract as base bool break byte case catch char checked const continue decimal dynamic ' +
'default delegate do double else enum event explicit extern finally fixed float ' +
'for foreach goto if implicit in int interface internal is lock long when ' +
'object operator out override params private protected public readonly ref sbyte ' +
'sealed short sizeof stackalloc static string struct switch this try typeof ' +
'uint ulong unchecked unsafe ushort using virtual volatile void while async ' +
'protected public private internal ' +
// Contextual keywords.
'ascending descending from get group into join let orderby partial select set value var ' +
'where yield',
literal:
'null false true'
};
var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '>)?(\\[\\])?';
return {

@@ -84,3 +88,3 @@ aliases: ['csharp'],

className: 'function',
begin: '(' + GENERIC_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true, end: /[{;=]/,
begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true, end: /[{;=]/,
excludeEnd: true,

@@ -87,0 +91,0 @@ keywords: KEYWORDS,

@@ -74,6 +74,7 @@ module.exports = function(hljs) {

// the default mode which is how it should be.
illegal: /:/, // break on Less variables @var: ...
contains: [
{
className: 'keyword',
begin: /\S+/
begin: /\w+/
},

@@ -80,0 +81,0 @@ {

module.exports = function(hljs) {
var COMMENT = hljs.COMMENT(
/@?rem\b/, /$/,
/^\s*@?rem\b/, /$/,
{

@@ -5,0 +5,0 @@ relevance: 10

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

className: 'symbol',
begin: ':',
begin: ':(?!\\s)',
contains: [STRING, {begin: ELIXIR_METHOD_RE}],

@@ -50,0 +50,0 @@ relevance: 0

module.exports = function (hljs) {
var KEYWORDS =
'abort acronym acronyms alias all and assign binary card diag display else1 eps eq equation equations file files ' +
'for1 free ge gt if inf integer le loop lt maximizing minimizing model models na ne negative no not option ' +
'options or ord parameter parameters positive prod putpage puttl repeat sameas scalar scalars semicont semiint ' +
'set1 sets smax smin solve sos1 sos2 sum system table then until using variable variables while1 xor yes';
var KEYWORDS = {
'keyword':
'abort acronym acronyms alias all and assign binary card diag display ' +
'else eq file files for free ge gt if integer le loop lt maximizing ' +
'minimizing model models ne negative no not option options or ord ' +
'positive prod put putpage puttl repeat sameas semicont semiint smax ' +
'smin solve sos1 sos2 sum system table then until using while xor yes',
'literal': 'eps inf na',
'built-in':
'abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy ' +
'cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact ' +
'floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max ' +
'min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power ' +
'randBinomial randLinear randTriangle round rPower sigmoid sign ' +
'signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt ' +
'tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp ' +
'bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt ' +
'rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear ' +
'jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion ' +
'handleCollect handleDelete handleStatus handleSubmit heapFree ' +
'heapLimit heapSize jobHandle jobKill jobStatus jobTerminate ' +
'licenseLevel licenseStatus maxExecError sleep timeClose timeComp ' +
'timeElapsed timeExec timeStart'
};
var PARAMS = {
className: 'params',
begin: /\(/, end: /\)/,
excludeBegin: true,
excludeEnd: true,
};
var SYMBOLS = {
className: 'symbol',
variants: [
{begin: /\=[lgenxc]=/},
{begin: /\$/},
]
};
var QSTR = { // One-line quoted comment string
className: 'comment',
variants: [
{begin: '\'', end: '\''},
{begin: '"', end: '"'},
],
illegal: '\\n',
contains: [hljs.BACKSLASH_ESCAPE]
};
var ASSIGNMENT = {
begin: '/',
end: '/',
keywords: KEYWORDS,
contains: [
QSTR,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
hljs.C_NUMBER_MODE,
],
};
var DESCTEXT = { // Parameter/set/variable description text
begin: /[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,
excludeBegin: true,
end: '$',
endsWithParent: true,
contains: [
QSTR,
ASSIGNMENT,
{
className: 'comment',
begin: /([ ]*[a-z0-9&#*=?@>\\<:\-,()$\[\]_.{}!+%^]+)+/,
},
],
};

@@ -13,24 +81,73 @@ return {

contains: [
hljs.COMMENT(/^\$ontext/, /^\$offtext/),
{
beginKeywords: 'sets parameters variables equations',
end: ';',
className: 'meta',
begin: '^\\$[a-z0-9]+',
end: '$',
returnBegin: true,
contains: [
{
begin: '/',
end: '/',
contains: [hljs.NUMBER_MODE]
className: 'meta-keyword',
begin: '^\\$[a-z0-9]+',
}
]
},
hljs.COMMENT('^\\*', '$'),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
// Declarations
{
className: 'string',
begin: '\\*{3}', end: '\\*{3}'
beginKeywords:
'set sets parameter parameters variable variables ' +
'scalar scalars equation equations',
end: ';',
contains: [
hljs.COMMENT('^\\*', '$'),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
ASSIGNMENT,
DESCTEXT,
]
},
hljs.NUMBER_MODE,
{ // table environment
beginKeywords: 'table',
end: ';',
returnBegin: true,
contains: [
{ // table header row
beginKeywords: 'table',
end: '$',
contains: [DESCTEXT],
},
hljs.COMMENT('^\\*', '$'),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
hljs.C_NUMBER_MODE,
// Table does not contain DESCTEXT or ASSIGNMENT
]
},
// Function definitions
{
className: 'number',
begin: '\\$[a-zA-Z0-9]+'
}
className: 'function',
begin: /^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,
returnBegin: true,
contains: [
{ // Function title
className: 'title',
begin: /^[a-z][a-z0-9_]+/,
},
PARAMS,
SYMBOLS,
],
},
hljs.C_NUMBER_MODE,
SYMBOLS,
]
};
};
module.exports = function(hljs) {
var KEYWORDS = {
keyword: 'and bool break|0 call callexe checkinterrupt clear clearg closeall cls comlog compile ' +
'continue create debug declare delete disable dlibrary|10 dllcall do|0 dos ed edit else|0 ' +
'elseif enable end endfor|10 endif|10 endp|10 endo|10 errorlog|10 errorlogat expr external fn ' +
'for|0 format goto gosub|0 graph if|0 keyword let lib library line load loadarray loadexe ' +
'loadf|10 loadk|10 loadm|10 loadp loads loadx local locate loopnextindex lprint lpwidth lshow ' +
keyword: 'and bool break call callexe checkinterrupt clear clearg closeall cls comlog compile ' +
'continue create debug declare delete disable dlibrary dllcall do dos ed edit else ' +
'elseif enable end endfor endif endp endo errorlog errorlogat expr external fn ' +
'for format goto gosub graph if keyword let lib library line load loadarray loadexe ' +
'loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow ' +
'matrix msym ndpclex new not open or output outwidth plot plotsym pop prcsn print ' +
'printdos proc|10 push retp|10 return|0 rndcon rndmod rndmult rndseed run save saveall screen ' +
'scroll setarray show sparse stop string struct system trace trap|10 threadfor|10 ' +
'threadendfor|10 threadbegin|10 threadjoin|10 threadstat|10 threadend|10 until use while winprint',
'printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen ' +
'scroll setarray show sparse stop string struct system trace trap threadfor ' +
'threadendfor threadbegin threadjoin threadstat threadend until use while winprint',
built_in: 'abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol ' +

@@ -27,12 +27,12 @@ 'AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks ' +

'datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd ' +
'dayinyr dayofweek dbAddDatabase|10 dbClose|10 dbCommit|10 dbCreateQuery|10 dbExecQuery|10 dbGetConnectOptions|10 dbGetDatabaseName|10 ' +
'dbGetDriverName|10 dbGetDrivers|10 dbGetHostName|10 dbGetLastErrorNum|10 dbGetLastErrorText|10 dbGetNumericalPrecPolicy|10 ' +
'dbGetPassword|10 dbGetPort|10 dbGetTableHeaders|10 dbGetTables|10 dbGetUserName|10 dbHasFeature|10 dbIsDriverAvailable|10 dbIsOpen|10 ' +
'dbIsOpenError|10 dbOpen|10 dbQueryBindValue|10 dbQueryClear|10 dbQueryCols|10 dbQueryExecPrepared|10 dbQueryFetchAllM|10 dbQueryFetchAllSA|10 ' +
'dbQueryFetchOneM|10 dbQueryFetchOneSA|10 dbQueryFinish|10 dbQueryGetBoundValue|10 dbQueryGetBoundValues|10 dbQueryGetField|10 ' +
'dbQueryGetLastErrorNum|10 dbQueryGetLastErrorText|10 dbQueryGetLastInsertID|10 dbQueryGetLastQuery|10 dbQueryGetPosition|10 ' +
'dbQueryIsActive|10 dbQueryIsForwardOnly|10 dbQueryIsNull|10 dbQueryIsSelect|10 dbQueryIsValid|10 dbQueryPrepare|10 dbQueryRows|10 ' +
'dbQuerySeek|10 dbQuerySeekFirst|10 dbQuerySeekLast|10 dbQuerySeekNext|10 dbQuerySeekPrevious|10 dbQuerySetForwardOnly|10 ' +
'dbRemoveDatabase|10 dbRollback|10 dbSetConnectOptions|10 dbSetDatabaseName|10 dbSetHostName|10 dbSetNumericalPrecPolicy|10 ' +
'dbSetPort|10 dbSetUserName|10 dbTransaction|10 DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl ' +
'dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName ' +
'dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy ' +
'dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen ' +
'dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA ' +
'dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField ' +
'dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition ' +
'dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows ' +
'dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly ' +
'dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy ' +
'dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl ' +
'dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt ' +

@@ -39,0 +39,0 @@ 'dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday ' +

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

{
className: 'keyword',
begin: '\\*'
className: 'symbol',
begin: '\\*',
relevance: 0
},

@@ -11,0 +12,0 @@ {

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

{beginKeywords: 'extends implements'},
hljs.UNDERSCORE_TITLE_MODE,
hljs.UNDERSCORE_TITLE_MODE
]

@@ -90,3 +90,3 @@ },

relevance: 0
},
}
],

@@ -93,0 +93,0 @@ illegal: /#|<\//

module.exports = function(hljs) {
return {
case_insensitive: true,
lexemes: /[\w\._]+/,
keywords: 'goto gosub return break repeat loop continue wait await dim sdim foreach dimtype dup dupptr end stop newmod delmod mref run exgoto on mcall assert logmes newlab resume yield onexit onerror onkey onclick oncmd exist delete mkdir chdir dirlist bload bsave bcopy memfile if else poke wpoke lpoke getstr chdpm memexpand memcpy memset notesel noteadd notedel noteload notesave randomize noteunsel noteget split strrep setease button chgdisp exec dialog mmload mmplay mmstop mci pset pget syscolor mes print title pos circle cls font sysfont objsize picload color palcolor palette redraw width gsel gcopy gzoom gmode bmpsave hsvcolor getkey listbox chkbox combox input mesbox buffer screen bgscr mouse objsel groll line clrobj boxf objprm objmode stick grect grotate gsquare gradf objimage objskip objenable celload celdiv celput newcom querycom delcom cnvstow comres axobj winobj sendmsg comevent comevarg sarrayconv callfunc cnvwtos comevdisp libptr system hspstat hspver stat cnt err strsize looplev sublev iparam wparam lparam refstr refdval int rnd strlen length length2 length3 length4 vartype gettime peek wpeek lpeek varptr varuse noteinfo instr abs limit getease str strmid strf getpath strtrim sin cos tan atan sqrt double absf expf logf limitf powf geteasef mousex mousey mousew hwnd hinstance hdc ginfo objinfo dirinfo sysinfo thismod __hspver__ __hsp30__ __date__ __time__ __line__ __file__ _debug __hspdef__ and or xor not screen_normal screen_palette screen_hide screen_fixedsize screen_tool screen_frame gmode_gdi gmode_mem gmode_rgb0 gmode_alpha gmode_rgb0alpha gmode_add gmode_sub gmode_pixela ginfo_mx ginfo_my ginfo_act ginfo_sel ginfo_wx1 ginfo_wy1 ginfo_wx2 ginfo_wy2 ginfo_vx ginfo_vy ginfo_sizex ginfo_sizey ginfo_winx ginfo_winy ginfo_mesx ginfo_mesy ginfo_r ginfo_g ginfo_b ginfo_paluse ginfo_dispx ginfo_dispy ginfo_cx ginfo_cy ginfo_intid ginfo_newid ginfo_sx ginfo_sy objinfo_mode objinfo_bmscr objinfo_hwnd notemax notesize dir_cur dir_exe dir_win dir_sys dir_cmdline dir_desktop dir_mydoc dir_tv font_normal font_bold font_italic font_underline font_strikeout font_antialias objmode_normal objmode_guifont objmode_usefont gsquare_grad msgothic msmincho do until while wend for next _break _continue switch case default swbreak swend ddim ldim alloc m_pi rad2deg deg2rad ease_linear ease_quad_in ease_quad_out ease_quad_inout ease_cubic_in ease_cubic_out ease_cubic_inout ease_quartic_in ease_quartic_out ease_quartic_inout ease_bounce_in ease_bounce_out ease_bounce_inout ease_shake_in ease_shake_out ease_shake_inout ease_loop',

@@ -18,3 +19,3 @@ contains: [

hljs.COMMENT(';', '$'),
hljs.COMMENT(';', '$', {relevance: 0}),

@@ -21,0 +22,0 @@ {

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

return {
aliases: ['hbs', 'html.hbs', 'html.handlebars'],
case_insensitive: true,

@@ -47,0 +46,0 @@ subLanguage: 'xml',

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

'enum else break transient catch instanceof byte super volatile case assert short ' +
'package default double public try this switch continue throws protected public private';
'package default double public try this switch continue throws protected public private ' +
'module requires exports';

@@ -10,0 +11,0 @@ // https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html

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

contains: [
{begin: /<\w+\/>/, skip: true},
{begin: /<\w+\s*\/>/, skip: true},
{begin: /<\w+/, end: /(\/\w+|\w+\/)>/, skip: true, contains: ['self']}

@@ -72,0 +72,0 @@ ]

module.exports = function (hljs) {
var KEYWORDS = 'val var get set class trait object open private protected public ' +
'final enum if else do while for when break continue throw try catch finally ' +
'import package is as in return fun override default companion reified inline volatile transient native ' +
'Byte Short Char Int Long Boolean Float Double Void Unit Nothing';
var KEYWORDS = {
keyword:
'abstract as val var vararg get set class object open private protected public noinline ' +
'crossinline dynamic final enum if else do while for when throw try catch finally ' +
'import package is in fun override companion reified inline ' +
'interface annotation data sealed internal infix operator out by constructor super ' +
// to be deleted soon
'trait volatile transient native default',
built_in:
'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',
literal:
'true false null'
};
var KEYWORDS_WITH_LABEL = {
className: 'keyword',
begin: /\b(break|continue|return|this)\b/,
starts: {
contains: [
{
className: 'symbol',
begin: /@\w+/
}
]
}
};
var LABEL = {
className: 'symbol', begin: hljs.UNDERSCORE_IDENT_RE + '@'
};
// for string templates
var SUBST = {
className: 'subst',
variants: [
{begin: '\\$' + hljs.UNDERSCORE_IDENT_RE},
{begin: '\\${', end: '}', contains: [hljs.APOS_STRING_MODE, hljs.C_NUMBER_MODE]}
]
};
var STRING = {
className: 'string',
variants: [
{
begin: '"""', end: '"""',
contains: [SUBST]
},
// Can't use built-in modes easily, as we want to use STRING in the meta
// context as 'meta-string' and there's no syntax to remove explicitly set
// classNames in built-in modes.
{
begin: '\'', end: '\'',
illegal: /\n/,
contains: [hljs.BACKSLASH_ESCAPE]
},
{
begin: '"', end: '"',
illegal: /\n/,
contains: [hljs.BACKSLASH_ESCAPE, SUBST]
}
]
};
var ANNOTATION_USE_SITE = {
className: 'meta', begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'
};
var ANNOTATION = {
className: 'meta', begin: '@' + hljs.UNDERSCORE_IDENT_RE,
contains: [
{
begin: /\(/, end: /\)/,
contains: [
hljs.inherit(STRING, {className: 'meta-string'})
]
}
]
};
return {
keywords: {
keyword: KEYWORDS,
literal: 'true false null'
},
keywords: KEYWORDS,
contains : [

@@ -26,10 +93,7 @@ hljs.COMMENT(

hljs.C_BLOCK_COMMENT_MODE,
KEYWORDS_WITH_LABEL,
LABEL,
ANNOTATION_USE_SITE,
ANNOTATION,
{
className: 'type',
begin: /</, end: />/,
returnBegin: true,
excludeEnd: false,
relevance: 0
},
{
className: 'function',

@@ -56,14 +120,23 @@ beginKeywords: 'fun', end: '[(]|$',

begin: /\(/, end: /\)/,
endsParent: true,
keywords: KEYWORDS,
relevance: 0,
illegal: /\([^\(,\s:]+,/,
contains: [
{
className: 'type',
begin: /:\s*/, end: /\s*[=\)]/, excludeBegin: true, returnEnd: true,
begin: /:/, end: /[=,\/]/, endsWithParent: true,
contains: [
{className: 'type', begin: hljs.UNDERSCORE_IDENT_RE},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
],
relevance: 0
}
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
ANNOTATION_USE_SITE,
ANNOTATION,
STRING,
hljs.C_NUMBER_MODE
]
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE

@@ -74,6 +147,7 @@ ]

className: 'class',
beginKeywords: 'class trait', end: /[:\{(]|$/,
beginKeywords: 'class interface trait', end: /[:\{(]|$/, // remove 'trait' when removed from KEYWORDS
excludeEnd: true,
illegal: 'extends implements',
contains: [
{beginKeywords: 'public protected internal private constructor'},
hljs.UNDERSCORE_TITLE_MODE,

@@ -88,10 +162,9 @@ {

begin: /[,:]\s*/, end: /[<\(,]|$/, excludeBegin: true, returnEnd: true
}
},
ANNOTATION_USE_SITE,
ANNOTATION
]
},
STRING,
{
className: 'variable', beginKeywords: 'var val', end: /\s*[=:$]/, excludeEnd: true
},
hljs.QUOTE_STRING_MODE,
{
className: 'meta',

@@ -98,0 +171,0 @@ begin: "^#!/usr/bin/env", end: '$',

@@ -60,7 +60,15 @@ module.exports = function(hljs) {

var RULE_MODE = {
className: 'attribute',
begin: INTERP_IDENT_RE, end: ':', excludeEnd: true,
contains: [hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE],
illegal: /\S/,
starts: {end: '[;}]', returnEnd: true, contains: VALUE, illegal: '[<=$]'}
begin: INTERP_IDENT_RE + '\\s*:', returnBegin: true, end: '[;}]',
relevance: 0,
contains: [
{
className: 'attribute',
begin: INTERP_IDENT_RE, end: ':', excludeEnd: true,
starts: {
endsWithParent: true, illegal: '[<=$]',
relevance: 0,
contains: VALUE
}
}
]
};

@@ -93,3 +101,3 @@

variants: [{
begin: '[\\.#:&\\[]', end: '[;{}]' // mixin calls end with ';'
begin: '[\\.#:&\\[>]', end: '[;{}]' // mixin calls end with ';'
}, {

@@ -113,2 +121,3 @@ begin: INTERP_IDENT_RE + '[^;]*{',

{className: 'selector-attr', begin: '\\[', end: '\\]'},
{className: 'selector-pseudo', begin: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},
{begin: '\\(', end: '\\)', contains: VALUE_WITH_RULESETS}, // argument list of parametric mixins

@@ -124,4 +133,4 @@ {begin: '!important'} // eat !important after mixin call or it will be colored as tag

VAR_RULE_MODE,
SELECTOR_MODE,
RULE_MODE
RULE_MODE,
SELECTOR_MODE
);

@@ -128,0 +137,0 @@

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

TITLE1
]
],
relevance: 0
},

@@ -154,4 +155,4 @@ {

].concat(COMMENT_MODES),
illegal: ';$|^\\[|^='
illegal: ';$|^\\[|^=|&|{'
};
};

@@ -48,5 +48,11 @@ module.exports = function(hljs) {

variants: [
{ begin: '`.+?`' },
{ begin: '^( {4}|\t)', end: '$'
, relevance: 0
{
begin: '^```\w*\s*$', end: '^```\s*$'
},
{
begin: '`.+?`'
},
{
begin: '^( {4}|\t)', end: '$',
relevance: 0
}

@@ -53,0 +59,0 @@ ]

@@ -5,4 +5,17 @@ module.exports = function(hljs) {

keywords: {
keyword: 'addr and as asm bind block break|0 case|0 cast const|0 continue|0 converter discard distinct|10 div do elif else|0 end|0 enum|0 except export finally for from generic if|0 import|0 in include|0 interface is isnot|10 iterator|10 let|0 macro method|10 mixin mod nil not notin|10 object|0 of or out proc|10 ptr raise ref|10 return shl shr static template try|0 tuple type|0 using|0 var|0 when while|0 with without xor yield',
literal: 'shared guarded stdin stdout stderr result|10 true false'
keyword:
'addr and as asm bind block break case cast const continue converter ' +
'discard distinct div do elif else end enum except export finally ' +
'for from generic if import in include interface is isnot iterator ' +
'let macro method mixin mod nil not notin object of or out proc ptr ' +
'raise ref return shl shr static template try tuple type using var ' +
'when while with without xor yield',
literal:
'shared guarded stdin stdout stderr result true false',
built_in:
'int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float ' +
'float32 float64 bool char string cstring pointer expr stmt void ' +
'auto any range array openarray varargs seq set clong culong cchar ' +
'cschar cshort cint csize clonglong cfloat cdouble clongdouble ' +
'cuchar cushort cuint culonglong cstringarray semistatic'
},

@@ -30,5 +43,2 @@ contains: [ {

}, {
className: 'built_in',
begin: /\b(int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float|float32|float64|bool|char|string|cstring|pointer|expr|stmt|void|auto|any|range|array|openarray|varargs|seq|set|clong|culong|cchar|cschar|cshort|cint|csize|clonglong|cfloat|cdouble|clongdouble|cuchar|cushort|cuint|culonglong|cstringarray|semistatic)\b/
}, {
className: 'number',

@@ -35,0 +45,0 @@ relevance: 0,

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

case_insensitive: true,
lexemes: /\.?\w+/,
keywords: OXYGENE_KEYWORDS,

@@ -51,0 +52,0 @@ illegal: '("|\\$[G-Zg-z]|\\/\\*|</|=>|->)',

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

return {
aliases: ['pl'],
aliases: ['pl', 'pm'],
lexemes: /[\w\.]+/,
keywords: PERL_KEYWORDS,

@@ -154,0 +155,0 @@ contains: PERL_DEFAULT_CONTAINS

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

className: 'variable',
begin: /</, end: />/
begin: /<(?!\/)/, end: />/
};

@@ -11,0 +11,0 @@ var QUOTE_STRING = {

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

'instanceof with throw case default try this switch continue typeof delete ' +
'let yield const export super debugger as async await',
'let yield const export super debugger as async await import',
literal:

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

var QML_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9\\._]*';
var END_OF_LINE_MODE = {
className: 'string',
begin: '(\\b|"|\')',
end: '(//|/\\*|$)',
illegal: '\\n',
contains: [hljs.BACKSLASH_ESCAPE]
};
// Isolate import statements. Ends at a comment or end of line.
// Use keyword class.
var IMPORT = {
beginKeywords: 'import', end: '$',
starts: {
className: 'string',
end: '(//|/\\*|$)',
returnEnd: true
},
contains: [
END_OF_LINE_MODE
]
};
// Isolate property statements. Ends at a :, =, ;, ,, a comment or end of line.

@@ -53,11 +31,10 @@ // Use property class.

className: 'keyword',
begin: '\\bproperty\\b',
begin: '\\bproperty\\b',
starts: {
className: 'string',
end: '(:|=|;|,|//|/\\*|$)',
end: '(:|=|;|,|//|/\\*|$)',
returnEnd: true
},
relevance: 0
}
};
// Isolate signal statements. Ends at a ) a comment or end of line.

@@ -67,11 +44,10 @@ // Use property class.

className: 'keyword',
begin: '\\bsignal\\b',
begin: '\\bsignal\\b',
starts: {
className: 'string',
end: '(\\(|:|=|;|,|//|/\\*|$)',
end: '(\\(|:|=|;|,|//|/\\*|$)',
returnEnd: true
},
relevance: 10
}
};
// id: is special in QML. When we see id: we want to mark the id: as attribute and

@@ -83,10 +59,9 @@ // emphasize the token following.

starts: {
className: 'emphasis',
end: QML_IDENT_RE,
className: 'string',
end: QML_IDENT_RE,
returnEnd: false
},
relevance: 10
}
};
// Find QML object attribute. An attribute is a QML identifier followed by :.
// Find QML object attribute. An attribute is a QML identifier followed by :.
// Unfortunately it's hard to know where it ends, as it may contain scalars,

@@ -101,6 +76,6 @@ // objects, object definitions, or javascript. The true end is either when the parent

className: 'attribute',
begin: QML_IDENT_RE,
includeBegin: true,
end: '\\s*:',
excludeEnd: true
begin: QML_IDENT_RE,
end: '\\s*:',
excludeEnd: true,
relevance: 0
}

@@ -114,15 +89,8 @@ ],

var QML_OBJECT = {
begin: QML_IDENT_RE + '\\s*{',
begin: QML_IDENT_RE + '\\s*{', end: '{',
returnBegin: true,
relevance: 0,
contains: [
{
className: 'decorator',
keywords: KEYWORDS,
begin: QML_IDENT_RE,
includeBegin: true,
end: '\\s*{',
excludeEnd: true
}
],
relevance: 0
hljs.inherit(hljs.TITLE_MODE, {begin: QML_IDENT_RE})
]
};

@@ -136,3 +104,3 @@

{
className: 'pi',
className: 'meta',
begin: /^\s*['"]use (strict|asm)['"]/

@@ -179,3 +147,2 @@ },

},
IMPORT,
SIGNAL,

@@ -182,0 +149,0 @@ PROPERTY,

module.exports = function(hljs) {
var RUBY_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
var RUBY_KEYWORDS =
'and false then defined module in return redo if BEGIN retry end for true self when ' +
'next until do begin unless END rescue nil else break undef not super class case ' +
'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor';
var 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',
literal:
'true false nil'
};
var YARDOCTAG = {

@@ -91,2 +95,6 @@ className: 'doctag',

{
// swallow namespace qualifiers before symbols
begin: hljs.IDENT_RE + '::'
},
{
className: 'symbol',

@@ -98,3 +106,3 @@ begin: hljs.UNDERSCORE_IDENT_RE + '(\\!|\\?)?:',

className: 'symbol',
begin: ':',
begin: ':(?!\\s)',
contains: [STRING, {begin: RUBY_METHOD_RE}],

@@ -111,2 +119,7 @@ relevance: 0

},
{
className: 'params',
begin: /\|/, end: /\|/,
keywords: RUBY_KEYWORDS
},
{ // regexp container

@@ -113,0 +126,0 @@ begin: '(' + hljs.RE_STARTERS_RE + ')\\s*',

@@ -5,2 +5,11 @@ module.exports = function(hljs) {

BLOCK_COMMENT.contains.push('self');
var KEYWORDS =
'alignof as be box break const continue crate do else enum extern ' +
'false fn for if impl in let loop match mod mut offsetof once priv ' +
'proc pub pure ref return self Self sizeof static struct super trait true ' +
'type typeof unsafe unsized use virtual while where yield move ' +
'int i8 i16 i32 i64 ' +
'uint u8 u32 u64 ' +
'float f32 f64 ' +
'str char bool'
var BUILTINS =

@@ -22,10 +31,3 @@ // prelude

keyword:
'alignof as be box break const continue crate do else enum extern ' +
'false fn for if impl in let loop match mod mut offsetof once priv ' +
'proc pub pure ref return self Self sizeof static struct super trait true ' +
'type typeof unsafe unsized use virtual while where yield ' +
'int i8 i16 i32 i64 ' +
'uint u8 u32 u64 ' +
'float f32 f64 ' +
'str char bool',
KEYWORDS,
literal:

@@ -101,2 +103,7 @@ 'true false Some None Ok Err',

{
className: 'params',
begin: /\|/, end: /\|/,
keywords: KEYWORDS
},
{
begin: '->'

@@ -103,0 +110,0 @@ }

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

case_insensitive: true,
illegal: /[<>{}*]/,
illegal: /[<>{}*#]/,
contains: [

@@ -16,2 +16,3 @@ {

end: /;/, endsWithParent: true,
lexemes: /[\w\.]+/,
keywords: {

@@ -18,0 +19,0 @@ keyword:

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

built_in:
'DBus GLib CCode Gee Object Gtk',
'DBus GLib CCode Gee Object Gtk Posix',
literal:

@@ -22,0 +22,0 @@ 'false true null'

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

},
illegal: /[{:]/,
illegal: /;/,
contains: [

@@ -65,0 +65,0 @@ hljs.NUMBER_MODE,

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

{
begin: '=',
begin: /=\s*/,
relevance: 0,

@@ -20,6 +20,7 @@ contains: [

className: 'string',
endsParent: true,
variants: [
{begin: /"/, end: /"/},
{begin: /'/, end: /'/},
{begin: /[^\s\/>]+/}
{begin: /[^\s"'=<>`]+/}
]

@@ -26,0 +27,0 @@ }

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

var VAR = {
begin: /\$[a-zA-Z0-9\-]+/,
relevance: 5
begin: /\$[a-zA-Z0-9\-]+/
};

@@ -15,0 +14,0 @@

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

"homepage": "https://highlightjs.org/",
"version": "9.2.0",
"version": "9.3.0",
"author": {

@@ -819,2 +819,18 @@ "name": "Ivan Sagalaev",

"email": "oxdef@oxdef.info"
},
{
"name": "Philipp Wolfer",
"email": "ph.wolfer@gmail.com"
},
{
"name": "Mikko Kouhia",
"email": "mikko.kouhia@iki.fi"
},
{
"name": "Billy Quith",
"email": "chinbillybilbo@gmail.com"
},
{
"name": "Herbert Shin",
"email": "initbar@protonmail.ch"
}

@@ -844,4 +860,4 @@ ],

"gear-lib": "^0.9.2",
"glob": "^6.0.1",
"jsdom": "7.0.2",
"glob": "^7.0.3",
"jsdom": "^8.1.0",
"lodash": "^4.0.0",

@@ -848,0 +864,0 @@ "mocha": "^2.0.1",

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