From 976afa1d0ce0cfcd62dea81ce676ef838f3e1025 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 15 Feb 2020 16:43:15 -0500 Subject: [PATCH 001/816] split code into modules and simplify (#2402) * remove dead code * pull out deep freeze * move out escapeRe * move out reStr to source * move out countMatchGroups * move reTest to regex.startsWith * move escape to escapeHTML * move inherit to utils * move MODES out * simplify defining API * simplify, use `find` * remove useless constant * use rollup to build the UMB browser build also * fix markdown to be strict safe * no more need for worker stub * move nodestream to utils * Cleaner code with ES2015 tricks * reduce use of lodash * we do not need arrays here * simplify * remove dead config --- src/highlight.js | 506 ++++----------------------------- src/languages/markdown.js | 22 +- src/lib/modes.js | 114 ++++++++ src/lib/regex.js | 65 +++++ src/lib/utils.js | 137 +++++++++ src/vendor/deep_freeze.js | 20 ++ test/api/cNumber.js | 6 +- test/api/number.js | 6 +- test/browser/worker.js | 2 +- test/index.js | 1 - test/markup/index.js | 3 +- test/special/buildClassName.js | 4 +- test/special/customMarkup.js | 3 +- test/special/index.js | 3 +- test/special/languageAlias.js | 3 +- test/special/noHighlight.js | 4 +- test/tools.js | 39 --- test/utility.js | 7 +- tools/build_browser.js | 16 +- tools/build_config.js | 11 +- tools/codeformat.js | 1 - tools/utility.js | 74 ----- 22 files changed, 441 insertions(+), 606 deletions(-) create mode 100644 src/lib/modes.js create mode 100644 src/lib/regex.js create mode 100644 src/lib/utils.js create mode 100644 src/vendor/deep_freeze.js delete mode 100644 test/tools.js delete mode 100644 tools/utility.js diff --git a/src/highlight.js b/src/highlight.js index bd15c8393b..928b036b78 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -3,34 +3,19 @@ Syntax highlighting with language autodetection. https://highlightjs.org/ */ -(function(factory) { - - // Find the global object for export to both the browser and web workers. - var globalObject = typeof window === 'object' && window || - typeof self === 'object' && self; - - // Setup highlight.js for different environments. First is Node.js or - // CommonJS. - // `nodeType` is checked to ensure that `exports` is not a HTML element. - if(typeof exports !== 'undefined' && !exports.nodeType) { - factory(exports); - } else if(globalObject) { - // Export hljs globally even when using AMD for cases when this script - // is loaded with others that may still expect a global hljs. - globalObject.hljs = factory({}); - - // Finally register the global hljs with AMD. - if(typeof define === 'function' && define.amd) { - define([], function() { - return globalObject.hljs; - }); - } - } +import deepFreeze from './vendor/deep_freeze'; +import * as regex from './lib/regex'; +import * as utils from './lib/utils'; +import * as MODES from './lib/modes'; + +const escape = utils.escapeHTML; +const inherit = utils.inherit; -}(function(hljs) { +const { nodeStream, mergeStreams } = utils; + +const HLJS = function(hljs) { // Convenience variables for build-in objects - var ArrayProto = [], - objectKeys = Object.keys; + var ArrayProto = []; // Global internal variables used within the highlight.js library. var languages = {}, @@ -44,10 +29,6 @@ https://highlightjs.org/ // Regular expressions used throughout the highlight.js library. var fixMarkupRe = /((^(<[^>]+>|\t|)+|(?:\n)))/gm; - // The object will be assigned by the build tool. It used to synchronize API - // of external language files with minified version of the highlight.js library. - var API_REPLACES; - var spanEndTag = ''; var LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?"; @@ -65,28 +46,14 @@ https://highlightjs.org/ // keywords that should have no default relevance value var COMMON_KEYWORDS = 'of and for in not or if then'.split(' '); - /* Utility functions */ - function escape(value) { - return value.replace(/&/g, '&').replace(//g, '>'); - } - - function tag(node) { - return node.nodeName.toLowerCase(); - } - - function testRe(re, lexeme) { - var match = re && re.exec(lexeme); - return match && match.index === 0; - } - function isNotHighlighted(language) { return options.noHighlightRe.test(language); } function blockLanguage(block) { - var i, match, length, _class; + var match; var classes = block.className + ' '; classes += block.parentNode ? block.parentNode.className : ''; @@ -102,143 +69,11 @@ https://highlightjs.org/ return language ? match[1] : 'no-highlight'; } - classes = classes.split(/\s+/); - - for (i = 0, length = classes.length; i < length; i++) { - _class = classes[i]; - - if (isNotHighlighted(_class) || getLanguage(_class)) { - return _class; - } - } + return classes + .split(/\s+/) + .find((_class) => isNotHighlighted(_class) || getLanguage(_class)) } - /** - * performs a shallow merge of multiple objects into one - * - * @arguments list of objects with properties to merge - * @returns a single new object - */ - 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]; - objects.forEach(function(obj) { - for (key in obj) - result[key] = obj[key]; - }); - return result; - } - - /* Stream merging */ - - function nodeStream(node) { - var result = []; - (function _nodeStream(node, offset) { - for (var child = node.firstChild; child; child = child.nextSibling) { - if (child.nodeType === 3) - offset += child.nodeValue.length; - else if (child.nodeType === 1) { - result.push({ - event: 'start', - offset: offset, - node: child - }); - offset = _nodeStream(child, offset); - // Prevent void elements from having an end tag that would actually - // double them in the output. There are more void elements in HTML - // but we list only those realistically expected in code display. - if (!tag(child).match(/br|hr|img|input/)) { - result.push({ - event: 'stop', - offset: offset, - node: child - }); - } - } - } - return offset; - })(node, 0); - return result; - } - - function mergeStreams(original, highlighted, value) { - var processed = 0; - var result = ''; - var nodeStack = []; - - function selectStream() { - if (!original.length || !highlighted.length) { - return original.length ? original : highlighted; - } - if (original[0].offset !== highlighted[0].offset) { - return (original[0].offset < highlighted[0].offset) ? original : highlighted; - } - - /* - To avoid starting the stream just before it should stop the order is - ensured that original always starts first and closes last: - - if (event1 == 'start' && event2 == 'start') - return original; - if (event1 == 'start' && event2 == 'stop') - return highlighted; - if (event1 == 'stop' && event2 == 'start') - return original; - if (event1 == 'stop' && event2 == 'stop') - return highlighted; - - ... which is collapsed to: - */ - return highlighted[0].event === 'start' ? original : highlighted; - } - - function open(node) { - function attr_str(a) { - return ' ' + a.nodeName + '="' + escape(a.value).replace(/"/g, '"') + '"'; - } - result += '<' + tag(node) + ArrayProto.map.call(node.attributes, attr_str).join('') + '>'; - } - - function close(node) { - result += ''; - } - - function render(event) { - (event.event === 'start' ? open : close)(event.node); - } - - while (original.length || highlighted.length) { - var stream = selectStream(); - result += escape(value.substring(processed, stream[0].offset)); - processed = stream[0].offset; - if (stream === original) { - /* - On any opening or closing tag of the original markup we first close - the entire highlighted node stack, then render the original tag along - with all the following original tags at the same offset and then - reopen all the tags on the highlighted stack. - */ - nodeStack.reverse().forEach(close); - do { - render(stream.splice(0, 1)[0]); - stream = selectStream(); - } while (stream === original && stream.length && stream[0].offset === processed); - nodeStack.reverse().forEach(open); - } else { - if (stream[0].event === 'start') { - nodeStack.push(stream[0].node); - } else { - nodeStack.pop(); - } - render(stream.splice(0, 1)[0]); - } - } - return result + escape(value.substr(processed)); - } /* Initialization */ @@ -266,13 +101,13 @@ https://highlightjs.org/ // instance of ourselves, so we can be reused with many // different parents without issue if (dependencyOnParent(mode)) - return [inherit(mode, { starts: mode.starts ? inherit(mode.starts) : null })]; + return inherit(mode, { starts: mode.starts ? inherit(mode.starts) : null }); if (Object.isFrozen(mode)) - return [inherit(mode)]; + return inherit(mode); // no special dependency issues, just return ourselves - return [mode]; + return mode; } function compileKeywords(rawKeywords, case_insensitive) { @@ -281,7 +116,7 @@ https://highlightjs.org/ if (typeof rawKeywords === 'string') { // string splitAndCompile('keyword', rawKeywords); } else { - objectKeys(rawKeywords).forEach(function (className) { + Object.keys(rawKeywords).forEach(function (className) { splitAndCompile(className, rawKeywords[className]); }); } @@ -315,68 +150,13 @@ https://highlightjs.org/ function compileLanguage(language) { - function reStr(re) { - return (re && re.source) || re; - } - function langRe(value, global) { return new RegExp( - reStr(value), + regex.source(value), 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '') ); } - function reCountMatchGroups(re) { - return (new RegExp(re.toString() + '|')).exec('').length - 1; - } - - // joinRe logically computes regexps.join(separator), but fixes the - // backreferences so they continue to match. - // it also places each individual regular expression into it's own - // match group, keeping track of the sequencing of those match groups - // is currently an exercise for the caller. :-) - function joinRe(regexps, separator) { - // backreferenceRe matches an open parenthesis or backreference. To avoid - // an incorrect parse, it additionally matches the following: - // - [...] elements, where the meaning of parentheses and escapes change - // - other escape sequences, so we do not misparse escape sequences as - // interesting elements - // - non-matching or lookahead parentheses, which do not capture. These - // follow the '(' with a '?'. - var backreferenceRe = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./; - var numCaptures = 0; - var ret = ''; - for (var i = 0; i < regexps.length; i++) { - numCaptures += 1; - var offset = numCaptures; - var re = reStr(regexps[i]); - if (i > 0) { - ret += separator; - } - ret += "("; - while (re.length > 0) { - var match = backreferenceRe.exec(re); - if (match == null) { - ret += re; - break; - } - ret += re.substring(0, match.index); - re = re.substring(match.index + match[0].length); - if (match[0][0] == '\\' && match[1]) { - // Adjust the backreference. - ret += '\\' + String(Number(match[1]) + offset); - } else { - ret += match[0]; - if (match[0] == '(') { - numCaptures++; - } - } - } - ret += ")"; - } - return ret; - } - function buildModeRegex(mode) { var matchIndexes = {}; @@ -385,30 +165,21 @@ https://highlightjs.org/ var matcher = {}; var matchAt = 1; - function addRule(rule, regex) { + function addRule(rule, re) { matchIndexes[matchAt] = rule; - regexes.push([rule, regex]); - matchAt += reCountMatchGroups(regex) + 1; + regexes.push([rule, re]); + matchAt += regex.countMatchGroups(re) + 1; } - var term; - for (var i=0; i < mode.contains.length; i++) { - var re; - term = mode.contains[i]; - if (term.beginKeywords) { - re = '\\.?(?:' + term.begin + ')\\.?'; - } else { - re = term.begin; - } - addRule(term, re); - } + mode.contains.forEach(term => addRule(term, term.begin)) + if (mode.terminator_end) addRule("end", mode.terminator_end); if (mode.illegal) addRule("illegal", mode.illegal); - var terminators = regexes.map(function(el) { return el[1]; }); - matcherRe = langRe(joinRe(terminators, '|'), true); + var terminators = regexes.map(el => el[1]); + matcherRe = langRe(regex.join(terminators, '|'), true); matcher.lastIndex = 0; matcher.exec = function(s) { @@ -421,8 +192,8 @@ https://highlightjs.org/ if (!match) { return null; } for(var i = 0; i', subLanguage: 'xml', relevance: 0 }; - HORIZONTAL_RULE = { + const HORIZONTAL_RULE = { begin: '^[-\\*]{3,}', end: '$' }; - CODE = { + const CODE = { className: 'code', variants: [ // TODO: fix to allow these to work with sublanguage also @@ -36,13 +36,13 @@ export default function(hljs) { } ] }; - LIST = { + const LIST = { className: 'bullet', begin: '^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)', end: '\\s+', excludeEnd: true }; - LINK_REFERENCE = { + const LINK_REFERENCE = { begin: /^\[[^\n]+\]:/, returnBegin: true, contains: [ @@ -58,7 +58,7 @@ export default function(hljs) { } ] }; - LINK = { + const LINK = { begin: '\\[.+?\\][\\(\\[].*?[\\)\\]]', returnBegin: true, contains: [ @@ -82,7 +82,7 @@ export default function(hljs) { ], relevance: 10 }; - BOLD = { + const BOLD = { className: 'strong', contains: [], variants: [ @@ -90,7 +90,7 @@ export default function(hljs) { {begin: /\*{2}/, end: /\*{2}/ } ] }; - ITALIC = { + const ITALIC = { className: 'emphasis', contains: [], variants: [ @@ -101,7 +101,7 @@ export default function(hljs) { BOLD.contains.push(ITALIC); ITALIC.contains.push(BOLD); - CONTAINABLE = [ + var CONTAINABLE = [ INLINE_HTML, LINK ]; @@ -111,7 +111,7 @@ export default function(hljs) { CONTAINABLE = CONTAINABLE.concat(BOLD,ITALIC); - HEADER = { + const HEADER = { className: 'section', variants: [ { @@ -129,7 +129,7 @@ export default function(hljs) { ] }; - BLOCKQUOTE = { + const BLOCKQUOTE = { className: 'quote', begin: '^>\\s+', contains: CONTAINABLE, diff --git a/src/lib/modes.js b/src/lib/modes.js new file mode 100644 index 0000000000..4e153791d1 --- /dev/null +++ b/src/lib/modes.js @@ -0,0 +1,114 @@ +import {inherit} from './utils'; + +// Common regexps +export const IDENT_RE = '[a-zA-Z]\\w*'; +export const UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*'; +export const NUMBER_RE = '\\b\\d+(\\.\\d+)?'; +export const C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float +export const BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b... +export const RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~'; + +// Common modes +export const BACKSLASH_ESCAPE = { + begin: '\\\\[\\s\\S]', relevance: 0 +}; +export const APOS_STRING_MODE = { + className: 'string', + begin: '\'', end: '\'', + illegal: '\\n', + contains: [BACKSLASH_ESCAPE] +}; +export const QUOTE_STRING_MODE = { + className: 'string', + begin: '"', end: '"', + illegal: '\\n', + contains: [BACKSLASH_ESCAPE] +}; +export const PHRASAL_WORDS_MODE = { + 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|they|like|more)\b/ +}; +export const COMMENT = function (begin, end, inherits) { + var mode = inherit( + { + className: 'comment', + begin: begin, end: end, + contains: [] + }, + inherits || {} + ); + mode.contains.push(PHRASAL_WORDS_MODE); + mode.contains.push({ + className: 'doctag', + begin: '(?:TODO|FIXME|NOTE|BUG|XXX):', + relevance: 0 + }); + return mode; +}; +export const C_LINE_COMMENT_MODE = COMMENT('//', '$'); +export const C_BLOCK_COMMENT_MODE = COMMENT('/\\*', '\\*/'); +export const HASH_COMMENT_MODE = COMMENT('#', '$'); +export const NUMBER_MODE = { + className: 'number', + begin: NUMBER_RE, + relevance: 0 +}; +export const C_NUMBER_MODE = { + className: 'number', + begin: C_NUMBER_RE, + relevance: 0 +}; +export const BINARY_NUMBER_MODE = { + className: 'number', + begin: BINARY_NUMBER_RE, + relevance: 0 +}; +export const CSS_NUMBER_MODE = { + className: 'number', + begin: NUMBER_RE + '(' + + '%|em|ex|ch|rem' + + '|vw|vh|vmin|vmax' + + '|cm|mm|in|pt|pc|px' + + '|deg|grad|rad|turn' + + '|s|ms' + + '|Hz|kHz' + + '|dpi|dpcm|dppx' + + ')?', + relevance: 0 +}; +export const REGEXP_MODE = { + // this outer rule makes sure we actually have a WHOLE regex and not simply + // an expression such as: + // + // 3 / something + // + // (which will then blow up when regex's `illegal` sees the newline) + begin: /(?=\/[^\/\n]*\/)/, + contains: [{ + className: 'regexp', + begin: /\//, end: /\/[gimuy]*/, + illegal: /\n/, + contains: [ + BACKSLASH_ESCAPE, + { + begin: /\[/, end: /\]/, + relevance: 0, + contains: [BACKSLASH_ESCAPE] + } + ] + }] +}; +export const TITLE_MODE = { + className: 'title', + begin: IDENT_RE, + relevance: 0 +}; +export const UNDERSCORE_TITLE_MODE = { + className: 'title', + begin: UNDERSCORE_IDENT_RE, + relevance: 0 +}; +export const METHOD_GUARD = { + // excludes method names from keyword processing + begin: '\\.\\s*' + UNDERSCORE_IDENT_RE, + relevance: 0 +}; diff --git a/src/lib/regex.js b/src/lib/regex.js new file mode 100644 index 0000000000..a0e156de39 --- /dev/null +++ b/src/lib/regex.js @@ -0,0 +1,65 @@ +export function escape(value) { + return new RegExp(value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm'); +} + +export function source(re) { + // if it's a regex get it's source, + // otherwise it's a string already so just return it + return (re && re.source) || re; +} + +export function countMatchGroups(re) { + return (new RegExp(re.toString() + '|')).exec('').length - 1; +} + +export function startsWith(re, lexeme) { + var match = re && re.exec(lexeme); + return match && match.index === 0; +} + +// join logically computes regexps.join(separator), but fixes the +// backreferences so they continue to match. +// it also places each individual regular expression into it's own +// match group, keeping track of the sequencing of those match groups +// is currently an exercise for the caller. :-) +export function join(regexps, separator) { + // backreferenceRe matches an open parenthesis or backreference. To avoid + // an incorrect parse, it additionally matches the following: + // - [...] elements, where the meaning of parentheses and escapes change + // - other escape sequences, so we do not misparse escape sequences as + // interesting elements + // - non-matching or lookahead parentheses, which do not capture. These + // follow the '(' with a '?'. + var backreferenceRe = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./; + var numCaptures = 0; + var ret = ''; + for (var i = 0; i < regexps.length; i++) { + numCaptures += 1; + var offset = numCaptures; + var re = source(regexps[i]); + if (i > 0) { + ret += separator; + } + ret += "("; + while (re.length > 0) { + var match = backreferenceRe.exec(re); + if (match == null) { + ret += re; + break; + } + ret += re.substring(0, match.index); + re = re.substring(match.index + match[0].length); + if (match[0][0] == '\\' && match[1]) { + // Adjust the backreference. + ret += '\\' + String(Number(match[1]) + offset); + } else { + ret += match[0]; + if (match[0] == '(') { + numCaptures++; + } + } + } + ret += ")"; + } + return ret; +} diff --git a/src/lib/utils.js b/src/lib/utils.js new file mode 100644 index 0000000000..aa0813660b --- /dev/null +++ b/src/lib/utils.js @@ -0,0 +1,137 @@ +export function escapeHTML(value) { + return value.replace(/&/g, '&').replace(//g, '>'); +} + + +/** + * performs a shallow merge of multiple objects into one + * + * @arguments list of objects with properties to merge + * @returns a single new object + */ +export 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]; + objects.forEach(function(obj) { + for (key in obj) + result[key] = obj[key]; + }); + return result; +} + +/* Stream merging */ + + +function tag(node) { + return node.nodeName.toLowerCase(); +} + + +export function nodeStream(node) { + var result = []; + (function _nodeStream(node, offset) { + for (var child = node.firstChild; child; child = child.nextSibling) { + if (child.nodeType === 3) + offset += child.nodeValue.length; + else if (child.nodeType === 1) { + result.push({ + event: 'start', + offset: offset, + node: child + }); + offset = _nodeStream(child, offset); + // Prevent void elements from having an end tag that would actually + // double them in the output. There are more void elements in HTML + // but we list only those realistically expected in code display. + if (!tag(child).match(/br|hr|img|input/)) { + result.push({ + event: 'stop', + offset: offset, + node: child + }); + } + } + } + return offset; + })(node, 0); + return result; +} + +export function mergeStreams(original, highlighted, value) { + var processed = 0; + var result = ''; + var nodeStack = []; + + function selectStream() { + if (!original.length || !highlighted.length) { + return original.length ? original : highlighted; + } + if (original[0].offset !== highlighted[0].offset) { + return (original[0].offset < highlighted[0].offset) ? original : highlighted; + } + + /* + To avoid starting the stream just before it should stop the order is + ensured that original always starts first and closes last: + + if (event1 == 'start' && event2 == 'start') + return original; + if (event1 == 'start' && event2 == 'stop') + return highlighted; + if (event1 == 'stop' && event2 == 'start') + return original; + if (event1 == 'stop' && event2 == 'stop') + return highlighted; + + ... which is collapsed to: + */ + return highlighted[0].event === 'start' ? original : highlighted; + } + + function open(node) { + function attr_str(a) { + return ' ' + a.nodeName + '="' + escapeHTML(a.value).replace(/"/g, '"') + '"'; + } + result += '<' + tag(node) + [].map.call(node.attributes, attr_str).join('') + '>'; + } + + function close(node) { + result += ''; + } + + function render(event) { + (event.event === 'start' ? open : close)(event.node); + } + + while (original.length || highlighted.length) { + var stream = selectStream(); + result += escapeHTML(value.substring(processed, stream[0].offset)); + processed = stream[0].offset; + if (stream === original) { + /* + On any opening or closing tag of the original markup we first close + the entire highlighted node stack, then render the original tag along + with all the following original tags at the same offset and then + reopen all the tags on the highlighted stack. + */ + nodeStack.reverse().forEach(close); + do { + render(stream.splice(0, 1)[0]); + stream = selectStream(); + } while (stream === original && stream.length && stream[0].offset === processed); + nodeStack.reverse().forEach(open); + } else { + if (stream[0].event === 'start') { + nodeStack.push(stream[0].node); + } else { + nodeStack.pop(); + } + render(stream.splice(0, 1)[0]); + } + } + return result + escapeHTML(value.substr(processed)); +} diff --git a/src/vendor/deep_freeze.js b/src/vendor/deep_freeze.js new file mode 100644 index 0000000000..0bc2c2d003 --- /dev/null +++ b/src/vendor/deep_freeze.js @@ -0,0 +1,20 @@ +// https://github.com/substack/deep-freeze/blob/master/index.js +export default function deepFreeze (o) { + Object.freeze(o); + + var objIsFunction = typeof o === 'function'; + + Object.getOwnPropertyNames(o).forEach(function (prop) { + if (o.hasOwnProperty(prop) + && o[prop] !== null + && (typeof o[prop] === "object" || typeof o[prop] === "function") + // IE11 fix: https://github.com/highlightjs/highlight.js/issues/2318 + // TODO: remove in the future + && (objIsFunction ? prop !== 'caller' && prop !== 'callee' && prop !== 'arguments' : true) + && !Object.isFrozen(o[prop])) { + deepFreeze(o[prop]); + } + }); + + return o; +}; diff --git a/test/api/cNumber.js b/test/api/cNumber.js index 802a87d256..b852287965 100644 --- a/test/api/cNumber.js +++ b/test/api/cNumber.js @@ -2,20 +2,18 @@ const _ = require('lodash'); const hljs = require('../../build'); -const utility = require('../utility'); const pattern = new RegExp(`${hljs.C_NUMBER_RE}$`); -const numberToString = utility.numberToString; describe('.C_NUMBER_RE', () => { it('should match regular numbers', () => { - const numbers = _.map(_.range(0, 1001), numberToString); + const numbers = _.range(0, 1001).map(x => x.toString()); numbers.should.matchEach(pattern); }); it('should match decimals', () => { - const decimal = _.map(_.range(0, 1.001, 0.001), numberToString); + const decimal = _.range(0, 1.001, 0.001).map(x => x.toString()); const noLeadingZero = ['.1234', '.5206', '.0002', '.9998']; const numbers = [].concat(decimal, noLeadingZero); diff --git a/test/api/number.js b/test/api/number.js index fa45a69c18..85f60fe1a0 100644 --- a/test/api/number.js +++ b/test/api/number.js @@ -2,15 +2,13 @@ const _ = require('lodash'); const hljs = require('../../build'); -const utility = require('../utility'); const pattern = new RegExp(`${hljs.NUMBER_RE}$`); -const numberToString = utility.numberToString; describe('.NUMBER_RE', () => { it('should match regular numbers and decimals', () => { - const number = _.map(_.range(0, 1001), numberToString); - const decimal = _.map(_.range(0, 1.001, 0.001), numberToString); + const number = _.range(0, 1001).map(x => x.toString()); + const decimal = _.range(0, 1.001, 0.001).map(x => x.toString()); const noLeadingZero = ['.1234', '.5206', '.0002', '.9998']; const numbers = [].concat(number, decimal, noLeadingZero); diff --git a/test/browser/worker.js b/test/browser/worker.js index 9cc04ef5b2..ecec3e321f 100644 --- a/test/browser/worker.js +++ b/test/browser/worker.js @@ -13,7 +13,7 @@ describe('web worker', function() { importScripts(event.data.script); postMessage(1); } else { - var result = self.hljs.highlight('javascript', event.data); + var result = hljs.highlight('javascript', event.data); postMessage(result.value); } }; diff --git a/test/index.js b/test/index.js index fdb0cc6bad..4fbf3b2edb 100644 --- a/test/index.js +++ b/test/index.js @@ -27,4 +27,3 @@ require('./markup'); // browser inside of node.js and runs together with all the other tests. require('./special'); -require("./tools"); diff --git a/test/markup/index.js b/test/markup/index.js index bf3876437c..dea935f1f3 100644 --- a/test/markup/index.js +++ b/test/markup/index.js @@ -1,6 +1,5 @@ 'use strict'; -const _ = require('lodash'); const fs = require('fs').promises; const glob = require('glob'); const hljs = require('../../build'); @@ -17,7 +16,7 @@ function testLanguage(language, {testDir}) { const filePath = where, filenames = glob.sync(filePath); - _.each(filenames, function(filename) { + filenames.forEach(function(filename) { const testName = path.basename(filename, '.expect.txt'), sourceName = filename.replace(/\.expect/, ''); diff --git a/test/special/buildClassName.js b/test/special/buildClassName.js index 3b06170f09..304071e431 100644 --- a/test/special/buildClassName.js +++ b/test/special/buildClassName.js @@ -1,12 +1,10 @@ 'use strict'; -const _ = require('lodash'); - describe('block class names', () => { before( () => { const testHTML = document.querySelectorAll('#build-classname .hljs'); - this.blocks = _.map(testHTML, 'className'); + this.blocks = [...testHTML].map((x) => x.className); }); it('should add language class name to block', () => { diff --git a/test/special/customMarkup.js b/test/special/customMarkup.js index 5dda648c73..fd88e377cc 100644 --- a/test/special/customMarkup.js +++ b/test/special/customMarkup.js @@ -1,13 +1,12 @@ 'use strict'; -const _ = require('lodash'); const utility = require('../utility'); describe('custom markup', () => { before(() => { const testHTML = document.querySelectorAll('#custom-markup .hljs'); - this.blocks = _.map(testHTML, 'innerHTML'); + this.blocks = [...testHTML].map(x => x.innerHTML); }); it('should replace tabs', () => { diff --git a/test/special/index.js b/test/special/index.js index c930842080..1b5419321d 100644 --- a/test/special/index.js +++ b/test/special/index.js @@ -1,6 +1,5 @@ 'use strict'; -const _ = require('lodash'); const hljs = require('../../build'); const { JSDOM } = require('jsdom'); const { readFile } = require('fs').promises; @@ -26,7 +25,7 @@ describe('special cases tests', () => { hljs.configure({ useBR: true }); let blocks = document.querySelectorAll('.code'); - _.each(blocks, hljs.highlightBlock); + blocks.forEach(hljs.highlightBlock); }); require('./explicitLanguage'); diff --git a/test/special/languageAlias.js b/test/special/languageAlias.js index 8dc9d71fe6..7f80294cc3 100644 --- a/test/special/languageAlias.js +++ b/test/special/languageAlias.js @@ -1,13 +1,12 @@ 'use strict'; -const _ = require('lodash'); const utility = require('../utility'); describe('language alias', () => { before(() => { const testHTML = document.querySelectorAll('#language-alias .hljs'); - this.blocks = _.map(testHTML, 'innerHTML'); + this.blocks = [...testHTML].map(x => x.innerHTML); }); it('should highlight as aliased language', () => { diff --git a/test/special/noHighlight.js b/test/special/noHighlight.js index de085ddb47..3907b37722 100644 --- a/test/special/noHighlight.js +++ b/test/special/noHighlight.js @@ -1,12 +1,10 @@ 'use strict'; -const _ = require('lodash'); - describe('no highlighting', () => { before(() => { const testHTML = document.querySelectorAll('#no-highlight pre'); - this.blocks = _.map(testHTML, 'children[0].innerHTML'); + this.blocks = [...testHTML].map((x) => x.children[0].innerHTML); this.expected = { html: '<div id="contents">\n ' + '<p>Hello, World!\n</div>', diff --git a/test/tools.js b/test/tools.js deleted file mode 100644 index 9c3ee1ad2a..0000000000 --- a/test/tools.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const utility = require('../tools/utility'); -const path = require('path'); -const { readFile } = require('fs').promises; - -describe("minification tools", () => { - it("should replace API calls with minified names", () => { - let content = "hljs.COMMENT(); hj.NUMBER_MODE == 0; a = hljs.endRe"; - content.replace(utility.regex.replaces, utility.replaceClassNames).should.equal( - "hljs.C(); hj.NM == 0; a = hljs.eR" - ); - }); - - it("should replace API calls with minified names and protect declarations", () => { - let content = "hj.NUMBER_MODE == 0; hljs.COMMENT = 1; a = hljs.endRe"; - content.replace(utility.regex.replaces, utility.replaceClassNames).should.equal( - "hj.NM == 0; hljs.C = hljs.COMMENT = 1; a = hljs.eR" - ); - }); - - it("should NOT protect non-public member declarations", () => { - let content = "hljs.endRe = 3;"; - content.replace(utility.regex.replaces, utility.replaceClassNames).should.equal( - "hljs.eR = 3;" - ); - }); - - it("should assign API_REPLACES to the REPLACES dictionary in the highlight.js code", (done) => { - readFile(path.join(__dirname, "../src/highlight.js"), 'utf-8').then(function(content) { - "abc".should.containEql("bc"); - content.should.not.containEql("var API_REPLACES = " + JSON.stringify(utility.REPLACES)); - content.replace(utility.regex.apiReplacesFrom, utility.regex.apiReplacesTo) - .should - .containEql("var API_REPLACES = " + JSON.stringify(utility.REPLACES)); - done(); - }); - }); -}); diff --git a/test/utility.js b/test/utility.js index c656648227..60318df03f 100644 --- a/test/utility.js +++ b/test/utility.js @@ -1,19 +1,16 @@ 'use strict'; -const _ = require('lodash'); const { readFile } = require('fs').promises; const path = require('path'); // Build a path relative to `test/` exports.buildPath = function() { - const args = _.slice(arguments, 0), + const args = [...arguments], paths = [__dirname].concat(args); return path.join.apply(this, paths); }; -exports.numberToString = _.method('toString'); - exports.expectedFile = (filename, encoding, actual) => { return readFile(filename, encoding) .then(expected => actual.trim().should.equal(expected.trim())); @@ -23,6 +20,6 @@ exports.setupFile = (filename, encoding, that, testHTML) => { return readFile(filename, encoding) .then(expected => { that.expected = expected.trim(); - that.blocks = _.map(testHTML, 'innerHTML'); + that.blocks = [...testHTML].map(x => x.innerHTML); }); }; diff --git a/tools/build_browser.js b/tools/build_browser.js index 6f2a972a33..45f1bbe1fa 100644 --- a/tools/build_browser.js +++ b/tools/build_browser.js @@ -10,6 +10,7 @@ const { filter } = require("./lib/dependencies"); const config = require("./build_config"); const { install, install_cleancss, mkdir, renderTemplate } = require("./lib/makestuff"); const log = (...args) => console.log(...args); +const { rollupCode } = require("./lib/bundling.js"); function buildHeader(args) { return "/*\n" + @@ -104,16 +105,19 @@ async function buildBrowserHighlightJS(languages, {minify}) { var outFile = `${process.env.BUILD_DIR}/highlight.js`; var minifiedFile = outFile.replace(/js$/,"min.js"); - var librarySrc = await fs.readFile("src/highlight.js", {encoding: "utf8"}); + + const input = { input: `src/highlight.js` } + const output = { ...config.rollup.browser_core.output, file: outFile }; + var librarySrc = await rollupCode(input, output); + + // var librarySrc = await fs.readFile("src/highlight.js", {encoding: "utf8"}); var coreSize = librarySrc.length; // strip off the original top comment librarySrc = librarySrc.replace(/\/\*.*?\*\//s,""); - var workerStub = "if (typeof importScripts === 'function') { var hljs = self.hljs; }"; - var fullSrc = [ - header, librarySrc, workerStub, + header, librarySrc, ...languages.map((lang) => lang.module) ].join("\n"); var tasks = []; @@ -126,11 +130,11 @@ async function buildBrowserHighlightJS(languages, {minify}) { var tersed = Terser.minify(librarySrc, config.terser) minifiedSrc = [ - header, tersed.code, workerStub, + header, tersed.code, ...languages.map((lang) => lang.minified) ].join("\n"); // get approximate core minified size - core_min = [ header, tersed.code, workerStub].join().length; + core_min = [ header, tersed.code].join().length; tasks.push(fs.writeFile(minifiedFile, minifiedSrc, {encoding: "utf8"})); } diff --git a/tools/build_config.js b/tools/build_config.js index 24dcdc8c2b..fb78222416 100644 --- a/tools/build_config.js +++ b/tools/build_config.js @@ -21,6 +21,14 @@ module.exports = { ], }, }, + browser_core: { + input: {}, + output: { + name: "hljs", + format: "umd", + interop: false, + } + }, browser: { input: { plugins: [ @@ -30,10 +38,7 @@ module.exports = { output: { format: "iife", outro: "return module.exports.definer || module.exports;", - strict: false, - compact: false, interop: false, - extend: false, } } }, diff --git a/tools/codeformat.js b/tools/codeformat.js index e6c5727338..081af2364b 100644 --- a/tools/codeformat.js +++ b/tools/codeformat.js @@ -1,6 +1,5 @@ 'use strict'; -var _ = require('lodash'); var bluebird = require('bluebird'); var path = require('path'); var glob = bluebird.promisify(require('glob')); diff --git a/tools/utility.js b/tools/utility.js deleted file mode 100644 index c244d67114..0000000000 --- a/tools/utility.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -let regex = {}; - -const REPLACES = { - 'case_insensitive': 'cI', - 'lexemes': 'l', - 'contains': 'c', - 'keywords': 'k', - 'subLanguage': 'sL', - 'className': 'cN', - 'begin': 'b', - 'beginKeywords': 'bK', - 'end': 'e', - 'endsWithParent': 'eW', - 'illegal': 'i', - 'excludeBegin': 'eB', - 'excludeEnd': 'eE', - 'returnBegin': 'rB', - 'returnEnd': 'rE', - 'variants': 'v', - - 'IDENT_RE': 'IR', - 'UNDERSCORE_IDENT_RE': 'UIR', - 'NUMBER_RE': 'NR', - 'C_NUMBER_RE': 'CNR', - 'BINARY_NUMBER_RE': 'BNR', - 'RE_STARTERS_RE': 'RSR', - 'BACKSLASH_ESCAPE': 'BE', - 'APOS_STRING_MODE': 'ASM', - 'QUOTE_STRING_MODE': 'QSM', - 'PHRASAL_WORDS_MODE': 'PWM', - 'C_LINE_COMMENT_MODE': 'CLCM', - 'C_BLOCK_COMMENT_MODE': 'CBCM', - 'HASH_COMMENT_MODE': 'HCM', - 'NUMBER_MODE': 'NM', - 'C_NUMBER_MODE': 'CNM', - 'BINARY_NUMBER_MODE': 'BNM', - 'CSS_NUMBER_MODE': 'CSSNM', - 'REGEXP_MODE': 'RM', - 'TITLE_MODE': 'TM', - 'UNDERSCORE_TITLE_MODE': 'UTM', - 'COMMENT': 'C', - - 'beginRe': 'bR', - 'endRe': 'eR', - 'illegalRe': 'iR', - 'lexemesRe': 'lR', - 'terminators': 't', - 'terminator_end': 'tE' -}; - -regex.replaces = new RegExp( - `(?:([\\w\\d]+)\\.(${Object.keys(REPLACES).filter(r => r.toUpperCase() === r).join('|')})\\s*=(?!=)|\\b(${Object.keys(REPLACES).join('|')})\\b)`, 'g'); - -regex.apiReplacesFrom = /\bvar\s*API_REPLACES\b/; -regex.apiReplacesTo = `var API_REPLACES = ${JSON.stringify(REPLACES)}`; - -function replaceClassNames(match, gDeclObj, gDeclKey) { - if(gDeclObj) - return replaceAndSaveClassNames(gDeclObj, gDeclKey); - else - return REPLACES[match]; -} - -function replaceAndSaveClassNames(obj, key) { - return `${obj}.${REPLACES[key]} = ${obj}.${key} =`; -} - -module.exports = { - regex: regex, - replaceClassNames: replaceClassNames, - REPLACES: REPLACES -}; From 65d46b34f2b91c04c5663061302e69b9320be3cd Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 15 Feb 2020 18:38:54 -0500 Subject: [PATCH 002/816] (parser) language grammars have a `name` attribute now (#2400) --- CHANGES.md | 1 + src/highlight.js | 3 +++ src/languages/sql.js | 1 + 3 files changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f2b85d5c3e..c4ff353ebc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ New themes: Core Changes: +- every language can have a `name` attribute now (#2400) [Josh Goebel][] - improve regular expression detect (less false-positives) (#2380) [Josh Goebel][] - make `noHighlightRe` and `languagePrefixRe` configurable (#2374) [Josh Goebel][] diff --git a/src/highlight.js b/src/highlight.js index 928b036b78..ab0d3404c5 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -719,6 +719,9 @@ const HLJS = function(hljs) { // entire highlighter lang = PLAINTEXT_LANGUAGE; } + // give it a temporary name if it doesn't have one in the meta-data + if (!lang.name) + lang.name = name; languages[name] = lang; lang.rawDefinition = language.bind(null,hljs); diff --git a/src/languages/sql.js b/src/languages/sql.js index 7cf4679368..4b482a6b03 100644 --- a/src/languages/sql.js +++ b/src/languages/sql.js @@ -8,6 +8,7 @@ export default function(hljs) { var COMMENT_MODE = hljs.COMMENT('--', '$'); return { + name: "SQL", case_insensitive: true, illegal: /[<>{}*]/, contains: [ From 4bc39be963aea79c8b5dd6b2c17c9be2f4d595b0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 16 Feb 2020 21:48:57 -0500 Subject: [PATCH 003/816] fix(javascript) comma is allowed in a "value container" (#2403) - fixes case where a regex would not be detected if it was anything other than the first parameter of a function call - in some cases this could actually cause the whole snippet to be flagged as illegal if the regex contained characters that were invalid at the top level (such as #) This complexity is because we only detect regexs inside "value containers" to prevent false positivies. This issue was found when asking Highlight.js to highlight it's own non-minified 1.2mb browser build. --- CHANGES.md | 1 + src/languages/javascript.js | 4 ++++ test/markup/javascript/method-call.expect.txt | 5 +++++ test/markup/javascript/method-call.txt | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c4ff353ebc..323bab5cde 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Core Changes: Language Improvements: +- fix(javascript) comma is allowed in a "value container" (#2403) [Josh Goebel][] - enh(apache) add `deny` and `allow` keywords [Josh Goebel][] - enh(apache) highlight numeric attributes values [Josh Goebel][] - enh(apache) highlight IP addresses, ports, and strings in sections [Josh Goebel][] diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 4ec89f3ca7..7cf8a0d532 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -189,6 +189,9 @@ export default function(hljs) { } ] }, + { // could be a comma delimited list of params to a function call + begin: /,/, relevance: 0, + }, { className: '', begin: /\s/, @@ -229,6 +232,7 @@ export default function(hljs) { { begin: /\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something` }, + hljs.METHOD_GUARD, { // ES6 class className: 'class', diff --git a/test/markup/javascript/method-call.expect.txt b/test/markup/javascript/method-call.expect.txt index 25b4a6adab..c4f40657b0 100644 --- a/test/markup/javascript/method-call.expect.txt +++ b/test/markup/javascript/method-call.expect.txt @@ -1 +1,6 @@ x.continue(0); + +x = [ +hljs.COMMENT(/\{%\s*comment\s*%}/, /\{%\s*endcomment\s*%}/), +hljs.COMMENT(/\{#/, /#}/), +] diff --git a/test/markup/javascript/method-call.txt b/test/markup/javascript/method-call.txt index e4e6cc47a4..f5ea219ec9 100644 --- a/test/markup/javascript/method-call.txt +++ b/test/markup/javascript/method-call.txt @@ -1 +1,7 @@ x.continue(0); + +x = [ +hljs.COMMENT(/\{%\s*comment\s*%}/, /\{%\s*endcomment\s*%}/), +hljs.COMMENT(/\{#/, /#}/), +] + From 3f2b813a3732f45b0a5e719e3d16fa55bf73c5f9 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 17 Feb 2020 00:17:27 -0500 Subject: [PATCH 004/816] fix(elixir) Support function names/symbols with a slash (#2406) - Do not mistake code like `import Kernel, except: [ /: 2 ]` as the beginning of a regex, which causes highlighting to break. - `/:`, `+:`, are still not considered symbols This solves the problem by making the pattern `/: \d` an exception case that is never treated as a regex. For most cases, most of the time this should be a win. Resolves #730. --- CHANGES.md | 1 + src/languages/elixir.js | 21 +++++++++++++------ .../elixir/function-not-regex.expect.txt | 6 ++++++ test/markup/elixir/function-not-regex.txt | 6 ++++++ 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 test/markup/elixir/function-not-regex.expect.txt create mode 100644 test/markup/elixir/function-not-regex.txt diff --git a/CHANGES.md b/CHANGES.md index 323bab5cde..d767090542 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Core Changes: Language Improvements: +- fix(elixir) Support function names with a slash (#2406) [Josh Goebel][] - fix(javascript) comma is allowed in a "value container" (#2403) [Josh Goebel][] - enh(apache) add `deny` and `allow` keywords [Josh Goebel][] - enh(apache) highlight numeric attributes values [Josh Goebel][] diff --git a/src/languages/elixir.js b/src/languages/elixir.js index 89f498774d..998fa745a1 100644 --- a/src/languages/elixir.js +++ b/src/languages/elixir.js @@ -19,7 +19,11 @@ export default function(hljs) { lexemes: ELIXIR_IDENT_RE, keywords: ELIXIR_KEYWORDS }; - + var NUMBER = { + className: 'number', + begin: '(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[1-9][0-9_]*(.[0-9_]+([eE][-+]?[0-9]+)?)?)', + relevance: 0 + }; var SIGIL_DELIMITERS = '[/|([{<"\']' var LOWERCASE_SIGIL = { className: 'string', @@ -128,11 +132,7 @@ export default function(hljs) { begin: ELIXIR_IDENT_RE + ':(?!:)', relevance: 0 }, - { - className: 'number', - begin: '(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[1-9][0-9_]*(.[0-9_]+([eE][-+]?[0-9]+)?)?)', - relevance: 0 - }, + NUMBER, { className: 'variable', begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))' @@ -144,6 +144,15 @@ export default function(hljs) { begin: '(' + hljs.RE_STARTERS_RE + ')\\s*', contains: [ hljs.HASH_COMMENT_MODE, + { + // to prevent false regex triggers for the division function: + // /: + begin: /\/: (?=\d+\s*[,\]])/, + relevance: 0, + contains: [ + NUMBER + ] + }, { className: 'regexp', illegal: '\\n', diff --git a/test/markup/elixir/function-not-regex.expect.txt b/test/markup/elixir/function-not-regex.expect.txt new file mode 100644 index 0000000000..bd914311ce --- /dev/null +++ b/test/markup/elixir/function-not-regex.expect.txt @@ -0,0 +1,6 @@ +import Kernel, except: [ + spawn: 1, + +: 2, + /: 2, + Unless: 2 +] diff --git a/test/markup/elixir/function-not-regex.txt b/test/markup/elixir/function-not-regex.txt new file mode 100644 index 0000000000..bda5875d58 --- /dev/null +++ b/test/markup/elixir/function-not-regex.txt @@ -0,0 +1,6 @@ +import Kernel, except: [ + spawn: 1, + +: 2, + /: 2, + Unless: 2 +] From fb6181afd25e8a08595b4eaf9cf86b55907da558 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 18 Feb 2020 11:12:07 -0500 Subject: [PATCH 005/816] (chore) pull out mode compilation into a dependency (#2409) - a top-level `self` reference will now always raise an error - pull out mode compilation into a dependency --- VERSION_10_BREAKING.md | 2 + src/highlight.js | 206 +-------------------------------------- src/lib/mode_compiler.js | 199 +++++++++++++++++++++++++++++++++++++ 3 files changed, 203 insertions(+), 204 deletions(-) create mode 100644 src/lib/mode_compiler.js diff --git a/VERSION_10_BREAKING.md b/VERSION_10_BREAKING.md index 1a6473e86d..0d67efda1f 100644 --- a/VERSION_10_BREAKING.md +++ b/VERSION_10_BREAKING.md @@ -4,6 +4,8 @@ Incompatibilities: - chore(parser): compressed version 9.x language definitions no longer supported (rebuild them minified) [Josh Goebel][] - `nohightlight` and `no-highlight` are the only "ignore me" css classes now (`plain` and `text` no longer count) (to get the old behavior you can customize `noHighlightRe`) +- a grammar with a top-level `self` reference will now always throw an error + (previously in safe mode this would be silently ignored) Renamed Language Files: - chore(parser): rename `nimrod.js` to `nim.js` [Josh Goebel][] diff --git a/src/highlight.js b/src/highlight.js index ab0d3404c5..9d46bc2687 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -7,12 +7,13 @@ import deepFreeze from './vendor/deep_freeze'; import * as regex from './lib/regex'; import * as utils from './lib/utils'; import * as MODES from './lib/modes'; +import { compileLanguage } from './lib/mode_compiler'; const escape = utils.escapeHTML; const inherit = utils.inherit; - const { nodeStream, mergeStreams } = utils; + const HLJS = function(hljs) { // Convenience variables for build-in objects var ArrayProto = []; @@ -43,9 +44,6 @@ const HLJS = function(hljs) { languages: undefined }; - // keywords that should have no default relevance value - var COMMON_KEYWORDS = 'of and for in not or if then'.split(' '); - /* Utility functions */ function isNotHighlighted(language) { @@ -74,206 +72,6 @@ const HLJS = function(hljs) { .find((_class) => isNotHighlighted(_class) || getLanguage(_class)) } - - /* Initialization */ - - function dependencyOnParent(mode) { - if (!mode) return false; - - return mode.endsWithParent || dependencyOnParent(mode.starts); - } - - function expand_or_clone_mode(mode) { - if (mode.variants && !mode.cached_variants) { - mode.cached_variants = mode.variants.map(function(variant) { - return inherit(mode, {variants: null}, variant); - }); - } - - // EXPAND - // if we have variants then essentially "replace" the mode with the variants - // this happens in compileMode, where this function is called from - if (mode.cached_variants) - return mode.cached_variants; - - // CLONE - // if we have dependencies on parents then we need a unique - // instance of ourselves, so we can be reused with many - // different parents without issue - if (dependencyOnParent(mode)) - return inherit(mode, { starts: mode.starts ? inherit(mode.starts) : null }); - - if (Object.isFrozen(mode)) - return inherit(mode); - - // no special dependency issues, just return ourselves - return mode; - } - - function compileKeywords(rawKeywords, case_insensitive) { - var compiled_keywords = {}; - - if (typeof rawKeywords === 'string') { // string - splitAndCompile('keyword', rawKeywords); - } else { - Object.keys(rawKeywords).forEach(function (className) { - splitAndCompile(className, rawKeywords[className]); - }); - } - return compiled_keywords; - - // --- - - function splitAndCompile(className, str) { - if (case_insensitive) { - str = str.toLowerCase(); - } - str.split(' ').forEach(function(keyword) { - var pair = keyword.split('|'); - compiled_keywords[pair[0]] = [className, scoreForKeyword(pair[0], pair[1])]; - }); - } - } - - function scoreForKeyword(keyword, providedScore) { - // manual scores always win over common keywords - // so you can force a score of 1 if you really insist - if (providedScore) - return Number(providedScore); - - return commonKeyword(keyword) ? 0 : 1; - } - - function commonKeyword(word) { - return COMMON_KEYWORDS.includes(word.toLowerCase()); - } - - function compileLanguage(language) { - - function langRe(value, global) { - return new RegExp( - regex.source(value), - 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '') - ); - } - - function buildModeRegex(mode) { - - var matchIndexes = {}; - var matcherRe; - var regexes = []; - var matcher = {}; - var matchAt = 1; - - function addRule(rule, re) { - matchIndexes[matchAt] = rule; - regexes.push([rule, re]); - matchAt += regex.countMatchGroups(re) + 1; - } - - mode.contains.forEach(term => addRule(term, term.begin)) - - if (mode.terminator_end) - addRule("end", mode.terminator_end); - if (mode.illegal) - addRule("illegal", mode.illegal); - - var terminators = regexes.map(el => el[1]); - matcherRe = langRe(regex.join(terminators, '|'), true); - - matcher.lastIndex = 0; - matcher.exec = function(s) { - var rule; - - if( regexes.length === 0) return null; - - matcherRe.lastIndex = matcher.lastIndex; - var match = matcherRe.exec(s); - if (!match) { return null; } - - for(var i = 0; i addRule(term, term.begin)) + + if (mode.terminator_end) + addRule("end", mode.terminator_end); + if (mode.illegal) + addRule("illegal", mode.illegal); + + var terminators = regexes.map(el => el[1]); + matcherRe = langRe(regex.join(terminators, '|'), true); + + matcher.lastIndex = 0; + matcher.exec = function(s) { + var rule; + + if( regexes.length === 0) return null; + + matcherRe.lastIndex = matcher.lastIndex; + var match = matcherRe.exec(s); + if (!match) { return null; } + + for(var i = 0; i Date: Wed, 19 Feb 2020 02:25:26 -0500 Subject: [PATCH 006/816] enh(armasm) support // and # style line comments (#2410) * enh(armasm) support line comments // and # Fixes #2408. * fix(armasm) instructions should not include the space after * fix(armasm) symbols should not include prior newline * add generic test case * comment should not include whitespace at beginning * also accept tabs as white space --- src/languages/armasm.js | 19 ++++++++++++++----- test/markup/armasm/default.expect.txt | 24 ++++++++++++++++++++++++ test/markup/armasm/default.txt | 24 ++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 test/markup/armasm/default.expect.txt create mode 100644 test/markup/armasm/default.txt diff --git a/src/languages/armasm.js b/src/languages/armasm.js index 60da65a7b9..0750b88b08 100644 --- a/src/languages/armasm.js +++ b/src/languages/armasm.js @@ -7,6 +7,16 @@ Category: assembler export default function(hljs) { //local labels: %?[FB]?[AT]?\d{1,2}\w+ + + const COMMENT = { + variants: [ + hljs.COMMENT('^[ \\t]*(?=#)', '$', {relevance: 0, excludeBegin: true }), + hljs.COMMENT('[;@]', '$', {relevance: 0}), + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE, + ] + } + return { case_insensitive: true, aliases: ['arm'], @@ -56,11 +66,10 @@ export default function(hljs) { 'wfe|wfi|yield'+ ')'+ '(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?'+ //condition codes - '[sptrx]?' , //legal postfixes - end: '\\s' + '[sptrx]?' + //legal postfixes + '(?=\\s)' // followed by space }, - hljs.COMMENT('[;@]', '$', {relevance: 0}), - hljs.C_BLOCK_COMMENT_MODE, + COMMENT, hljs.QUOTE_STRING_MODE, { className: 'string', @@ -87,8 +96,8 @@ export default function(hljs) { { className: 'symbol', variants: [ + {begin: '^[ \\t]*[a-z_\\.\\$][a-z0-9_\\.\\$]+:'}, //GNU ARM syntax {begin: '^[a-z_\\.\\$][a-z0-9_\\.\\$]+'}, //ARM syntax - {begin: '^\\s*[a-z_\\.\\$][a-z0-9_\\.\\$]+:'}, //GNU ARM syntax {begin: '[=#]\\w+' } //label reference ], relevance: 0 diff --git a/test/markup/armasm/default.expect.txt b/test/markup/armasm/default.expect.txt new file mode 100644 index 0000000000..b75dd276b9 --- /dev/null +++ b/test/markup/armasm/default.expect.txt @@ -0,0 +1,24 @@ +//=================== YOUR CODE GOES IN THE SECTION BELOW ===================// + + # check for and handle zero + orr r1, r0, #128 // r1 = r0 | 128 + cmp r1, #128 // if r1 == 128 { + bne notZero // . + bl zeroQuidFP2float // zeroQuidFP2float() } + b end // else { + +notZero: // . + # extract fields from quidfp + and r1, r0, #128 // r1 = r0 & 128 // sign + and r2, r0, #112 // r2 = r0 & 112 // exponent + and r3, r0, #15 // r3 = r0 & 15 // mantissa + + // ... + + # combine into r0 + orr r0, r1, r2 // r0 = r1 | r2 + orr r0, r0, r3 // r0 = r0 | r3 } + +end: // return r0 + + //===========================================================================// diff --git a/test/markup/armasm/default.txt b/test/markup/armasm/default.txt new file mode 100644 index 0000000000..0e38d515fa --- /dev/null +++ b/test/markup/armasm/default.txt @@ -0,0 +1,24 @@ + //=================== YOUR CODE GOES IN THE SECTION BELOW ===================// + + # check for and handle zero + orr r1, r0, #128 // r1 = r0 | 128 + cmp r1, #128 // if r1 == 128 { + bne notZero // . + bl zeroQuidFP2float // zeroQuidFP2float() } + b end // else { + +notZero: // . + # extract fields from quidfp + and r1, r0, #128 // r1 = r0 & 128 // sign + and r2, r0, #112 // r2 = r0 & 112 // exponent + and r3, r0, #15 // r3 = r0 & 15 // mantissa + + // ... + + # combine into r0 + orr r0, r1, r2 // r0 = r1 | r2 + orr r0, r0, r3 // r0 = r0 | r3 } + +end: // return r0 + + //===========================================================================// From 38c7ba9a6726bfc70ebb5ac9407b55baadb71b10 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 19 Feb 2020 12:13:38 -0500 Subject: [PATCH 007/816] (chore) bump to 10.0 to prepare for beta --- CHANGES.md | 2 +- docs/conf.py | 4 ++-- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d767090542..3bb58c9569 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## Version (master) +## Version 10.0.0 (beta.0) New languages: diff --git a/docs/conf.py b/docs/conf.py index 49a32b7787..a598d03deb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = '9.18' +version = '10.0' # The full version, including alpha/beta/rc tags. -release = '9.18.0' +release = '10.0.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/package-lock.json b/package-lock.json index 82d11b5110..03b1916605 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "highlight.js", - "version": "9.18.0", + "version": "10.0.0-beta.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e566ff8a27..8de5f55004 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "9.18.0", + "version": "10.0.0-beta.0", "author": { "name": "Ivan Sagalaev", "email": "maniac@softwaremaniacs.org" From effa09aa2ad968488ee474df0b120bd067f5984d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 19 Feb 2020 13:29:02 -0500 Subject: [PATCH 008/816] (chore) Change markup samples for armasm comments User requested the issue example code they provided not be used verbatim. Closes #2411. --- test/markup/armasm/default.expect.txt | 37 ++++++++++----------------- test/markup/armasm/default.txt | 37 ++++++++++----------------- 2 files changed, 26 insertions(+), 48 deletions(-) diff --git a/test/markup/armasm/default.expect.txt b/test/markup/armasm/default.expect.txt index b75dd276b9..9825c28460 100644 --- a/test/markup/armasm/default.expect.txt +++ b/test/markup/armasm/default.expect.txt @@ -1,24 +1,13 @@ -//=================== YOUR CODE GOES IN THE SECTION BELOW ===================// - - # check for and handle zero - orr r1, r0, #128 // r1 = r0 | 128 - cmp r1, #128 // if r1 == 128 { - bne notZero // . - bl zeroQuidFP2float // zeroQuidFP2float() } - b end // else { - -notZero: // . - # extract fields from quidfp - and r1, r0, #128 // r1 = r0 & 128 // sign - and r2, r0, #112 // r2 = r0 & 112 // exponent - and r3, r0, #15 // r3 = r0 & 15 // mantissa - - // ... - - # combine into r0 - orr r0, r1, r2 // r0 = r1 | r2 - orr r0, r0, r3 // r0 = r0 | r3 } - -end: // return r0 - - //===========================================================================// +//=================== YOUR CODE GOES HERE ===================// + +# logical operator demo (highlight.js arm comment test) +mov r0, #0x00F0 // r0 = 0x00F0 +mov r1, #0x000F // r1 = 0x000F +mov r2, #0xFF00 // r2 = 0xFF00 + + # and even more code, but indented + orr r3, r0, r1 // r3 = r0 | r1 // r3 = 0x00FF + and r4, r3, r2 // r4 = r3 & r2 // r4 = 0x0000 + orr r5, r3, r2 // r4 = r3 | r2 // r5 = 0xFFFF + eor r6, r5, r2 // r6 = r5 ^ r2 // r6 = 0x00FF +//===========================================================================// diff --git a/test/markup/armasm/default.txt b/test/markup/armasm/default.txt index 0e38d515fa..c6a951376f 100644 --- a/test/markup/armasm/default.txt +++ b/test/markup/armasm/default.txt @@ -1,24 +1,13 @@ - //=================== YOUR CODE GOES IN THE SECTION BELOW ===================// - - # check for and handle zero - orr r1, r0, #128 // r1 = r0 | 128 - cmp r1, #128 // if r1 == 128 { - bne notZero // . - bl zeroQuidFP2float // zeroQuidFP2float() } - b end // else { - -notZero: // . - # extract fields from quidfp - and r1, r0, #128 // r1 = r0 & 128 // sign - and r2, r0, #112 // r2 = r0 & 112 // exponent - and r3, r0, #15 // r3 = r0 & 15 // mantissa - - // ... - - # combine into r0 - orr r0, r1, r2 // r0 = r1 | r2 - orr r0, r0, r3 // r0 = r0 | r3 } - -end: // return r0 - - //===========================================================================// +//=================== YOUR CODE GOES HERE ===================// + +# logical operator demo (highlight.js arm comment test) +mov r0, #0x00F0 // r0 = 0x00F0 +mov r1, #0x000F // r1 = 0x000F +mov r2, #0xFF00 // r2 = 0xFF00 + + # and even more code, but indented + orr r3, r0, r1 // r3 = r0 | r1 // r3 = 0x00FF + and r4, r3, r2 // r4 = r3 & r2 // r4 = 0x0000 + orr r5, r3, r2 // r4 = r3 | r2 // r5 = 0xFFFF + eor r6, r5, r2 // r6 = r5 ^ r2 // r6 = 0x00FF +//===========================================================================// From 5dcc628e79704eddca5cdf42c75f0f568a2fdb7a Mon Sep 17 00:00:00 2001 From: Taufik Nurrohman Date: Sat, 22 Feb 2020 09:27:03 +0700 Subject: [PATCH 009/816] (chore) add `name` attribute to all language grammars (#2407) --- src/languages/1c.js | 1 + src/languages/abnf.js | 1 + src/languages/accesslog.js | 1 + src/languages/actionscript.js | 1 + src/languages/ada.js | 1 + src/languages/angelscript.js | 3 ++- src/languages/apache.js | 1 + src/languages/applescript.js | 1 + src/languages/arcade.js | 1 + src/languages/arduino.js | 2 ++ src/languages/armasm.js | 1 + src/languages/asciidoc.js | 1 + src/languages/aspectj.js | 1 + src/languages/autohotkey.js | 3 ++- src/languages/autoit.js | 1 + src/languages/avrasm.js | 1 + src/languages/awk.js | 5 +++-- src/languages/axapta.js | 1 + src/languages/bash.js | 1 + src/languages/basic.js | 1 + src/languages/bnf.js | 1 + src/languages/brainfuck.js | 1 + src/languages/c.js | 1 + src/languages/cal.js | 1 + src/languages/capnproto.js | 1 + src/languages/ceylon.js | 1 + src/languages/clean.js | 1 + src/languages/clojure-repl.js | 1 + src/languages/clojure.js | 1 + src/languages/cmake.js | 1 + src/languages/coffeescript.js | 1 + src/languages/coq.js | 1 + src/languages/cos.js | 1 + src/languages/cpp.js | 1 + src/languages/crmsh.js | 1 + src/languages/crystal.js | 1 + src/languages/csharp.js | 1 + src/languages/csp.js | 1 + src/languages/css.js | 1 + src/languages/d.js | 1 + src/languages/dart.js | 1 + src/languages/delphi.js | 1 + src/languages/diff.js | 1 + src/languages/django.js | 1 + src/languages/dns.js | 1 + src/languages/dockerfile.js | 1 + src/languages/dos.js | 1 + src/languages/dts.js | 1 + src/languages/dust.js | 1 + src/languages/ebnf.js | 1 + src/languages/elixir.js | 1 + src/languages/elm.js | 1 + src/languages/erb.js | 1 + src/languages/erlang-repl.js | 1 + src/languages/erlang.js | 1 + src/languages/excel.js | 1 + src/languages/fix.js | 1 + src/languages/flix.js | 1 + src/languages/fortran.js | 1 + src/languages/fsharp.js | 1 + src/languages/gams.js | 1 + src/languages/gauss.js | 1 + src/languages/gcode.js | 1 + src/languages/gherkin.js | 1 + src/languages/glsl.js | 1 + src/languages/gml.js | 1 + src/languages/go.js | 1 + src/languages/golo.js | 1 + src/languages/gradle.js | 1 + src/languages/groovy.js | 1 + src/languages/haml.js | 1 + src/languages/handlebars.js | 1 + src/languages/haskell.js | 1 + src/languages/haxe.js | 1 + src/languages/hsp.js | 1 + src/languages/htmlbars.js | 1 + src/languages/http.js | 1 + src/languages/hy.js | 1 + src/languages/inform7.js | 1 + src/languages/ini.js | 1 + src/languages/irpf90.js | 1 + src/languages/isbl.js | 1 + src/languages/java.js | 1 + src/languages/javascript.js | 1 + src/languages/jboss-cli.js | 1 + src/languages/json.js | 1 + src/languages/julia-repl.js | 1 + src/languages/julia.js | 1 + src/languages/kotlin.js | 1 + src/languages/lasso.js | 1 + src/languages/latex.js | 1 + src/languages/ldif.js | 1 + src/languages/leaf.js | 1 + src/languages/less.js | 1 + src/languages/lisp.js | 1 + src/languages/livecodeserver.js | 1 + src/languages/livescript.js | 1 + src/languages/llvm.js | 1 + src/languages/lsl.js | 1 + src/languages/lua.js | 1 + src/languages/makefile.js | 1 + src/languages/markdown.js | 1 + src/languages/mathematica.js | 1 + src/languages/matlab.js | 1 + src/languages/maxima.js | 1 + src/languages/mel.js | 1 + src/languages/mercury.js | 1 + src/languages/mipsasm.js | 1 + src/languages/mizar.js | 1 + src/languages/mojolicious.js | 1 + src/languages/monkey.js | 1 + src/languages/moonscript.js | 1 + src/languages/n1ql.js | 1 + src/languages/nginx.js | 1 + src/languages/nim.js | 1 + src/languages/nix.js | 1 + src/languages/nsis.js | 1 + src/languages/objectivec.js | 1 + src/languages/ocaml.js | 1 + src/languages/openscad.js | 1 + src/languages/oxygene.js | 1 + src/languages/parser3.js | 1 + src/languages/perl.js | 1 + src/languages/pf.js | 3 ++- src/languages/pgsql.js | 1 + src/languages/php.js | 2 +- src/languages/plaintext.js | 1 + src/languages/pony.js | 1 + src/languages/powershell.js | 1 + src/languages/processing.js | 1 + src/languages/profile.js | 1 + src/languages/prolog.js | 1 + src/languages/properties.js | 1 + src/languages/protobuf.js | 1 + src/languages/puppet.js | 1 + src/languages/purebasic.js | 1 + src/languages/python.js | 1 + src/languages/q.js | 1 + src/languages/qml.js | 1 + src/languages/r.js | 1 + src/languages/reasonml.js | 1 + src/languages/rib.js | 1 + src/languages/roboconf.js | 1 + src/languages/routeros.js | 1 + src/languages/rsl.js | 1 + src/languages/ruby.js | 1 + src/languages/ruleslanguage.js | 1 + src/languages/rust.js | 1 + src/languages/sas.js | 1 + src/languages/scala.js | 1 + src/languages/scheme.js | 1 + src/languages/scilab.js | 1 + src/languages/scss.js | 1 + src/languages/shell.js | 1 + src/languages/smali.js | 1 + src/languages/smalltalk.js | 1 + src/languages/sml.js | 1 + src/languages/sqf.js | 1 + src/languages/sql.js | 2 +- src/languages/stan.js | 1 + src/languages/stata.js | 1 + src/languages/step21.js | 1 + src/languages/stylus.js | 1 + src/languages/subunit.js | 1 + src/languages/swift.js | 1 + src/languages/taggerscript.js | 1 + src/languages/tap.js | 1 + src/languages/tcl.js | 1 + src/languages/thrift.js | 1 + src/languages/tp.js | 1 + src/languages/twig.js | 1 + src/languages/typescript.js | 1 + src/languages/vala.js | 1 + src/languages/vbnet.js | 1 + src/languages/vbscript-html.js | 1 + src/languages/vbscript.js | 1 + src/languages/verilog.js | 1 + src/languages/vhdl.js | 1 + src/languages/vim.js | 1 + src/languages/x86asm.js | 1 + src/languages/xl.js | 1 + src/languages/xml.js | 1 + src/languages/xquery.js | 1 + src/languages/yaml.js | 3 ++- src/languages/zephir.js | 1 + 185 files changed, 192 insertions(+), 8 deletions(-) diff --git a/src/languages/1c.js b/src/languages/1c.js index 43b72e15c6..7656f765a5 100644 --- a/src/languages/1c.js +++ b/src/languages/1c.js @@ -494,6 +494,7 @@ export default function(hljs){ }; return { + name: '1C:Enterprise', case_insensitive: true, lexemes: UNDERSCORE_IDENT_RE, keywords: { diff --git a/src/languages/abnf.js b/src/languages/abnf.js index e3b3a8f2bd..3b45dff974 100644 --- a/src/languages/abnf.js +++ b/src/languages/abnf.js @@ -57,6 +57,7 @@ export default function(hljs) { }; return { + name: 'Augmented Backus-Naur Form', illegal: regexes.unexpectedChars, keywords: keywords.join(" "), contains: [ diff --git a/src/languages/accesslog.js b/src/languages/accesslog.js index 22c794b3b8..8d26334647 100644 --- a/src/languages/accesslog.js +++ b/src/languages/accesslog.js @@ -11,6 +11,7 @@ export default function(hljs) { "GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "PATCH", "TRACE" ] return { + name: 'Apache Access Log', contains: [ // IP { diff --git a/src/languages/actionscript.js b/src/languages/actionscript.js index 9649399308..80e4f9b724 100644 --- a/src/languages/actionscript.js +++ b/src/languages/actionscript.js @@ -15,6 +15,7 @@ export default function(hljs) { }; return { + name: 'ActionScript', aliases: ['as'], keywords: { keyword: 'as break case catch class const continue default delete do dynamic each ' + diff --git a/src/languages/ada.js b/src/languages/ada.js index eeb7f17f27..f7757c47c5 100644 --- a/src/languages/ada.js +++ b/src/languages/ada.js @@ -74,6 +74,7 @@ export default function(hljs) { }; return { + name: 'Ada', case_insensitive: true, keywords: { keyword: diff --git a/src/languages/angelscript.js b/src/languages/angelscript.js index 07ec36bf3e..f192efa352 100644 --- a/src/languages/angelscript.js +++ b/src/languages/angelscript.js @@ -26,7 +26,8 @@ export default function(hljs) { objectHandleMode.contains = [ genericMode ]; return { - aliases: [ 'asc' ], + name: 'AngelScript', + aliases: ['asc'], keywords: 'for in|0 break continue while do|0 return if else case switch namespace is cast ' + diff --git a/src/languages/apache.js b/src/languages/apache.js index 591054e4d1..2ee76a6861 100644 --- a/src/languages/apache.js +++ b/src/languages/apache.js @@ -19,6 +19,7 @@ export default function(hljs) { begin: ":\\d{1,5}" }; return { + name: 'Apache config', aliases: ['apacheconf'], case_insensitive: true, contains: [ diff --git a/src/languages/applescript.js b/src/languages/applescript.js index 903233a932..0fd9cc71c5 100644 --- a/src/languages/applescript.js +++ b/src/languages/applescript.js @@ -27,6 +27,7 @@ export default function(hljs) { ]; return { + name: 'AppleScript', aliases: ['osascript'], keywords: { keyword: diff --git a/src/languages/arcade.js b/src/languages/arcade.js index 3e44c1c996..9485e20f91 100644 --- a/src/languages/arcade.js +++ b/src/languages/arcade.js @@ -66,6 +66,7 @@ export default function(hljs) { ]); return { + name: 'ArcGIS Arcade', aliases: ['arcade'], keywords: KEYWORDS, contains: [ diff --git a/src/languages/arduino.js b/src/languages/arduino.js index 73c0f9309a..a9063dcbe2 100644 --- a/src/languages/arduino.js +++ b/src/languages/arduino.js @@ -102,5 +102,7 @@ export default function(hljs) { kws.literal += ' ' + ARDUINO_KW.literal; kws.built_in += ' ' + ARDUINO_KW.built_in; + ARDUINO.name = 'Arduino'; + return ARDUINO; } diff --git a/src/languages/armasm.js b/src/languages/armasm.js index 0750b88b08..f7175f8835 100644 --- a/src/languages/armasm.js +++ b/src/languages/armasm.js @@ -18,6 +18,7 @@ export default function(hljs) { } return { + name: 'ARM Assembly', case_insensitive: true, aliases: ['arm'], lexemes: '\\.?' + hljs.IDENT_RE, diff --git a/src/languages/asciidoc.js b/src/languages/asciidoc.js index 42a9dfa8ea..84774a937f 100644 --- a/src/languages/asciidoc.js +++ b/src/languages/asciidoc.js @@ -9,6 +9,7 @@ Category: markup export default function(hljs) { return { + name: 'AsciiDoc', aliases: ['adoc'], contains: [ // block comment diff --git a/src/languages/aspectj.js b/src/languages/aspectj.js index d7874347a3..f12c3c8ecb 100644 --- a/src/languages/aspectj.js +++ b/src/languages/aspectj.js @@ -16,6 +16,7 @@ export default function (hljs) { 'warning error soft precedence thisAspectInstance'; var SHORTKEYS = 'get set args call'; return { + name: 'AspectJ', keywords : KEYWORDS, illegal : /<\/|#/, contains : [ diff --git a/src/languages/autohotkey.js b/src/languages/autohotkey.js index eca4806225..030715c6fd 100644 --- a/src/languages/autohotkey.js +++ b/src/languages/autohotkey.js @@ -11,8 +11,9 @@ export default function(hljs) { }; return { + name: 'AutoHotkey', case_insensitive: true, - aliases: [ 'ahk' ], + aliases: ['ahk'], keywords: { keyword: 'Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group', literal: 'true false NOT AND OR', diff --git a/src/languages/autoit.js b/src/languages/autoit.js index b8155cfc3c..8a6f05439e 100644 --- a/src/languages/autoit.js +++ b/src/languages/autoit.js @@ -122,6 +122,7 @@ export default function(hljs) { }; return { + name: 'AutoIt', case_insensitive: true, illegal: /\/\*/, keywords: { diff --git a/src/languages/avrasm.js b/src/languages/avrasm.js index fdc538cf71..da0c41506b 100644 --- a/src/languages/avrasm.js +++ b/src/languages/avrasm.js @@ -7,6 +7,7 @@ Website: https://www.microchip.com/webdoc/avrassembler/avrassembler.wb_instructi export default function(hljs) { return { + name: 'AVR Assembly', case_insensitive: true, lexemes: '\\.?' + hljs.IDENT_RE, keywords: { diff --git a/src/languages/awk.js b/src/languages/awk.js index 32dcf395bd..48ef1de47b 100644 --- a/src/languages/awk.js +++ b/src/languages/awk.js @@ -45,8 +45,9 @@ export default function(hljs) { ] }; return { - keywords: { - keyword: KEYWORDS + name: 'Awk', + keywords: { + keyword: KEYWORDS }, contains: [ VARIABLE, diff --git a/src/languages/axapta.js b/src/languages/axapta.js index 9e52ce7d84..5f4a3633ea 100644 --- a/src/languages/axapta.js +++ b/src/languages/axapta.js @@ -7,6 +7,7 @@ Category: enterprise export default function(hljs) { return { + name: 'Dynamics 365', keywords: 'false int abstract private char boolean static null if for true ' + 'while long throw finally protected final return void enum else ' + 'break new catch byte super case short default double public try this switch ' + diff --git a/src/languages/bash.js b/src/languages/bash.js index 0fc27a8ede..3d37ded159 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -38,6 +38,7 @@ export default function(hljs) { }; return { + name: 'Bash', aliases: ['sh', 'zsh'], lexemes: /\b-?[a-z\._]+\b/, keywords: { diff --git a/src/languages/basic.js b/src/languages/basic.js index b7810a99c4..412768219d 100644 --- a/src/languages/basic.js +++ b/src/languages/basic.js @@ -7,6 +7,7 @@ Website: https://en.wikipedia.org/wiki/Tandy_1000 export default function(hljs) { return { + name: 'BASIC', case_insensitive: true, illegal: '^\.', // Support explicitly typed variables that end with $%! or #. diff --git a/src/languages/bnf.js b/src/languages/bnf.js index a634993e6c..1b9baf4640 100644 --- a/src/languages/bnf.js +++ b/src/languages/bnf.js @@ -6,6 +6,7 @@ Author: Oleg Efimov export default function(hljs){ return { + name: 'Backus–Naur Form', contains: [ // Attribute { diff --git a/src/languages/brainfuck.js b/src/languages/brainfuck.js index 4d599b3ff6..2a9bb07b6d 100644 --- a/src/languages/brainfuck.js +++ b/src/languages/brainfuck.js @@ -11,6 +11,7 @@ export default function(hljs){ relevance: 0 }; return { + name: 'Brainfuck', aliases: ['bf'], contains: [ hljs.COMMENT( diff --git a/src/languages/c.js b/src/languages/c.js index a892943fc6..854c9da016 100644 --- a/src/languages/c.js +++ b/src/languages/c.js @@ -15,6 +15,7 @@ export default function(hljs) { // See further comments in c-like.js. // lang.disableAutodetect = false; + lang.name = 'C'; lang.aliases = ['c', 'h']; return lang; diff --git a/src/languages/cal.js b/src/languages/cal.js index 4df7930d02..bb00952506 100644 --- a/src/languages/cal.js +++ b/src/languages/cal.js @@ -72,6 +72,7 @@ export default function(hljs) { }; return { + name: 'C/AL', case_insensitive: true, keywords: { keyword: KEYWORDS, literal: LITERALS }, illegal: /\/\*/, diff --git a/src/languages/capnproto.js b/src/languages/capnproto.js index eaf3887f26..ecff298499 100644 --- a/src/languages/capnproto.js +++ b/src/languages/capnproto.js @@ -8,6 +8,7 @@ Category: protocols export default function(hljs) { return { + name: 'Cap’n Proto', aliases: ['capnp'], keywords: { keyword: diff --git a/src/languages/ceylon.js b/src/languages/ceylon.js index 98ff38a6c7..759309e7c6 100644 --- a/src/languages/ceylon.js +++ b/src/languages/ceylon.js @@ -53,6 +53,7 @@ export default function(hljs) { SUBST.contains = EXPRESSIONS; return { + name: 'Ceylon', keywords: { keyword: KEYWORDS + ' ' + DECLARATION_MODIFIERS, meta: DOCUMENTATION diff --git a/src/languages/clean.js b/src/languages/clean.js index e03da3218f..a7ee3d96d8 100644 --- a/src/languages/clean.js +++ b/src/languages/clean.js @@ -7,6 +7,7 @@ Website: http://clean.cs.ru.nl export default function(hljs) { return { + name: 'Clean', aliases: ['clean','icl','dcl'], keywords: { keyword: diff --git a/src/languages/clojure-repl.js b/src/languages/clojure-repl.js index 124c803a45..a0fae9a918 100644 --- a/src/languages/clojure-repl.js +++ b/src/languages/clojure-repl.js @@ -9,6 +9,7 @@ Category: lisp export default function(hljs) { return { + name: 'Clojure REPL', contains: [ { className: 'meta', diff --git a/src/languages/clojure.js b/src/languages/clojure.js index 7f89ddc7fc..d1e732ca0e 100644 --- a/src/languages/clojure.js +++ b/src/languages/clojure.js @@ -97,6 +97,7 @@ export default function(hljs) { HINT_COL.contains = [COLLECTION]; return { + name: 'Clojure', aliases: ['clj'], illegal: /\S/, contains: [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL] diff --git a/src/languages/cmake.js b/src/languages/cmake.js index e54b26fc32..6fb70f3262 100644 --- a/src/languages/cmake.js +++ b/src/languages/cmake.js @@ -7,6 +7,7 @@ Website: https://cmake.org export default function(hljs) { return { + name: 'CMake', aliases: ['cmake.in'], case_insensitive: true, keywords: { diff --git a/src/languages/coffeescript.js b/src/languages/coffeescript.js index 8b762e3fa7..0defcd5adb 100644 --- a/src/languages/coffeescript.js +++ b/src/languages/coffeescript.js @@ -104,6 +104,7 @@ export default function(hljs) { }; return { + name: 'CoffeeScript', aliases: ['coffee', 'cson', 'iced'], keywords: KEYWORDS, illegal: /\/\*/, diff --git a/src/languages/coq.js b/src/languages/coq.js index ea71543942..f8c2457bcc 100644 --- a/src/languages/coq.js +++ b/src/languages/coq.js @@ -7,6 +7,7 @@ Website: https://coq.inria.fr export default function(hljs) { return { + name: 'Coq', keywords: { keyword: '_|0 as at cofix else end exists exists2 fix for forall fun if IF in let ' + diff --git a/src/languages/cos.js b/src/languages/cos.js index 7588d4c77c..18f1c8692a 100644 --- a/src/languages/cos.js +++ b/src/languages/cos.js @@ -73,6 +73,7 @@ export default function cos (hljs) { //"$ztrap", "$zversion" return { + name: 'Caché Object Script', case_insensitive: true, aliases: ["cos", "cls"], keywords: COS_KEYWORDS, diff --git a/src/languages/cpp.js b/src/languages/cpp.js index 24d5662f0c..aa41288a14 100644 --- a/src/languages/cpp.js +++ b/src/languages/cpp.js @@ -10,6 +10,7 @@ export default function(hljs) { var lang = hljs.getLanguage('c-like').rawDefinition(); // return auto-detection back on lang.disableAutodetect = false; + lang.name = 'C++'; lang.aliases = ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx']; return lang; } diff --git a/src/languages/crmsh.js b/src/languages/crmsh.js index 8e57706272..72165d1d12 100644 --- a/src/languages/crmsh.js +++ b/src/languages/crmsh.js @@ -26,6 +26,7 @@ export default function(hljs) { var LITERALS = 'Master Started Slave Stopped start promote demote stop monitor true false'; return { + name: 'crmsh', aliases: ['crm', 'pcmk'], case_insensitive: true, keywords: { diff --git a/src/languages/crystal.js b/src/languages/crystal.js index 5aeb12f0fb..58beb328e8 100644 --- a/src/languages/crystal.js +++ b/src/languages/crystal.js @@ -185,6 +185,7 @@ export default function(hljs) { EXPANSION.contains = CRYSTAL_DEFAULT_CONTAINS.slice(1); // without EXPANSION return { + name: 'Crystal', aliases: ['cr'], lexemes: CRYSTAL_IDENT_RE, keywords: CRYSTAL_KEYWORDS, diff --git a/src/languages/csharp.js b/src/languages/csharp.js index 9eaaa44091..b7ad270edd 100644 --- a/src/languages/csharp.js +++ b/src/languages/csharp.js @@ -95,6 +95,7 @@ export default function(hljs) { var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '(\\s*,\\s*' + hljs.IDENT_RE + ')*>)?(\\[\\])?'; return { + name: 'C#', aliases: ['cs', 'c#'], keywords: KEYWORDS, illegal: /::/, diff --git a/src/languages/csp.js b/src/languages/csp.js index 2672cbe1ae..849249ac9c 100644 --- a/src/languages/csp.js +++ b/src/languages/csp.js @@ -9,6 +9,7 @@ vim: ts=2 sw=2 st=2 export default function(hljs) { return { + name: 'CSP', case_insensitive: false, lexemes: '[a-zA-Z][a-zA-Z0-9_-]*', keywords: { diff --git a/src/languages/css.js b/src/languages/css.js index d7d560e62b..85e3dc1222 100644 --- a/src/languages/css.js +++ b/src/languages/css.js @@ -55,6 +55,7 @@ export default function(hljs) { }; return { + name: 'CSS', case_insensitive: true, illegal: /[=\/|'\$]/, contains: [ diff --git a/src/languages/d.js b/src/languages/d.js index 363d08bf12..9d6e482614 100644 --- a/src/languages/d.js +++ b/src/languages/d.js @@ -244,6 +244,7 @@ export default function(hljs) { ); return { + name: 'D', lexemes: hljs.UNDERSCORE_IDENT_RE, keywords: D_KEYWORDS, contains: [ diff --git a/src/languages/dart.js b/src/languages/dart.js index 58a71d4756..c7101b0643 100644 --- a/src/languages/dart.js +++ b/src/languages/dart.js @@ -86,6 +86,7 @@ export default function(hljs) { }; return { + name: 'Dart', keywords: KEYWORDS, contains: [ STRING, diff --git a/src/languages/delphi.js b/src/languages/delphi.js index f1845251b5..b72d3bc2d2 100644 --- a/src/languages/delphi.js +++ b/src/languages/delphi.js @@ -77,6 +77,7 @@ export default function(hljs) { ].concat(COMMENT_MODES) }; return { + name: 'Delphi', aliases: ['dpr', 'dfm', 'pas', 'pascal', 'freepascal', 'lazarus', 'lpr', 'lfm'], case_insensitive: true, keywords: KEYWORDS, diff --git a/src/languages/diff.js b/src/languages/diff.js index 806c84bc33..213ff264ce 100644 --- a/src/languages/diff.js +++ b/src/languages/diff.js @@ -8,6 +8,7 @@ Category: common export default function(hljs) { return { + name: 'Diff', aliases: ['patch'], contains: [ { diff --git a/src/languages/django.js b/src/languages/django.js index 4359a7a570..bf74f7e7c2 100644 --- a/src/languages/django.js +++ b/src/languages/django.js @@ -29,6 +29,7 @@ export default function(hljs) { }; return { + name: 'Django', aliases: ['jinja'], case_insensitive: true, subLanguage: 'xml', diff --git a/src/languages/dns.js b/src/languages/dns.js index 54f87bfb77..0092c07c60 100644 --- a/src/languages/dns.js +++ b/src/languages/dns.js @@ -7,6 +7,7 @@ Website: https://en.wikipedia.org/wiki/Zone_file export default function(hljs) { return { + name: 'DNS Zone', aliases: ['bind', 'zone'], keywords: { keyword: diff --git a/src/languages/dockerfile.js b/src/languages/dockerfile.js index c7d25b6c2e..a156e3022d 100644 --- a/src/languages/dockerfile.js +++ b/src/languages/dockerfile.js @@ -9,6 +9,7 @@ Category: config export default function(hljs) { return { + name: 'Dockerfile', aliases: ['docker'], case_insensitive: true, keywords: 'from maintainer expose env arg user onbuild stopsignal', diff --git a/src/languages/dos.js b/src/languages/dos.js index 5893ae879a..e6b5295190 100644 --- a/src/languages/dos.js +++ b/src/languages/dos.js @@ -18,6 +18,7 @@ export default function(hljs) { relevance: 0 }; return { + name: 'Batch file (DOS)', aliases: ['bat', 'cmd'], case_insensitive: true, illegal: /\/\*/, diff --git a/src/languages/dts.js b/src/languages/dts.js index 8898247242..5e5a241d6e 100644 --- a/src/languages/dts.js +++ b/src/languages/dts.js @@ -109,6 +109,7 @@ export default function(hljs) { }; return { + name: 'Device Tree', keywords: "", contains: [ DTS_ROOT_NODE, diff --git a/src/languages/dust.js b/src/languages/dust.js index 416f07747e..4765a57f6b 100644 --- a/src/languages/dust.js +++ b/src/languages/dust.js @@ -10,6 +10,7 @@ Category: template export default function(hljs) { var EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep'; return { + name: 'Dust', aliases: ['dst'], case_insensitive: true, subLanguage: 'xml', diff --git a/src/languages/ebnf.js b/src/languages/ebnf.js index b2d3f5a95a..bb76cb349c 100644 --- a/src/languages/ebnf.js +++ b/src/languages/ebnf.js @@ -35,6 +35,7 @@ export default function(hljs) { }; return { + name: 'Extended Backus-Naur Form', illegal: /\S/, contains: [ commentMode, diff --git a/src/languages/elixir.js b/src/languages/elixir.js index 998fa745a1..e78767d6d2 100644 --- a/src/languages/elixir.js +++ b/src/languages/elixir.js @@ -173,6 +173,7 @@ export default function(hljs) { SUBST.contains = ELIXIR_DEFAULT_CONTAINS; return { + name: 'Elixir', lexemes: ELIXIR_IDENT_RE, keywords: ELIXIR_KEYWORDS, contains: ELIXIR_DEFAULT_CONTAINS diff --git a/src/languages/elm.js b/src/languages/elm.js index 7b70e3ffec..85310a6672 100644 --- a/src/languages/elm.js +++ b/src/languages/elm.js @@ -46,6 +46,7 @@ export default function(hljs) { }; return { + name: 'Elm', keywords: 'let in if then else case of where module import exposing ' + 'type alias as infix infixl infixr port effect command subscription', diff --git a/src/languages/erb.js b/src/languages/erb.js index 7197b9cb0a..297ca15666 100644 --- a/src/languages/erb.js +++ b/src/languages/erb.js @@ -10,6 +10,7 @@ Category: template export default function(hljs) { return { + name: 'ERB', subLanguage: 'xml', contains: [ hljs.COMMENT('<%#', '%>'), diff --git a/src/languages/erlang-repl.js b/src/languages/erlang-repl.js index d471565de1..6ba6e0ed49 100644 --- a/src/languages/erlang-repl.js +++ b/src/languages/erlang-repl.js @@ -7,6 +7,7 @@ Category: functional export default function(hljs) { return { + name: 'Erlang REPL', keywords: { built_in: 'spawn spawn_link self', diff --git a/src/languages/erlang.js b/src/languages/erlang.js index 940b631565..e289bce1fd 100644 --- a/src/languages/erlang.js +++ b/src/languages/erlang.js @@ -110,6 +110,7 @@ export default function(hljs) { contains: BASIC_MODES }; return { + name: 'Erlang', aliases: ['erl'], keywords: ERLANG_RESERVED, illegal: '( export default function(hljs) { return { + name: 'FIX', contains: [ { begin: /[^\u2401\u0001]+/, diff --git a/src/languages/flix.js b/src/languages/flix.js index bc254e66fa..a1ae6d286a 100644 --- a/src/languages/flix.js +++ b/src/languages/flix.js @@ -35,6 +35,7 @@ export default function (hljs) { }; return { + name: 'Flix', keywords: { literal: 'true false', keyword: 'case class def else enum if impl import in lat rel index let match namespace switch type yield with' diff --git a/src/languages/fortran.js b/src/languages/fortran.js index cbe33fe642..79de28a675 100644 --- a/src/languages/fortran.js +++ b/src/languages/fortran.js @@ -53,6 +53,7 @@ export default function(hljs) { 'num_images parity popcnt poppar shifta shiftl shiftr this_image sync change team co_broadcast co_max co_min co_sum co_reduce' }; return { + name: 'Fortran', case_insensitive: true, aliases: ['f90', 'f95'], keywords: F_KEYWORDS, diff --git a/src/languages/fsharp.js b/src/languages/fsharp.js index f0c9b7451a..828a55ec88 100644 --- a/src/languages/fsharp.js +++ b/src/languages/fsharp.js @@ -14,6 +14,7 @@ export default function(hljs) { }; return { + name: 'F#', aliases: ['fs'], keywords: 'abstract and as assert base begin class default delegate do done ' + diff --git a/src/languages/gams.js b/src/languages/gams.js index d137d1a2be..597cbb8040 100644 --- a/src/languages/gams.js +++ b/src/languages/gams.js @@ -85,6 +85,7 @@ export default function (hljs) { }; return { + name: 'GAMS', aliases: ['gms'], case_insensitive: true, keywords: KEYWORDS, diff --git a/src/languages/gauss.js b/src/languages/gauss.js index 6e3780f9f4..391bab0a37 100644 --- a/src/languages/gauss.js +++ b/src/languages/gauss.js @@ -254,6 +254,7 @@ export default function(hljs) { FUNCTION_REF.contains.push(FUNCTION_REF_PARAMS); return { + name: 'GAUSS', aliases: ['gss'], case_insensitive: true, // language is case-insensitive keywords: KEYWORDS, diff --git a/src/languages/gcode.js b/src/languages/gcode.js index a724ab7b06..abf8cff9eb 100644 --- a/src/languages/gcode.js +++ b/src/languages/gcode.js @@ -56,6 +56,7 @@ export default function(hljs) { ]; return { + name: 'G-code (ISO 6983)', aliases: ['nc'], // Some implementations (CNC controls) of G-code are interoperable with uppercase and lowercase letters seamlessly. // However, most prefer all uppercase and uppercase is customary. diff --git a/src/languages/gherkin.js b/src/languages/gherkin.js index c6d89cb97d..9de8b11472 100644 --- a/src/languages/gherkin.js +++ b/src/languages/gherkin.js @@ -7,6 +7,7 @@ export default function (hljs) { return { + name: 'Gherkin', aliases: ['feature'], keywords: 'Feature Background Ability Business\ Need Scenario Scenarios Scenario\ Outline Scenario\ Template Examples Given And Then But When', contains: [ diff --git a/src/languages/glsl.js b/src/languages/glsl.js index 406f06fca4..3d291ccacb 100644 --- a/src/languages/glsl.js +++ b/src/languages/glsl.js @@ -8,6 +8,7 @@ Category: graphics export default function(hljs) { return { + name: 'GLSL', keywords: { keyword: // Statements diff --git a/src/languages/gml.js b/src/languages/gml.js index 32a040c440..1042d2b1da 100644 --- a/src/languages/gml.js +++ b/src/languages/gml.js @@ -865,6 +865,7 @@ export default function(hljs) { }; return { + name: 'GML', aliases: ['gml', 'GML'], case_insensitive: false, // language is case-insensitive keywords: GML_KEYWORDS, diff --git a/src/languages/go.js b/src/languages/go.js index 96adc48b7a..7244a662f8 100644 --- a/src/languages/go.js +++ b/src/languages/go.js @@ -20,6 +20,7 @@ export default function(hljs) { 'append cap close complex copy imag len make new panic print println real recover delete' }; return { + name: 'Go', aliases: ['golang'], keywords: GO_KEYWORDS, illegal: ' export default function(hljs) { return { + name: 'Gradle', case_insensitive: true, keywords: { keyword: diff --git a/src/languages/groovy.js b/src/languages/groovy.js index 0e1b635de8..8dfb00767f 100644 --- a/src/languages/groovy.js +++ b/src/languages/groovy.js @@ -7,6 +7,7 @@ export default function(hljs) { return { + name: 'Groovy', keywords: { literal : 'true false null', keyword: diff --git a/src/languages/haml.js b/src/languages/haml.js index 153c239c13..62e3eaabc4 100644 --- a/src/languages/haml.js +++ b/src/languages/haml.js @@ -9,6 +9,7 @@ Category: template // TODO support filter tags like :javascript, support inline HTML export default function(hljs) { return { + name: 'HAML', case_insensitive: true, contains: [ { diff --git a/src/languages/handlebars.js b/src/languages/handlebars.js index 5845260558..7fea1c3cca 100644 --- a/src/languages/handlebars.js +++ b/src/languages/handlebars.js @@ -37,6 +37,7 @@ export default function(hljs) { var PREVENT_ESCAPE_WITH_ANOTHER_PRECEEDING_BACKSLASH = {begin: /\\\\(?=\{\{)/, skip: true}; return { + name: 'Handlebars', aliases: ['hbs', 'html.hbs', 'html.handlebars'], case_insensitive: true, subLanguage: 'xml', diff --git a/src/languages/haskell.js b/src/languages/haskell.js index 9142697381..a59f3a996f 100644 --- a/src/languages/haskell.js +++ b/src/languages/haskell.js @@ -54,6 +54,7 @@ export default function(hljs) { }; return { + name: 'Haskell', aliases: ['hs'], keywords: 'let in if then else case of where do module import hiding ' + diff --git a/src/languages/haxe.js b/src/languages/haxe.js index f51603919d..355e051e64 100644 --- a/src/languages/haxe.js +++ b/src/languages/haxe.js @@ -13,6 +13,7 @@ export default function(hljs) { var HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array '; return { + name: 'Haxe', aliases: ['hx'], keywords: { keyword: 'break case cast catch continue default do dynamic else enum extern ' + diff --git a/src/languages/hsp.js b/src/languages/hsp.js index 59b778c8f0..b9477d7e74 100644 --- a/src/languages/hsp.js +++ b/src/languages/hsp.js @@ -7,6 +7,7 @@ Category: scripting export default function(hljs) { return { + name: 'HSP', 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', diff --git a/src/languages/htmlbars.js b/src/languages/htmlbars.js index d08736be32..49adc1561a 100644 --- a/src/languages/htmlbars.js +++ b/src/languages/htmlbars.js @@ -50,6 +50,7 @@ export default function(hljs) { }; return { + name: 'HTMLBars', case_insensitive: true, subLanguage: 'xml', contains: [ diff --git a/src/languages/http.js b/src/languages/http.js index 8edd0bb450..1c6b242e95 100644 --- a/src/languages/http.js +++ b/src/languages/http.js @@ -9,6 +9,7 @@ Website: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview export default function(hljs) { var VERSION = 'HTTP/[0-9\\.]+'; return { + name: 'HTTP', aliases: ['https'], illegal: '\\S', contains: [ diff --git a/src/languages/hy.js b/src/languages/hy.js index ee46e58fc1..4faa8780f8 100644 --- a/src/languages/hy.js +++ b/src/languages/hy.js @@ -102,6 +102,7 @@ export default function(hljs) { COLLECTION.contains = DEFAULT_CONTAINS; return { + name: 'Hy', aliases: ['hylang'], illegal: /\S/, contains: [SHEBANG, LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL] diff --git a/src/languages/inform7.js b/src/languages/inform7.js index 696240961a..f1c14646b1 100644 --- a/src/languages/inform7.js +++ b/src/languages/inform7.js @@ -9,6 +9,7 @@ export default function(hljs) { var START_BRACKET = '\\['; var END_BRACKET = '\\]'; return { + name: 'Inform 7', aliases: ['i7'], case_insensitive: true, keywords: { diff --git a/src/languages/ini.js b/src/languages/ini.js index 76d7641042..73c19409b2 100644 --- a/src/languages/ini.js +++ b/src/languages/ini.js @@ -55,6 +55,7 @@ export default function(hljs) { }; return { + name: 'TOML, also INI', aliases: ['toml'], case_insensitive: true, illegal: /\S/, diff --git a/src/languages/irpf90.js b/src/languages/irpf90.js index ab19604a8e..614459c06c 100644 --- a/src/languages/irpf90.js +++ b/src/languages/irpf90.js @@ -59,6 +59,7 @@ export default function(hljs) { 'IRP_ALIGN irp_here' }; return { + name: 'IRPF90', case_insensitive: true, keywords: F_KEYWORDS, illegal: /\/\*/, diff --git a/src/languages/isbl.js b/src/languages/isbl.js index 9d57d8ee30..8e630221b9 100644 --- a/src/languages/isbl.js +++ b/src/languages/isbl.js @@ -3161,6 +3161,7 @@ export default function(hljs) { }; return { + name: 'ISBL', aliases: ["isbl"], case_insensitive: true, lexemes: UNDERSCORE_IDENT_RE, diff --git a/src/languages/java.js b/src/languages/java.js index f5c48cfb98..f349a76ad0 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -48,6 +48,7 @@ export default function(hljs) { }; return { + name: 'Java', aliases: ['jsp'], keywords: KEYWORDS, illegal: /<\/|#/, diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 7cf8a0d532..7ff30465b6 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -95,6 +95,7 @@ export default function(hljs) { ]); return { + name: 'JavaScript', aliases: ['js', 'jsx', 'mjs', 'cjs'], keywords: KEYWORDS, contains: [ diff --git a/src/languages/jboss-cli.js b/src/languages/jboss-cli.js index 5d578d3daf..7328c4d49f 100644 --- a/src/languages/jboss-cli.js +++ b/src/languages/jboss-cli.js @@ -33,6 +33,7 @@ export default function (hljs) { begin: /--[\w\-=\/]+/, }; return { + name: 'JBoss CLI', aliases: ['wildfly-cli'], lexemes: '[a-z\-]+', keywords: { diff --git a/src/languages/json.js b/src/languages/json.js index 546c43e228..34bded9298 100644 --- a/src/languages/json.js +++ b/src/languages/json.js @@ -44,6 +44,7 @@ export default function(hljs) { TYPES.push(rule) }) return { + name: 'JSON', contains: TYPES, keywords: LITERALS, illegal: '\\S' diff --git a/src/languages/julia-repl.js b/src/languages/julia-repl.js index 7d28dd16df..6772b86641 100644 --- a/src/languages/julia-repl.js +++ b/src/languages/julia-repl.js @@ -24,6 +24,7 @@ also prints out six spaces, but such cases should be rare. export default function(hljs) { return { + name: 'Julia REPL', contains: [ { className: 'meta', diff --git a/src/languages/julia.js b/src/languages/julia.js index aa9a73c1a4..ec40e0d9ab 100644 --- a/src/languages/julia.js +++ b/src/languages/julia.js @@ -148,6 +148,7 @@ export default function(hljs) { ] }; + DEFAULT.name = 'Julia'; DEFAULT.contains = [ NUMBER, CHAR, diff --git a/src/languages/kotlin.js b/src/languages/kotlin.js index bbd8ed3560..f1d368c020 100644 --- a/src/languages/kotlin.js +++ b/src/languages/kotlin.js @@ -126,6 +126,7 @@ export default function(hljs) { KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ]; return { + name: 'Kotlin', aliases: ['kt'], keywords: KEYWORDS, contains : [ diff --git a/src/languages/lasso.js b/src/languages/lasso.js index 12dc224ea2..24cc5a93ba 100644 --- a/src/languages/lasso.js +++ b/src/languages/lasso.js @@ -113,6 +113,7 @@ export default function(hljs) { } ]; return { + name: 'Lasso', aliases: ['ls', 'lassoscript'], case_insensitive: true, lexemes: LASSO_IDENT_RE + '|&[lg]t;', diff --git a/src/languages/latex.js b/src/languages/latex.js index db64634c5a..7dee6baac9 100644 --- a/src/languages/latex.js +++ b/src/languages/latex.js @@ -45,6 +45,7 @@ export default function(hljs) { }; return { + name: 'LaTeX', aliases: ['tex'], contains: [ COMMAND, diff --git a/src/languages/ldif.js b/src/languages/ldif.js index 90aaaea898..fac612aa05 100644 --- a/src/languages/ldif.js +++ b/src/languages/ldif.js @@ -6,6 +6,7 @@ Website: https://en.wikipedia.org/wiki/LDAP_Data_Interchange_Format */ export default function(hljs) { return { + name: 'LDIF', contains: [ { className: 'attribute', diff --git a/src/languages/leaf.js b/src/languages/leaf.js index 2f66700d94..937e3122d2 100644 --- a/src/languages/leaf.js +++ b/src/languages/leaf.js @@ -6,6 +6,7 @@ Description: Based on the Leaf reference from https://vapor.github.io/documentat export default function (hljs) { return { + name: 'Leaf', contains: [ { className: 'function', diff --git a/src/languages/less.js b/src/languages/less.js index da270929dc..00c2617aab 100644 --- a/src/languages/less.js +++ b/src/languages/less.js @@ -140,6 +140,7 @@ export default function(hljs) { ); return { + name: 'Less', case_insensitive: true, illegal: '[=>\'/<($"]', contains: RULES diff --git a/src/languages/lisp.js b/src/languages/lisp.js index f5abd52fcc..c8305f6bea 100644 --- a/src/languages/lisp.js +++ b/src/languages/lisp.js @@ -93,6 +93,7 @@ export default function(hljs) { BODY.contains = [QUOTED, QUOTED_ATOM, LIST, LITERAL, NUMBER, STRING, COMMENT, VARIABLE, KEYWORD, MEC, IDENT]; return { + name: 'Lisp', illegal: /\S/, contains: [ NUMBER, diff --git a/src/languages/livecodeserver.js b/src/languages/livecodeserver.js index 10f1a0210d..ff5641c4d1 100644 --- a/src/languages/livecodeserver.js +++ b/src/languages/livecodeserver.js @@ -30,6 +30,7 @@ export default function(hljs) { }); var TITLE2 = hljs.inherit(hljs.TITLE_MODE, {begin: '\\b([A-Za-z0-9_\\-]+)\\b'}); return { + name: 'LiveCode', case_insensitive: false, keywords: { keyword: diff --git a/src/languages/livescript.js b/src/languages/livescript.js index 4c4cf0d5f3..17e6ab057d 100644 --- a/src/languages/livescript.js +++ b/src/languages/livescript.js @@ -115,6 +115,7 @@ export default function(hljs) { }; return { + name: 'LiveScript', aliases: ['ls'], keywords: KEYWORDS, illegal: /\/\*/, diff --git a/src/languages/llvm.js b/src/languages/llvm.js index dc5d244818..a014f24fb9 100644 --- a/src/languages/llvm.js +++ b/src/languages/llvm.js @@ -9,6 +9,7 @@ Category: assembler export default function(hljs) { var identifier = '([-a-zA-Z$._][\\w\\-$.]*)'; return { + name: 'LLVM IR', //lexemes: '[.%]?' + hljs.IDENT_RE, keywords: 'begin end true false declare define global ' + diff --git a/src/languages/lsl.js b/src/languages/lsl.js index 19a24cdebe..ebab6c1221 100644 --- a/src/languages/lsl.js +++ b/src/languages/lsl.js @@ -57,6 +57,7 @@ export default function(hljs) { }; return { + name: 'LSL (Linden Scripting Language)', illegal: ':', contains: [ LSL_STRINGS, diff --git a/src/languages/lua.js b/src/languages/lua.js index 01a0998994..76c88b59f6 100644 --- a/src/languages/lua.js +++ b/src/languages/lua.js @@ -25,6 +25,7 @@ export default function(hljs) { ) ]; return { + name: 'Lua', lexemes: hljs.UNDERSCORE_IDENT_RE, keywords: { literal: "true false nil", diff --git a/src/languages/makefile.js b/src/languages/makefile.js index 399e1e8f49..3d7abbadef 100644 --- a/src/languages/makefile.js +++ b/src/languages/makefile.js @@ -62,6 +62,7 @@ export default function(hljs) { contains: [VARIABLE,] }; return { + name: 'Makefile', aliases: ['mk', 'mak'], keywords: 'define endef undefine ifdef ifndef ifeq ifneq else endif ' + diff --git a/src/languages/markdown.js b/src/languages/markdown.js index c270c7ed4d..f5b75ef139 100644 --- a/src/languages/markdown.js +++ b/src/languages/markdown.js @@ -137,6 +137,7 @@ export default function(hljs) { }; return { + name: 'Markdown', aliases: ['md', 'mkdown', 'mkd'], contains: [ HEADER, diff --git a/src/languages/mathematica.js b/src/languages/mathematica.js index 2411014547..aaae802984 100644 --- a/src/languages/mathematica.js +++ b/src/languages/mathematica.js @@ -8,6 +8,7 @@ Category: scientific export default function(hljs) { return { + name: 'Mathematica', aliases: ['mma', 'wl'], lexemes: '(\\$|\\b)' + hljs.IDENT_RE + '\\b', // diff --git a/src/languages/matlab.js b/src/languages/matlab.js index 9ab0995e35..a3d0cde8b0 100644 --- a/src/languages/matlab.js +++ b/src/languages/matlab.js @@ -21,6 +21,7 @@ export default function(hljs) { }; return { + name: 'Matlab', keywords: { keyword: 'break case catch classdef continue else elseif end enumerated events for function ' + diff --git a/src/languages/maxima.js b/src/languages/maxima.js index edc7d54fc6..d48e2933b1 100644 --- a/src/languages/maxima.js +++ b/src/languages/maxima.js @@ -365,6 +365,7 @@ export default function(hljs) { var SYMBOLS = '_ __ %|0 %%|0'; return { + name: 'Maxima', lexemes: '[A-Za-z_%][0-9A-Za-z_%]*', keywords: { keyword: KEYWORDS, diff --git a/src/languages/mel.js b/src/languages/mel.js index 7b40d53d0f..326557a25f 100644 --- a/src/languages/mel.js +++ b/src/languages/mel.js @@ -8,6 +8,7 @@ Category: graphics export default function(hljs) { return { + name: 'MEL', keywords: 'int float string vector matrix if else switch case default while do for in break ' + 'continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic ' + diff --git a/src/languages/mercury.js b/src/languages/mercury.js index 918ac3910f..eeab89f5e6 100644 --- a/src/languages/mercury.js +++ b/src/languages/mercury.js @@ -72,6 +72,7 @@ export default function(hljs) { }; return { + name: 'Mercury', aliases: ['m', 'moo'], keywords: KEYWORDS, contains: [ diff --git a/src/languages/mipsasm.js b/src/languages/mipsasm.js index 20c37ec442..b1fc6ff34b 100644 --- a/src/languages/mipsasm.js +++ b/src/languages/mipsasm.js @@ -9,6 +9,7 @@ Category: assembler export default function(hljs) { //local labels: %?[FB]?[AT]?\d{1,2}\w+ return { + name: 'MIPS Assembly', case_insensitive: true, aliases: ['mips'], lexemes: '\\.?' + hljs.IDENT_RE, diff --git a/src/languages/mizar.js b/src/languages/mizar.js index f578ac10e3..b3acf2480e 100644 --- a/src/languages/mizar.js +++ b/src/languages/mizar.js @@ -8,6 +8,7 @@ Category: scientific export default function(hljs) { return { + name: 'Mizar', keywords: 'environ vocabularies notations constructors definitions ' + 'registrations theorems schemes requirements begin end definition ' + diff --git a/src/languages/mojolicious.js b/src/languages/mojolicious.js index 589bc92ce3..6ead3a629d 100644 --- a/src/languages/mojolicious.js +++ b/src/languages/mojolicious.js @@ -8,6 +8,7 @@ Category: template */ export default function(hljs) { return { + name: 'Mojolicious', subLanguage: 'xml', contains: [ { diff --git a/src/languages/monkey.js b/src/languages/monkey.js index 29bf67c694..713d4f6102 100644 --- a/src/languages/monkey.js +++ b/src/languages/monkey.js @@ -17,6 +17,7 @@ export default function(hljs) { }; return { + name: 'Monkey', case_insensitive: true, keywords: { keyword: 'public private property continue exit extern new try catch ' + diff --git a/src/languages/moonscript.js b/src/languages/moonscript.js index f9a1f2211b..92007499a1 100644 --- a/src/languages/moonscript.js +++ b/src/languages/moonscript.js @@ -71,6 +71,7 @@ export default function(hljs) { }; return { + name: 'MoonScript', aliases: ['moon'], keywords: KEYWORDS, illegal: /\/\*/, diff --git a/src/languages/n1ql.js b/src/languages/n1ql.js index fc61f8a631..3e8bc716a5 100644 --- a/src/languages/n1ql.js +++ b/src/languages/n1ql.js @@ -8,6 +8,7 @@ export default function(hljs) { return { + name: 'N1QL', case_insensitive: true, contains: [ { diff --git a/src/languages/nginx.js b/src/languages/nginx.js index eee5ce50e7..2dc2a3e09c 100644 --- a/src/languages/nginx.js +++ b/src/languages/nginx.js @@ -69,6 +69,7 @@ export default function(hljs) { }; return { + name: 'Nginx config', aliases: ['nginxconf'], contains: [ hljs.HASH_COMMENT_MODE, diff --git a/src/languages/nim.js b/src/languages/nim.js index aa2ee8a143..a294294e06 100644 --- a/src/languages/nim.js +++ b/src/languages/nim.js @@ -7,6 +7,7 @@ Category: system export default function(hljs) { return { + name: 'Nim', aliases: ['nim'], keywords: { keyword: diff --git a/src/languages/nix.js b/src/languages/nix.js index 0b9ec66f73..92ff218cf5 100644 --- a/src/languages/nix.js +++ b/src/languages/nix.js @@ -49,6 +49,7 @@ export default function(hljs) { ]; ANTIQUOTE.contains = EXPRESSIONS; return { + name: 'Nix', aliases: ["nixos"], keywords: NIX_KEYWORDS, contains: EXPRESSIONS diff --git a/src/languages/nsis.js b/src/languages/nsis.js index 44cac0c1eb..1b1b7aa637 100644 --- a/src/languages/nsis.js +++ b/src/languages/nsis.js @@ -78,6 +78,7 @@ export default function(hljs) { }; return { + name: 'NSIS', case_insensitive: false, keywords: { keyword: diff --git a/src/languages/objectivec.js b/src/languages/objectivec.js index 7bb2afce68..de95dbf2ff 100644 --- a/src/languages/objectivec.js +++ b/src/languages/objectivec.js @@ -43,6 +43,7 @@ export default function(hljs) { var LEXEMES = /[a-zA-Z@][a-zA-Z0-9_]*/; var CLASS_KEYWORDS = '@interface @class @protocol @implementation'; return { + name: 'Objective-C', aliases: ['mm', 'objc', 'obj-c'], keywords: OBJC_KEYWORDS, lexemes: LEXEMES, diff --git a/src/languages/ocaml.js b/src/languages/ocaml.js index 5fceaa25c5..64cafac365 100644 --- a/src/languages/ocaml.js +++ b/src/languages/ocaml.js @@ -10,6 +10,7 @@ Category: functional export default function(hljs) { /* missing support for heredoc-like string (OCaml 4.0.2+) */ return { + name: 'OCaml', aliases: ['ml'], keywords: { keyword: diff --git a/src/languages/openscad.js b/src/languages/openscad.js index 945d15a440..b1ad4abf44 100644 --- a/src/languages/openscad.js +++ b/src/languages/openscad.js @@ -44,6 +44,7 @@ export default function(hljs) { }; return { + name: 'OpenSCAD', aliases: ['scad'], keywords: { keyword: 'function module include use for intersection_for if else \\%', diff --git a/src/languages/oxygene.js b/src/languages/oxygene.js index 751e13054d..b392371f37 100644 --- a/src/languages/oxygene.js +++ b/src/languages/oxygene.js @@ -52,6 +52,7 @@ export default function(hljs) { ] }; return { + name: 'Oxygene', case_insensitive: true, lexemes: /\.?\w+/, keywords: OXYGENE_KEYWORDS, diff --git a/src/languages/parser3.js b/src/languages/parser3.js index a70cb5ddb4..5810bbd361 100644 --- a/src/languages/parser3.js +++ b/src/languages/parser3.js @@ -15,6 +15,7 @@ export default function(hljs) { } ); return { + name: 'Parser3', subLanguage: 'xml', relevance: 0, contains: [ hljs.COMMENT('^#', '$'), diff --git a/src/languages/perl.js b/src/languages/perl.js index aecace4007..1d2af34d7c 100644 --- a/src/languages/perl.js +++ b/src/languages/perl.js @@ -155,6 +155,7 @@ export default function(hljs) { METHOD.contains = PERL_DEFAULT_CONTAINS; return { + name: 'Perl', aliases: ['pl', 'pm'], lexemes: /[\w\.]+/, keywords: PERL_KEYWORDS, diff --git a/src/languages/pf.js b/src/languages/pf.js index 3d2457df2f..ccf522989e 100644 --- a/src/languages/pf.js +++ b/src/languages/pf.js @@ -1,5 +1,5 @@ /* -Language: packet filter config +Language: Packet Filter config Description: pf.conf — packet filter configuration file (OpenBSD) Author: Peter Piwowarski Website: http://man.openbsd.org/pf.conf @@ -21,6 +21,7 @@ export default function(hljs) { }; return { + name: 'Packet Filter config', aliases: ['pf.conf'], lexemes: /[a-z0-9_<>-]+/, keywords: { diff --git a/src/languages/pgsql.js b/src/languages/pgsql.js index bd9c8b1723..1ba55f2470 100644 --- a/src/languages/pgsql.js +++ b/src/languages/pgsql.js @@ -290,6 +290,7 @@ export default function(hljs) { .join('|'); return { + name: 'PostgreSQL', aliases: ['postgres','postgresql'], case_insensitive: true, keywords: { diff --git a/src/languages/php.js b/src/languages/php.js index 99e0c0d436..a199a65433 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -46,7 +46,7 @@ export default function(hljs) { built_in: // Standard PHP library: // - 'Error|0 ' + // error is too common a name esp since PHP is case in-sensative + '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 ' + // Reserved interfaces: // diff --git a/src/languages/plaintext.js b/src/languages/plaintext.js index f0242aa958..ab7a700efb 100644 --- a/src/languages/plaintext.js +++ b/src/languages/plaintext.js @@ -7,6 +7,7 @@ Category: common export default function(hljs) { return { + name: 'Plain text', aliases: ['text', 'txt'], disableAutodetect: true }; diff --git a/src/languages/pony.js b/src/languages/pony.js index 426017ceec..8f13eb87a9 100644 --- a/src/languages/pony.js +++ b/src/languages/pony.js @@ -67,6 +67,7 @@ export default function(hljs) { */ return { + name: 'Pony', keywords: KEYWORDS, contains: [ TYPE_NAME, diff --git a/src/languages/powershell.js b/src/languages/powershell.js index f46bf6fda6..e0e3ca7ccb 100644 --- a/src/languages/powershell.js +++ b/src/languages/powershell.js @@ -235,6 +235,7 @@ export default function(hljs){ PS_METHODS.contains.unshift(PS_TYPE) return { + name: 'PowerShell', aliases: ["ps", "ps1"], lexemes: /-?[A-z\.\-]+/, case_insensitive: true, diff --git a/src/languages/processing.js b/src/languages/processing.js index 311c795602..2221c08701 100644 --- a/src/languages/processing.js +++ b/src/languages/processing.js @@ -8,6 +8,7 @@ Category: graphics export default function(hljs) { return { + name: 'Processing', keywords: { keyword: 'BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color ' + 'double float int long String Array FloatDict FloatList IntDict IntList JSONArray JSONObject ' + diff --git a/src/languages/profile.js b/src/languages/profile.js index f4f0777d35..df2f005308 100644 --- a/src/languages/profile.js +++ b/src/languages/profile.js @@ -6,6 +6,7 @@ Author: Brian Beck export default function(hljs) { return { + name: 'Python profiler', contains: [ hljs.C_NUMBER_MODE, { diff --git a/src/languages/prolog.js b/src/languages/prolog.js index 5c03a1e4a3..926a7df796 100644 --- a/src/languages/prolog.js +++ b/src/languages/prolog.js @@ -87,6 +87,7 @@ export default function(hljs) { LIST.contains = inner; return { + name: 'Prolog', contains: inner.concat([ {begin: /\.$/} // relevance booster ]) diff --git a/src/languages/properties.js b/src/languages/properties.js index 9f0edc150d..5fcc92d00e 100644 --- a/src/languages/properties.js +++ b/src/languages/properties.js @@ -31,6 +31,7 @@ export default function(hljs) { }; return { + name: '.properties', case_insensitive: true, illegal: /\S/, contains: [ diff --git a/src/languages/protobuf.js b/src/languages/protobuf.js index 4075455fa7..bb73c78a81 100644 --- a/src/languages/protobuf.js +++ b/src/languages/protobuf.js @@ -8,6 +8,7 @@ Category: protocols export default function(hljs) { return { + name: 'Protocol Buffers', keywords: { keyword: 'package import option optional required repeated group oneof', built_in: 'double float int32 int64 uint32 uint64 sint32 sint64 ' + diff --git a/src/languages/puppet.js b/src/languages/puppet.js index 7d714f3538..c2f9fc2775 100644 --- a/src/languages/puppet.js +++ b/src/languages/puppet.js @@ -62,6 +62,7 @@ export default function(hljs) { }; return { + name: 'Puppet', aliases: ['pp'], contains: [ COMMENT, diff --git a/src/languages/purebasic.js b/src/languages/purebasic.js index a9ca3ae674..96f13c6a91 100644 --- a/src/languages/purebasic.js +++ b/src/languages/purebasic.js @@ -21,6 +21,7 @@ export default function(hljs) { }; return { + name: 'PureBASIC', aliases: ['pb', 'pbi'], keywords: // PB IDE color: #006666 (Blue Stone) + Bold // Keywords from all version of PureBASIC 5.00 upward ... diff --git a/src/languages/python.js b/src/languages/python.js index a55b0fd5b6..e7ae1bf222 100644 --- a/src/languages/python.js +++ b/src/languages/python.js @@ -91,6 +91,7 @@ export default function(hljs) { }; SUBST.contains = [STRING, NUMBER, PROMPT]; return { + name: 'Python', aliases: ['py', 'gyp', 'ipython'], keywords: KEYWORDS, illegal: /(<\/|->|\?)|=>/, diff --git a/src/languages/q.js b/src/languages/q.js index c8845229bf..f8aca0d548 100644 --- a/src/languages/q.js +++ b/src/languages/q.js @@ -17,6 +17,7 @@ export default function(hljs) { '`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid' }; return { + name: 'Q', aliases:['k', 'kdb'], keywords: Q_KEYWORDS, lexemes: /(`?)[A-Za-z0-9_]+\b/, diff --git a/src/languages/qml.js b/src/languages/qml.js index a0975ebe99..e52dd42fb7 100644 --- a/src/languages/qml.js +++ b/src/languages/qml.js @@ -99,6 +99,7 @@ export default function(hljs) { }; return { + name: 'QML', aliases: ['qt'], case_insensitive: false, keywords: KEYWORDS, diff --git a/src/languages/r.js b/src/languages/r.js index 1f8cf39156..45094f000c 100644 --- a/src/languages/r.js +++ b/src/languages/r.js @@ -10,6 +10,7 @@ export default function(hljs) { var IDENT_RE = '([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*'; return { + name: 'R', contains: [ hljs.HASH_COMMENT_MODE, { diff --git a/src/languages/reasonml.js b/src/languages/reasonml.js index d902d3fc17..eabbf25b27 100644 --- a/src/languages/reasonml.js +++ b/src/languages/reasonml.js @@ -238,6 +238,7 @@ export default function(hljs) { PARAMS_CONTENTS.push(MODULE_ACCESS_MODE); return { + name: 'ReasonML', aliases: ['re'], keywords: KEYWORDS, illegal: '(:\\-|:=|\\${|\\+=)', diff --git a/src/languages/rib.js b/src/languages/rib.js index 217e6fa768..26c5096310 100644 --- a/src/languages/rib.js +++ b/src/languages/rib.js @@ -8,6 +8,7 @@ Category: graphics export default function(hljs) { return { + name: 'RenderMan RIB', keywords: 'ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis ' + 'Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone ' + diff --git a/src/languages/roboconf.js b/src/languages/roboconf.js index 7e82af6bee..8722fab5c4 100644 --- a/src/languages/roboconf.js +++ b/src/languages/roboconf.js @@ -29,6 +29,7 @@ export default function(hljs) { }; return { + name: 'Roboconf', aliases: ['graph', 'instances'], case_insensitive: true, keywords: 'import', diff --git a/src/languages/routeros.js b/src/languages/routeros.js index e605518230..e244313017 100644 --- a/src/languages/routeros.js +++ b/src/languages/routeros.js @@ -65,6 +65,7 @@ export default function(hljs) { var IPADDR_wBITMASK = IPADDR+'/(3[0-2]|[1-2][0-9]|\\d)'; ////////////////////////////////////////////////////////////////////// return { + name: 'Microtik RouterOS script', aliases: ['routeros', 'mikrotik'], case_insensitive: true, lexemes: /:?[\w-]+/, diff --git a/src/languages/rsl.js b/src/languages/rsl.js index 72ba3c133b..6dbca51329 100644 --- a/src/languages/rsl.js +++ b/src/languages/rsl.js @@ -8,6 +8,7 @@ Category: graphics export default function(hljs) { return { + name: 'RenderMan RSL', keywords: { keyword: 'float color point normal vector matrix while for if do return else break extern continue', diff --git a/src/languages/ruby.js b/src/languages/ruby.js index 0f15104fe7..59f2b048f8 100644 --- a/src/languages/ruby.js +++ b/src/languages/ruby.js @@ -185,6 +185,7 @@ export default function(hljs) { ]; return { + name: 'Ruby', aliases: ['rb', 'gemspec', 'podspec', 'thor', 'irb'], keywords: RUBY_KEYWORDS, illegal: /\/\*/, diff --git a/src/languages/ruleslanguage.js b/src/languages/ruleslanguage.js index cb9974a252..8038bf0e62 100644 --- a/src/languages/ruleslanguage.js +++ b/src/languages/ruleslanguage.js @@ -8,6 +8,7 @@ Category: enterprise export default function(hljs) { return { + name: 'Oracle Rules Language', keywords: { keyword: 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' + 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' + diff --git a/src/languages/rust.js b/src/languages/rust.js index e6cceeec68..d7cb15ecc2 100644 --- a/src/languages/rust.js +++ b/src/languages/rust.js @@ -34,6 +34,7 @@ export default function(hljs) { 'option_env! print! println! select! stringify! try! unimplemented! ' + 'unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!'; return { + name: 'Rust', aliases: ['rs'], keywords: { keyword: diff --git a/src/languages/sas.js b/src/languages/sas.js index 6fb631c7e7..d5afe5a99e 100644 --- a/src/languages/sas.js +++ b/src/languages/sas.js @@ -78,6 +78,7 @@ export default function(hljs) { 'trim|unquote|until|upcase|verify|while|window'; return { + name: 'SAS', aliases: ['sas', 'SAS'], case_insensitive: true, // SAS is case-insensitive keywords: { diff --git a/src/languages/scala.js b/src/languages/scala.js index 86d44d7add..ee3beab3c8 100644 --- a/src/languages/scala.js +++ b/src/languages/scala.js @@ -103,6 +103,7 @@ export default function(hljs) { }; return { + name: 'Scala', keywords: { literal: 'true false null', keyword: 'type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit' diff --git a/src/languages/scheme.js b/src/languages/scheme.js index 0b5d9ac99d..335c8e14d0 100644 --- a/src/languages/scheme.js +++ b/src/languages/scheme.js @@ -148,6 +148,7 @@ export default function(hljs) { BODY.contains = [LITERAL, NUMBER, STRING, IDENT, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES); return { + name: 'Scheme', illegal: /\S/, contains: [SHEBANG, NUMBER, STRING, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES) }; diff --git a/src/languages/scilab.js b/src/languages/scilab.js index 801c9fbba8..e73ab2c1cb 100644 --- a/src/languages/scilab.js +++ b/src/languages/scilab.js @@ -19,6 +19,7 @@ export default function(hljs) { ]; return { + name: 'Scilab', aliases: ['sci'], lexemes: /%?\w+/, keywords: { diff --git a/src/languages/scss.js b/src/languages/scss.js index 89d738cfb5..90ed1b5a57 100644 --- a/src/languages/scss.js +++ b/src/languages/scss.js @@ -36,6 +36,7 @@ export default function(hljs) { } }; return { + name: 'SCSS', case_insensitive: true, illegal: '[=/|\']', contains: [ diff --git a/src/languages/shell.js b/src/languages/shell.js index f9b4320be8..3a1bc033ad 100644 --- a/src/languages/shell.js +++ b/src/languages/shell.js @@ -7,6 +7,7 @@ Category: common export default function(hljs) { return { + name: 'Shell Session', aliases: ['console'], contains: [ { diff --git a/src/languages/smali.js b/src/languages/smali.js index 4d3d730f45..70f36c5831 100644 --- a/src/languages/smali.js +++ b/src/languages/smali.js @@ -10,6 +10,7 @@ export default function(hljs) { var smali_instr_high_prio = ['aget', 'aput', 'array', 'check', 'execute', 'fill', 'filled', 'goto/16', 'goto/32', 'iget', 'instance', 'invoke', 'iput', 'monitor', 'packed', 'sget', 'sparse']; var smali_keywords = ['transient', 'constructor', 'abstract', 'final', 'synthetic', 'public', 'private', 'protected', 'static', 'bridge', 'system']; return { + name: 'Smali', aliases: ['smali'], contains: [ { diff --git a/src/languages/smalltalk.js b/src/languages/smalltalk.js index 7981753652..543fc6cdda 100644 --- a/src/languages/smalltalk.js +++ b/src/languages/smalltalk.js @@ -16,6 +16,7 @@ export default function(hljs) { begin: '#' + hljs.UNDERSCORE_IDENT_RE }; return { + name: 'Smalltalk', aliases: ['st'], keywords: 'self super nil true false thisContext', // only 6 contains: [ diff --git a/src/languages/sml.js b/src/languages/sml.js index 26d56b4ced..97ca1d7bcc 100644 --- a/src/languages/sml.js +++ b/src/languages/sml.js @@ -8,6 +8,7 @@ Category: functional */ export default function(hljs) { return { + name: 'SML (Standard ML)', aliases: ['ml'], keywords: { keyword: diff --git a/src/languages/sqf.js b/src/languages/sqf.js index d657aa6549..da37dab248 100644 --- a/src/languages/sqf.js +++ b/src/languages/sqf.js @@ -64,6 +64,7 @@ export default function(hljs) { }; return { + name: 'SQF', aliases: ['sqf'], case_insensitive: true, keywords: { diff --git a/src/languages/sql.js b/src/languages/sql.js index 4b482a6b03..6a9a5a0ba6 100644 --- a/src/languages/sql.js +++ b/src/languages/sql.js @@ -8,7 +8,7 @@ export default function(hljs) { var COMMENT_MODE = hljs.COMMENT('--', '$'); return { - name: "SQL", + name: 'SQL', case_insensitive: true, illegal: /[<>{}*]/, contains: [ diff --git a/src/languages/stan.js b/src/languages/stan.js index 56cbd05a0f..e26e9876a0 100644 --- a/src/languages/stan.js +++ b/src/languages/stan.js @@ -151,6 +151,7 @@ export default function(hljs) { ]; return { + name: 'Stan', aliases: ['stanfuncs'], keywords: { 'title': BLOCKS.join(' '), diff --git a/src/languages/stata.js b/src/languages/stata.js index 2e7e8faf4a..08e431eb74 100644 --- a/src/languages/stata.js +++ b/src/languages/stata.js @@ -13,6 +13,7 @@ Category: scientific export default function(hljs) { return { + name: 'Stata', aliases: ['do', 'ado'], case_insensitive: true, keywords: 'if else in foreach for forv forva forval forvalu forvalue forvalues by bys bysort xi quietly qui capture about ac ac_7 acprplot acprplot_7 adjust ado adopath adoupdate alpha ameans an ano anov anova anova_estat anova_terms anovadef aorder ap app appe appen append arch arch_dr arch_estat arch_p archlm areg areg_p args arima arima_dr arima_estat arima_p as asmprobit asmprobit_estat asmprobit_lf asmprobit_mfx__dlg asmprobit_p ass asse asser assert avplot avplot_7 avplots avplots_7 bcskew0 bgodfrey bias binreg bip0_lf biplot bipp_lf bipr_lf bipr_p biprobit bitest bitesti bitowt blogit bmemsize boot bootsamp bootstrap bootstrap_8 boxco_l boxco_p boxcox boxcox_6 boxcox_p bprobit br break brier bro brow brows browse brr brrstat bs bs_7 bsampl_w bsample bsample_7 bsqreg bstat bstat_7 bstat_8 bstrap bstrap_7 bubble bubbleplot ca ca_estat ca_p cabiplot camat canon canon_8 canon_8_p canon_estat canon_p cap caprojection capt captu captur capture cat cc cchart cchart_7 cci cd censobs_table centile cf char chdir checkdlgfiles checkestimationsample checkhlpfiles checksum chelp ci cii cl class classutil clear cli clis clist clo clog clog_lf clog_p clogi clogi_sw clogit clogit_lf clogit_p clogitp clogl_sw cloglog clonevar clslistarray cluster cluster_measures cluster_stop cluster_tree cluster_tree_8 clustermat cmdlog cnr cnre cnreg cnreg_p cnreg_sw cnsreg codebook collaps4 collapse colormult_nb colormult_nw compare compress conf confi confir confirm conren cons const constr constra constrai constrain constraint continue contract copy copyright copysource cor corc corr corr2data corr_anti corr_kmo corr_smc corre correl correla correlat correlate corrgram cou coun count cox cox_p cox_sw coxbase coxhaz coxvar cprplot cprplot_7 crc cret cretu cretur creturn cross cs cscript cscript_log csi ct ct_is ctset ctst_5 ctst_st cttost cumsp cumsp_7 cumul cusum cusum_7 cutil d|0 datasig datasign datasigna datasignat datasignatu datasignatur datasignature datetof db dbeta de dec deco decod decode deff des desc descr descri describ describe destring dfbeta dfgls dfuller di di_g dir dirstats dis discard disp disp_res disp_s displ displa display distinct do doe doed doedi doedit dotplot dotplot_7 dprobit drawnorm drop ds ds_util dstdize duplicates durbina dwstat dydx e|0 ed edi edit egen eivreg emdef en enc enco encod encode eq erase ereg ereg_lf ereg_p ereg_sw ereghet ereghet_glf ereghet_glf_sh ereghet_gp ereghet_ilf ereghet_ilf_sh ereghet_ip eret eretu eretur ereturn err erro error esize est est_cfexist est_cfname est_clickable est_expand est_hold est_table est_unhold est_unholdok estat estat_default estat_summ estat_vce_only esti estimates etodow etof etomdy ex exi exit expand expandcl fac fact facto factor factor_estat factor_p factor_pca_rotated factor_rotate factormat fcast fcast_compute fcast_graph fdades fdadesc fdadescr fdadescri fdadescrib fdadescribe fdasav fdasave fdause fh_st file open file read file close file filefilter fillin find_hlp_file findfile findit findit_7 fit fl fli flis flist for5_0 forest forestplot form forma format fpredict frac_154 frac_adj frac_chk frac_cox frac_ddp frac_dis frac_dv frac_in frac_mun frac_pp frac_pq frac_pv frac_wgt frac_xo fracgen fracplot fracplot_7 fracpoly fracpred fron_ex fron_hn fron_p fron_tn fron_tn2 frontier ftodate ftoe ftomdy ftowdate funnel funnelplot g|0 gamhet_glf gamhet_gp gamhet_ilf gamhet_ip gamma gamma_d2 gamma_p gamma_sw gammahet gdi_hexagon gdi_spokes ge gen gene gener genera generat generate genrank genstd genvmean gettoken gl gladder gladder_7 glim_l01 glim_l02 glim_l03 glim_l04 glim_l05 glim_l06 glim_l07 glim_l08 glim_l09 glim_l10 glim_l11 glim_l12 glim_lf glim_mu glim_nw1 glim_nw2 glim_nw3 glim_p glim_v1 glim_v2 glim_v3 glim_v4 glim_v5 glim_v6 glim_v7 glm glm_6 glm_p glm_sw glmpred glo glob globa global glogit glogit_8 glogit_p gmeans gnbre_lf gnbreg gnbreg_5 gnbreg_p gomp_lf gompe_sw gomper_p gompertz gompertzhet gomphet_glf gomphet_glf_sh gomphet_gp gomphet_ilf gomphet_ilf_sh gomphet_ip gphdot gphpen gphprint gprefs gprobi_p gprobit gprobit_8 gr gr7 gr_copy gr_current gr_db gr_describe gr_dir gr_draw gr_draw_replay gr_drop gr_edit gr_editviewopts gr_example gr_example2 gr_export gr_print gr_qscheme gr_query gr_read gr_rename gr_replay gr_save gr_set gr_setscheme gr_table gr_undo gr_use graph graph7 grebar greigen greigen_7 greigen_8 grmeanby grmeanby_7 gs_fileinfo gs_filetype gs_graphinfo gs_stat gsort gwood h|0 hadimvo hareg hausman haver he heck_d2 heckma_p heckman heckp_lf heckpr_p heckprob hel help hereg hetpr_lf hetpr_p hetprob hettest hexdump hilite hist hist_7 histogram hlogit hlu hmeans hotel hotelling hprobit hreg hsearch icd9 icd9_ff icd9p iis impute imtest inbase include inf infi infil infile infix inp inpu input ins insheet insp inspe inspec inspect integ inten intreg intreg_7 intreg_p intrg2_ll intrg_ll intrg_ll2 ipolate iqreg ir irf irf_create irfm iri is_svy is_svysum isid istdize ivprob_1_lf ivprob_lf ivprobit ivprobit_p ivreg ivreg_footnote ivtob_1_lf ivtob_lf ivtobit ivtobit_p jackknife jacknife jknife jknife_6 jknife_8 jkstat joinby kalarma1 kap kap_3 kapmeier kappa kapwgt kdensity kdensity_7 keep ksm ksmirnov ktau kwallis l|0 la lab labbe labbeplot labe label labelbook ladder levels levelsof leverage lfit lfit_p li lincom line linktest lis list lloghet_glf lloghet_glf_sh lloghet_gp lloghet_ilf lloghet_ilf_sh lloghet_ip llogi_sw llogis_p llogist llogistic llogistichet lnorm_lf lnorm_sw lnorma_p lnormal lnormalhet lnormhet_glf lnormhet_glf_sh lnormhet_gp lnormhet_ilf lnormhet_ilf_sh lnormhet_ip lnskew0 loadingplot loc loca local log logi logis_lf logistic logistic_p logit logit_estat logit_p loglogs logrank loneway lookfor lookup lowess lowess_7 lpredict lrecomp lroc lroc_7 lrtest ls lsens lsens_7 lsens_x lstat ltable ltable_7 ltriang lv lvr2plot lvr2plot_7 m|0 ma mac macr macro makecns man manova manova_estat manova_p manovatest mantel mark markin markout marksample mat mat_capp mat_order mat_put_rr mat_rapp mata mata_clear mata_describe mata_drop mata_matdescribe mata_matsave mata_matuse mata_memory mata_mlib mata_mosave mata_rename mata_which matalabel matcproc matlist matname matr matri matrix matrix_input__dlg matstrik mcc mcci md0_ md1_ md1debug_ md2_ md2debug_ mds mds_estat mds_p mdsconfig mdslong mdsmat mdsshepard mdytoe mdytof me_derd mean means median memory memsize menl meqparse mer merg merge meta mfp mfx mhelp mhodds minbound mixed_ll mixed_ll_reparm mkassert mkdir mkmat mkspline ml ml_5 ml_adjs ml_bhhhs ml_c_d ml_check ml_clear ml_cnt ml_debug ml_defd ml_e0 ml_e0_bfgs ml_e0_cycle ml_e0_dfp ml_e0i ml_e1 ml_e1_bfgs ml_e1_bhhh ml_e1_cycle ml_e1_dfp ml_e2 ml_e2_cycle ml_ebfg0 ml_ebfr0 ml_ebfr1 ml_ebh0q ml_ebhh0 ml_ebhr0 ml_ebr0i ml_ecr0i ml_edfp0 ml_edfr0 ml_edfr1 ml_edr0i ml_eds ml_eer0i ml_egr0i ml_elf ml_elf_bfgs ml_elf_bhhh ml_elf_cycle ml_elf_dfp ml_elfi ml_elfs ml_enr0i ml_enrr0 ml_erdu0 ml_erdu0_bfgs ml_erdu0_bhhh ml_erdu0_bhhhq ml_erdu0_cycle ml_erdu0_dfp ml_erdu0_nrbfgs ml_exde ml_footnote ml_geqnr ml_grad0 ml_graph ml_hbhhh ml_hd0 ml_hold ml_init ml_inv ml_log ml_max ml_mlout ml_mlout_8 ml_model ml_nb0 ml_opt ml_p ml_plot ml_query ml_rdgrd ml_repor ml_s_e ml_score ml_searc ml_technique ml_unhold mleval mlf_ mlmatbysum mlmatsum mlog mlogi mlogit mlogit_footnote mlogit_p mlopts mlsum mlvecsum mnl0_ mor more mov move mprobit mprobit_lf mprobit_p mrdu0_ mrdu1_ mvdecode mvencode mvreg mvreg_estat n|0 nbreg nbreg_al nbreg_lf nbreg_p nbreg_sw nestreg net newey newey_7 newey_p news nl nl_7 nl_9 nl_9_p nl_p nl_p_7 nlcom nlcom_p nlexp2 nlexp2_7 nlexp2a nlexp2a_7 nlexp3 nlexp3_7 nlgom3 nlgom3_7 nlgom4 nlgom4_7 nlinit nllog3 nllog3_7 nllog4 nllog4_7 nlog_rd nlogit nlogit_p nlogitgen nlogittree nlpred no nobreak noi nois noisi noisil noisily note notes notes_dlg nptrend numlabel numlist odbc old_ver olo olog ologi ologi_sw ologit ologit_p ologitp on one onew onewa oneway op_colnm op_comp op_diff op_inv op_str opr opro oprob oprob_sw oprobi oprobi_p oprobit oprobitp opts_exclusive order orthog orthpoly ou out outf outfi outfil outfile outs outsh outshe outshee outsheet ovtest pac pac_7 palette parse parse_dissim pause pca pca_8 pca_display pca_estat pca_p pca_rotate pcamat pchart pchart_7 pchi pchi_7 pcorr pctile pentium pergram pergram_7 permute permute_8 personal peto_st pkcollapse pkcross pkequiv pkexamine pkexamine_7 pkshape pksumm pksumm_7 pl plo plot plugin pnorm pnorm_7 poisgof poiss_lf poiss_sw poisso_p poisson poisson_estat post postclose postfile postutil pperron pr prais prais_e prais_e2 prais_p predict predictnl preserve print pro prob probi probit probit_estat probit_p proc_time procoverlay procrustes procrustes_estat procrustes_p profiler prog progr progra program prop proportion prtest prtesti pwcorr pwd q\\s qby qbys qchi qchi_7 qladder qladder_7 qnorm qnorm_7 qqplot qqplot_7 qreg qreg_c qreg_p qreg_sw qu quadchk quantile quantile_7 que quer query range ranksum ratio rchart rchart_7 rcof recast reclink recode reg reg3 reg3_p regdw regr regre regre_p2 regres regres_p regress regress_estat regriv_p remap ren rena renam rename renpfix repeat replace report reshape restore ret retu retur return rm rmdir robvar roccomp roccomp_7 roccomp_8 rocf_lf rocfit rocfit_8 rocgold rocplot rocplot_7 roctab roctab_7 rolling rologit rologit_p rot rota rotat rotate rotatemat rreg rreg_p ru run runtest rvfplot rvfplot_7 rvpplot rvpplot_7 sa safesum sample sampsi sav save savedresults saveold sc sca scal scala scalar scatter scm_mine sco scob_lf scob_p scobi_sw scobit scor score scoreplot scoreplot_help scree screeplot screeplot_help sdtest sdtesti se search separate seperate serrbar serrbar_7 serset set set_defaults sfrancia sh she shel shell shewhart shewhart_7 signestimationsample signrank signtest simul simul_7 simulate simulate_8 sktest sleep slogit slogit_d2 slogit_p smooth snapspan so sor sort spearman spikeplot spikeplot_7 spikeplt spline_x split sqreg sqreg_p sret sretu sretur sreturn ssc st st_ct st_hc st_hcd st_hcd_sh st_is st_issys st_note st_promo st_set st_show st_smpl st_subid stack statsby statsby_8 stbase stci stci_7 stcox stcox_estat stcox_fr stcox_fr_ll stcox_p stcox_sw stcoxkm stcoxkm_7 stcstat stcurv stcurve stcurve_7 stdes stem stepwise stereg stfill stgen stir stjoin stmc stmh stphplot stphplot_7 stphtest stphtest_7 stptime strate strate_7 streg streg_sw streset sts sts_7 stset stsplit stsum sttocc sttoct stvary stweib su suest suest_8 sum summ summa summar summari summariz summarize sunflower sureg survcurv survsum svar svar_p svmat svy svy_disp svy_dreg svy_est svy_est_7 svy_estat svy_get svy_gnbreg_p svy_head svy_header svy_heckman_p svy_heckprob_p svy_intreg_p svy_ivreg_p svy_logistic_p svy_logit_p svy_mlogit_p svy_nbreg_p svy_ologit_p svy_oprobit_p svy_poisson_p svy_probit_p svy_regress_p svy_sub svy_sub_7 svy_x svy_x_7 svy_x_p svydes svydes_8 svygen svygnbreg svyheckman svyheckprob svyintreg svyintreg_7 svyintrg svyivreg svylc svylog_p svylogit svymarkout svymarkout_8 svymean svymlog svymlogit svynbreg svyolog svyologit svyoprob svyoprobit svyopts svypois svypois_7 svypoisson svyprobit svyprobt svyprop svyprop_7 svyratio svyreg svyreg_p svyregress svyset svyset_7 svyset_8 svytab svytab_7 svytest svytotal sw sw_8 swcnreg swcox swereg swilk swlogis swlogit swologit swoprbt swpois swprobit swqreg swtobit swweib symmetry symmi symplot symplot_7 syntax sysdescribe sysdir sysuse szroeter ta tab tab1 tab2 tab_or tabd tabdi tabdis tabdisp tabi table tabodds tabodds_7 tabstat tabu tabul tabula tabulat tabulate te tempfile tempname tempvar tes test testnl testparm teststd tetrachoric time_it timer tis tob tobi tobit tobit_p tobit_sw token tokeni tokeniz tokenize tostring total translate translator transmap treat_ll treatr_p treatreg trim trimfill trnb_cons trnb_mean trpoiss_d2 trunc_ll truncr_p truncreg tsappend tset tsfill tsline tsline_ex tsreport tsrevar tsrline tsset tssmooth tsunab ttest ttesti tut_chk tut_wait tutorial tw tware_st two twoway twoway__fpfit_serset twoway__function_gen twoway__histogram_gen twoway__ipoint_serset twoway__ipoints_serset twoway__kdensity_gen twoway__lfit_serset twoway__normgen_gen twoway__pci_serset twoway__qfit_serset twoway__scatteri_serset twoway__sunflower_gen twoway_ksm_serset ty typ type typeof u|0 unab unabbrev unabcmd update us use uselabel var var_mkcompanion var_p varbasic varfcast vargranger varirf varirf_add varirf_cgraph varirf_create varirf_ctable varirf_describe varirf_dir varirf_drop varirf_erase varirf_graph varirf_ograph varirf_rename varirf_set varirf_table varlist varlmar varnorm varsoc varstable varstable_w varstable_w2 varwle vce vec vec_fevd vec_mkphi vec_p vec_p_w vecirf_create veclmar veclmar_w vecnorm vecnorm_w vecrank vecstable verinst vers versi versio version view viewsource vif vwls wdatetof webdescribe webseek webuse weib1_lf weib2_lf weib_lf weib_lf0 weibhet_glf weibhet_glf_sh weibhet_glfa weibhet_glfa_sh weibhet_gp weibhet_ilf weibhet_ilf_sh weibhet_ilfa weibhet_ilfa_sh weibhet_ip weibu_sw weibul_p weibull weibull_c weibull_s weibullhet wh whelp whi which whil while wilc_st wilcoxon win wind windo window winexec wntestb wntestb_7 wntestq xchart xchart_7 xcorr xcorr_7 xi xi_6 xmlsav xmlsave xmluse xpose xsh xshe xshel xshell xt_iis xt_tis xtab_p xtabond xtbin_p xtclog xtcloglog xtcloglog_8 xtcloglog_d2 xtcloglog_pa_p xtcloglog_re_p xtcnt_p xtcorr xtdata xtdes xtfront_p xtfrontier xtgee xtgee_elink xtgee_estat xtgee_makeivar xtgee_p xtgee_plink xtgls xtgls_p xthaus xthausman xtht_p xthtaylor xtile xtint_p xtintreg xtintreg_8 xtintreg_d2 xtintreg_p xtivp_1 xtivp_2 xtivreg xtline xtline_ex xtlogit xtlogit_8 xtlogit_d2 xtlogit_fe_p xtlogit_pa_p xtlogit_re_p xtmixed xtmixed_estat xtmixed_p xtnb_fe xtnb_lf xtnbreg xtnbreg_pa_p xtnbreg_refe_p xtpcse xtpcse_p xtpois xtpoisson xtpoisson_d2 xtpoisson_pa_p xtpoisson_refe_p xtpred xtprobit xtprobit_8 xtprobit_d2 xtprobit_re_p xtps_fe xtps_lf xtps_ren xtps_ren_8 xtrar_p xtrc xtrc_p xtrchh xtrefe_p xtreg xtreg_be xtreg_fe xtreg_ml xtreg_pa_p xtreg_re xtregar xtrere_p xtset xtsf_ll xtsf_llti xtsum xttab xttest0 xttobit xttobit_8 xttobit_p xttrans yx yxview__barlike_draw yxview_area_draw yxview_bar_draw yxview_dot_draw yxview_dropline_draw yxview_function_draw yxview_iarrow_draw yxview_ilabels_draw yxview_normal_draw yxview_pcarrow_draw yxview_pcbarrow_draw yxview_pccapsym_draw yxview_pcscatter_draw yxview_pcspike_draw yxview_rarea_draw yxview_rbar_draw yxview_rbarm_draw yxview_rcap_draw yxview_rcapsym_draw yxview_rconnected_draw yxview_rline_draw yxview_rscatter_draw yxview_rspike_draw yxview_spike_draw yxview_sunflower_draw zap_s zinb zinb_llf zinb_plf zip zip_llf zip_p zip_plf zt_ct_5 zt_hc_5 zt_hcd_5 zt_is_5 zt_iss_5 zt_sho_5 zt_smp_5 ztbase_5 ztcox_5 ztdes_5 ztereg_5 ztfill_5 ztgen_5 ztir_5 ztjoin_5 ztnb ztnb_p ztp ztp_p zts_5 ztset_5 ztspli_5 ztsum_5 zttoct_5 ztvary_5 ztweib_5', diff --git a/src/languages/step21.js b/src/languages/step21.js index d060c93b9f..d7ea5a596d 100644 --- a/src/languages/step21.js +++ b/src/languages/step21.js @@ -22,6 +22,7 @@ export default function(hljs) { }; return { + name: 'STEP Part 21', aliases: ['p21', 'step', 'stp'], case_insensitive: true, // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized. lexemes: STEP21_IDENT_RE, diff --git a/src/languages/stylus.js b/src/languages/stylus.js index f2934c7bf3..7496de6f7a 100644 --- a/src/languages/stylus.js +++ b/src/languages/stylus.js @@ -346,6 +346,7 @@ export default function(hljs) { ]; return { + name: 'Stylus', aliases: ['styl'], case_insensitive: false, keywords: 'if else for in', diff --git a/src/languages/subunit.js b/src/languages/subunit.js index 545961a61b..68313215b6 100644 --- a/src/languages/subunit.js +++ b/src/languages/subunit.js @@ -28,6 +28,7 @@ export default function(hljs) { ], }; return { + name: 'SubUnit', case_insensitive: true, contains: [ DETAILS, diff --git a/src/languages/swift.js b/src/languages/swift.js index fc39dd941b..ce1b6aa8ed 100644 --- a/src/languages/swift.js +++ b/src/languages/swift.js @@ -77,6 +77,7 @@ export default function(hljs) { SUBST.contains = [NUMBERS]; return { + name: 'Swift', keywords: SWIFT_KEYWORDS, contains: [ STRING, diff --git a/src/languages/taggerscript.js b/src/languages/taggerscript.js index 3161c802ad..41521df26f 100644 --- a/src/languages/taggerscript.js +++ b/src/languages/taggerscript.js @@ -39,6 +39,7 @@ export default function(hljs) { }; return { + name: 'Tagger Script', contains: [ COMMENT, FUNCTION, diff --git a/src/languages/tap.js b/src/languages/tap.js index 07d68cff3d..2c789e6605 100644 --- a/src/languages/tap.js +++ b/src/languages/tap.js @@ -8,6 +8,7 @@ Website: https://testanything.org export default function(hljs) { return { + name: 'Test Anything Protocol', case_insensitive: true, contains: [ hljs.HASH_COMMENT_MODE, diff --git a/src/languages/tcl.js b/src/languages/tcl.js index 7492b2f303..f1e0b0df31 100644 --- a/src/languages/tcl.js +++ b/src/languages/tcl.js @@ -7,6 +7,7 @@ Website: https://www.tcl.tk/about/language.html export default function(hljs) { return { + name: 'Tcl', aliases: ['tk'], keywords: 'after append apply array auto_execok auto_import auto_load auto_mkindex ' + 'auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock ' + diff --git a/src/languages/thrift.js b/src/languages/thrift.js index e8e983a82f..a2652c123d 100644 --- a/src/languages/thrift.js +++ b/src/languages/thrift.js @@ -9,6 +9,7 @@ Category: protocols export default function(hljs) { var BUILT_IN_TYPES = 'bool byte i16 i32 i64 double string binary'; return { + name: 'Thrift', keywords: { keyword: 'namespace const typedef struct enum service exception void oneway set list map required optional', diff --git a/src/languages/tp.js b/src/languages/tp.js index 201ebce523..eec5fdde2c 100644 --- a/src/languages/tp.js +++ b/src/languages/tp.js @@ -37,6 +37,7 @@ export default function(hljs) { }; return { + name: 'TP', keywords: { keyword: 'ABORT ACC ADJUST AND AP_LD BREAK CALL CNT COL CONDITION CONFIG DA DB ' + diff --git a/src/languages/twig.js b/src/languages/twig.js index 9cd0ba88d0..814f980995 100644 --- a/src/languages/twig.js +++ b/src/languages/twig.js @@ -43,6 +43,7 @@ export default function(hljs) { TAGS = TAGS + ' ' + TAGS.split(' ').map(function(t){return 'end' + t}).join(' '); return { + name: 'Twig', aliases: ['craftcms'], case_insensitive: true, subLanguage: 'xml', diff --git a/src/languages/typescript.js b/src/languages/typescript.js index 71b2f7e8c1..23d3fb34a4 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -117,6 +117,7 @@ export default function(hljs) { return { + name: 'TypeScript', aliases: ['ts'], keywords: KEYWORDS, contains: [ diff --git a/src/languages/vala.js b/src/languages/vala.js index 297ae40597..49b26a8d32 100644 --- a/src/languages/vala.js +++ b/src/languages/vala.js @@ -7,6 +7,7 @@ Website: https://wiki.gnome.org/Projects/Vala export default function(hljs) { return { + name: 'Vala', keywords: { keyword: // Value types diff --git a/src/languages/vbnet.js b/src/languages/vbnet.js index e4eb38d740..405f91c461 100644 --- a/src/languages/vbnet.js +++ b/src/languages/vbnet.js @@ -7,6 +7,7 @@ Website: https://docs.microsoft.com/en-us/dotnet/visual-basic/getting-started/ export default function(hljs) { return { + name: 'Visual Basic .NET', aliases: ['vb'], case_insensitive: true, keywords: { diff --git a/src/languages/vbscript-html.js b/src/languages/vbscript-html.js index 582412c4e1..527d7daadb 100644 --- a/src/languages/vbscript-html.js +++ b/src/languages/vbscript-html.js @@ -9,6 +9,7 @@ Category: scripting export default function(hljs) { return { + name: 'VBScript in HTML', subLanguage: 'xml', contains: [ { diff --git a/src/languages/vbscript.js b/src/languages/vbscript.js index f96c4376aa..8e5ab8ff92 100644 --- a/src/languages/vbscript.js +++ b/src/languages/vbscript.js @@ -9,6 +9,7 @@ Category: scripting export default function(hljs) { return { + name: 'VBScript', aliases: ['vbs'], case_insensitive: true, keywords: { diff --git a/src/languages/verilog.js b/src/languages/verilog.js index a22254de6d..855794df9f 100644 --- a/src/languages/verilog.js +++ b/src/languages/verilog.js @@ -67,6 +67,7 @@ export default function(hljs) { '$sformatf $fgetc $ungetc $fgets $sscanf $rewind $ftell $ferror' }; return { + name: 'Verilog', aliases: ['v', 'sv', 'svh'], case_insensitive: false, keywords: SV_KEYWORDS, lexemes: /[\w\$]+/, diff --git a/src/languages/vhdl.js b/src/languages/vhdl.js index b78ca82c74..c5c49d8010 100644 --- a/src/languages/vhdl.js +++ b/src/languages/vhdl.js @@ -20,6 +20,7 @@ export default function(hljs) { var NUMBER_RE = '\\b(' + BASED_LITERAL_RE + '|' + DECIMAL_LITERAL_RE + ')'; return { + name: 'VHDL', case_insensitive: true, keywords: { keyword: diff --git a/src/languages/vim.js b/src/languages/vim.js index b9bc91f68e..61b0ff19f7 100644 --- a/src/languages/vim.js +++ b/src/languages/vim.js @@ -8,6 +8,7 @@ Category: scripting export default function(hljs) { return { + name: 'Vim Script', lexemes: /[!#@\w]+/, keywords: { keyword: diff --git a/src/languages/x86asm.js b/src/languages/x86asm.js index 134c0d2221..3c35a28075 100644 --- a/src/languages/x86asm.js +++ b/src/languages/x86asm.js @@ -8,6 +8,7 @@ Category: assembler export default function(hljs) { return { + name: 'Intel x86 Assembly', case_insensitive: true, lexemes: '[.%]?' + hljs.IDENT_RE, keywords: { diff --git a/src/languages/xl.js b/src/languages/xl.js index 3a421ecb34..7ebe82c5d6 100644 --- a/src/languages/xl.js +++ b/src/languages/xl.js @@ -61,6 +61,7 @@ export default function(hljs) { ] }; return { + name: 'XL', aliases: ['tao'], lexemes: /[a-zA-Z][a-zA-Z0-9_?]*/, keywords: XL_KEYWORDS, diff --git a/src/languages/xml.js b/src/languages/xml.js index e3146e3082..d9dee3e2f9 100644 --- a/src/languages/xml.js +++ b/src/languages/xml.js @@ -51,6 +51,7 @@ export default function(hljs) { ] }; return { + name: 'HTML, XML', aliases: ['html', 'xhtml', 'rss', 'atom', 'xjb', 'xsd', 'xsl', 'plist', 'wsf', 'svg'], case_insensitive: true, contains: [ diff --git a/src/languages/xquery.js b/src/languages/xquery.js index 0f22dd9dd9..851ebaae33 100644 --- a/src/languages/xquery.js +++ b/src/languages/xquery.js @@ -165,6 +165,7 @@ export default function(hljs) { return { + name: 'XQuery', aliases: ['xpath', 'xq'], case_insensitive: false, lexemes: /[a-zA-Z\$][a-zA-Z0-9_:\-]*/, diff --git a/src/languages/yaml.js b/src/languages/yaml.js index 3437d72f1c..fed5779490 100644 --- a/src/languages/yaml.js +++ b/src/languages/yaml.js @@ -45,8 +45,9 @@ export default function(hljs) { }; return { + name: 'YAML', case_insensitive: true, - aliases: ['yml', 'YAML', 'yaml'], + aliases: ['yml', 'YAML'], contains: [ KEY, { diff --git a/src/languages/zephir.js b/src/languages/zephir.js index 70a28e6e0d..681a8538fb 100644 --- a/src/languages/zephir.js +++ b/src/languages/zephir.js @@ -44,6 +44,7 @@ export default function(hljs) { 'true false null undefined'; return { + name: 'Zephir', aliases: ['zep'], keywords: KEYWORDS, contains: [ From 48a3ba9e9d341722bd635e26fc382eece7d48386 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 22 Feb 2020 23:47:21 -0500 Subject: [PATCH 010/816] enh(csharp) add support for `@identifier` style identifiers (#2414) --- CHANGES.md | 1 + src/languages/csharp.js | 9 ++++++++- test/markup/csharp/identifiers.expect.txt | 3 +++ test/markup/csharp/identifiers.txt | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/markup/csharp/identifiers.expect.txt create mode 100644 test/markup/csharp/identifiers.txt diff --git a/CHANGES.md b/CHANGES.md index 3bb58c9569..56cb4da5e0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Core Changes: Language Improvements: +- (csharp) add support for `@identifier` style identifiers (#2414) [Josh Goebel][] - fix(elixir) Support function names with a slash (#2406) [Josh Goebel][] - fix(javascript) comma is allowed in a "value container" (#2403) [Josh Goebel][] - enh(apache) add `deny` and `allow` keywords [Josh Goebel][] diff --git a/src/languages/csharp.js b/src/languages/csharp.js index b7ad270edd..8294552c85 100644 --- a/src/languages/csharp.js +++ b/src/languages/csharp.js @@ -93,6 +93,12 @@ export default function(hljs) { keywords: "in out" }; var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '(\\s*,\\s*' + hljs.IDENT_RE + ')*>)?(\\[\\])?'; + var AT_IDENTIFIER = { + // prevents expressions like `@class` from incorrect flagging + // `class` as a keyword + begin: "@" + hljs.IDENT_RE, + relevance: 0 + }; return { name: 'C#', @@ -195,7 +201,8 @@ export default function(hljs) { hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE ] - } + }, + AT_IDENTIFIER ] }; } diff --git a/test/markup/csharp/identifiers.expect.txt b/test/markup/csharp/identifiers.expect.txt new file mode 100644 index 0000000000..566b865c4d --- /dev/null +++ b/test/markup/csharp/identifiers.expect.txt @@ -0,0 +1,3 @@ +var @class = new MyClass(); +doSomething(@var, @foo); +var a; diff --git a/test/markup/csharp/identifiers.txt b/test/markup/csharp/identifiers.txt new file mode 100644 index 0000000000..3e7040f291 --- /dev/null +++ b/test/markup/csharp/identifiers.txt @@ -0,0 +1,4 @@ +var @class = new MyClass(); +doSomething(@var, @foo); +var a; + From 83996aaff0152d8ffcb53b69602ee26da871119a Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 23 Feb 2020 00:34:53 -0500 Subject: [PATCH 011/816] enh(python) Added `python-repl` for Python REPL sessions (#2413) --- CHANGES.md | 2 +- src/languages/python-repl.js | 29 +++++++++++++++++++++++ test/detect/python-repl/default.txt | 15 ++++++++++++ test/markup/python-repl/sample.expect.txt | 17 +++++++++++++ test/markup/python-repl/sample.txt | 17 +++++++++++++ 5 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 src/languages/python-repl.js create mode 100644 test/detect/python-repl/default.txt create mode 100644 test/markup/python-repl/sample.expect.txt create mode 100644 test/markup/python-repl/sample.txt diff --git a/CHANGES.md b/CHANGES.md index 56cb4da5e0..263ab55bea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ New languages: -- none. +- enh(python) Added `python-repl` for Python REPL sessions New themes: diff --git a/src/languages/python-repl.js b/src/languages/python-repl.js new file mode 100644 index 0000000000..ceb92d9574 --- /dev/null +++ b/src/languages/python-repl.js @@ -0,0 +1,29 @@ +/* +Language: Python REPL +Requires: python.js +Author: Josh Goebel +Category: common +*/ + +export default function(hljs) { + return { + aliases: ['pycon'], + contains: [ + { + className: 'meta', + starts: { + // a space separates the REPL prefix from the actual code + // this is purely for cleaner HTML output + end: / |$/, + starts: { + end: '$', subLanguage: 'python' + } + }, + variants: [ + { begin: /^>>>(?=[ ]|$)/ }, + { begin: /^\.\.\.(?=[ ]|$)/ } + ] + }, + ] + } +} diff --git a/test/detect/python-repl/default.txt b/test/detect/python-repl/default.txt new file mode 100644 index 0000000000..b37d31c482 --- /dev/null +++ b/test/detect/python-repl/default.txt @@ -0,0 +1,15 @@ +>>> v = "foo = 42" +>>> v +"foo = 42" +>>> print(v) +foo = 42 +>>> print(repr(v).rstrip('"')) +"foo = 42 +>>> print(repr(v).lstrip('"')) +foo = 42" + +>>> """ +... abc +... """ +>>> def test(): +... pass diff --git a/test/markup/python-repl/sample.expect.txt b/test/markup/python-repl/sample.expect.txt new file mode 100644 index 0000000000..d5695847b8 --- /dev/null +++ b/test/markup/python-repl/sample.expect.txt @@ -0,0 +1,17 @@ +>>> v = "foo = 42" +>>> v +"foo = 42" +>>> print(v) +foo = 42 +>>> print(repr(v).rstrip('"')) +"foo = 42 +>>> print(repr(v).lstrip('"')) +foo = 42" + +>>> """ +... abc +... """ +>>> def test(): +... pass +>>> +>>> diff --git a/test/markup/python-repl/sample.txt b/test/markup/python-repl/sample.txt new file mode 100644 index 0000000000..9789147228 --- /dev/null +++ b/test/markup/python-repl/sample.txt @@ -0,0 +1,17 @@ +>>> v = "foo = 42" +>>> v +"foo = 42" +>>> print(v) +foo = 42 +>>> print(repr(v).rstrip('"')) +"foo = 42 +>>> print(repr(v).lstrip('"')) +foo = 42" + +>>> """ +... abc +... """ +>>> def test(): +... pass +>>> +>>> From d2e749368d7f71c1951182d5865591cdbe04e08e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 23 Feb 2020 01:07:08 -0500 Subject: [PATCH 012/816] enh(fortran) Add support for FORTRAN 77 style comments (#2416) Closes #2310. --- CHANGES.md | 1 + src/languages/fortran.js | 60 ++++++++++++++++++------- test/markup/fortran/comments.expect.txt | 13 ++++++ test/markup/fortran/comments.txt | 13 ++++++ 4 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 test/markup/fortran/comments.expect.txt create mode 100644 test/markup/fortran/comments.txt diff --git a/CHANGES.md b/CHANGES.md index 263ab55bea..61271a7d2f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Core Changes: Language Improvements: +- enh(fortran) Support Fortran 77 style comments (#2416) [Josh Goebel][] - (csharp) add support for `@identifier` style identifiers (#2414) [Josh Goebel][] - fix(elixir) Support function names with a slash (#2406) [Josh Goebel][] - fix(javascript) comma is allowed in a "value container" (#2403) [Josh Goebel][] diff --git a/src/languages/fortran.js b/src/languages/fortran.js index 79de28a675..fc5ebeaa5f 100644 --- a/src/languages/fortran.js +++ b/src/languages/fortran.js @@ -6,12 +6,43 @@ Category: scientific */ export default function(hljs) { - var PARAMS = { + const PARAMS = { className: 'params', begin: '\\(', end: '\\)' }; - var F_KEYWORDS = { + const COMMENT = { + variants: [ + hljs.COMMENT('!', '$', {relevance: 0}), + // allow Fortran 77 style comments + hljs.COMMENT('^C', '$', {relevance: 0}) + ] + }; + + const NUMBER = { + className: 'number', + // regex in both fortran and irpf90 should match + begin: '(?=\\b|\\+|\\-|\\.)(?:\\.|\\d+\\.?)\\d*([de][+-]?\\d+)?(_[a-z_\\d]+)?', + relevance: 0 + }; + + const FUNCTION_DEF = { + className: 'function', + beginKeywords: 'subroutine function program', + illegal: '[${=\\n]', + contains: [hljs.UNDERSCORE_TITLE_MODE, PARAMS] + }; + + const STRING = { + className: 'string', + relevance: 0, + variants: [ + hljs.APOS_STRING_MODE, + hljs.QUOTE_STRING_MODE + ] + }; + + const KEYWORDS = { literal: '.False. .True.', keyword: 'kind do concurrent local shared while private call intrinsic where elsewhere ' + 'type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then block endblock endassociate ' + @@ -46,7 +77,7 @@ export default function(hljs) { 'set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer ' + 'dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ' + 'ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode ' + - 'is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of' + + 'is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of ' + 'acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 ' + 'atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits ' + 'bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr ' + @@ -56,24 +87,19 @@ export default function(hljs) { name: 'Fortran', case_insensitive: true, aliases: ['f90', 'f95'], - keywords: F_KEYWORDS, + keywords: KEYWORDS, illegal: /\/\*/, contains: [ - hljs.inherit(hljs.APOS_STRING_MODE, {className: 'string', relevance: 0}), - hljs.inherit(hljs.QUOTE_STRING_MODE, {className: 'string', relevance: 0}), + STRING, + FUNCTION_DEF, + // allow `C = value` for assignments so they aren't misdetected + // as Fortran 77 style comments { - className: 'function', - beginKeywords: 'subroutine function program', - illegal: '[${=\\n]', - contains: [hljs.UNDERSCORE_TITLE_MODE, PARAMS] + begin: /^C\s*=(?!=)/, + relevance: 0, }, - hljs.COMMENT('!', '$', {relevance: 0}), - { - className: 'number', - // regex in both fortran and irpf90 should match - begin: '(?=\\b|\\+|\\-|\\.)(?:\\.|\\d+\\.?)\\d*([de][+-]?\\d+)?(_[a-z_\\d]+)?', - relevance: 0 - } + COMMENT, + NUMBER ] }; } diff --git a/test/markup/fortran/comments.expect.txt b/test/markup/fortran/comments.expect.txt new file mode 100644 index 0000000000..ba78a37f63 --- /dev/null +++ b/test/markup/fortran/comments.expect.txt @@ -0,0 +1,13 @@ +C +C This program in FORTRAN 77 outputs "Hello, World!". +C ==================================================== + + !=============================== + ! This is a test subroutine + !=============================== + +! another comment + +C=2 +C = 2 !correct +C ='boo' diff --git a/test/markup/fortran/comments.txt b/test/markup/fortran/comments.txt new file mode 100644 index 0000000000..6127dbc32e --- /dev/null +++ b/test/markup/fortran/comments.txt @@ -0,0 +1,13 @@ +C +C This program in FORTRAN 77 outputs "Hello, World!". +C ==================================================== + + !=============================== + ! This is a test subroutine + !=============================== + +! another comment + +C=2 +C = 2 !correct +C ='boo' From 36e1e330bcd32ab7009fb89ac23cddeed4425ab2 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 23 Feb 2020 01:39:45 -0500 Subject: [PATCH 013/816] Add incorrect highlighting issue template (#2421) --- .../incorrect-syntax-highlighting.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/incorrect-syntax-highlighting.md diff --git a/.github/ISSUE_TEMPLATE/incorrect-syntax-highlighting.md b/.github/ISSUE_TEMPLATE/incorrect-syntax-highlighting.md new file mode 100644 index 0000000000..c1de92e6ab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/incorrect-syntax-highlighting.md @@ -0,0 +1,26 @@ +--- +name: Incorrect syntax highlighting +about: Report incorrect syntax highlighting... +title: "([language name]) Short description of issue..." +labels: language, bug, help welcome +assignees: '' + +--- + +**Describe the issue** +A clear and concise description of what the issue seems to be. + +**Which language seems to have the issue?** +Please specify exactly *which* language grammar you are using to highlight (`python`, `javascript`, etc.) or specify if you are using auto-detection. If you are using auto-detection please first check to make sure the language you are expecting was properly detected. If Highlight.js misidentifies the type of code - then the highlighting may be entirely incorrect - and there often isn't much we can do about that - auto-detection is only best-effort and can't guess right 100% of the time. + +**Sample Code to Reproduce** +Please include text examples of the code that fails to highlight properly or can reproduce the bug. You can attach a screenshot if you'd like, but the code is necessary because we may need to copy/paste it to help resolve the issue - or add it to a test. + +A jsfiddle can sometimes be even better. You can fork an example test case: +https://jsfiddle.net/ajoshguy/gfzujpyt/ + +**Expected behavior** +A clear and concise description of what you expected to happen. A screenshot might help here if another highlighting library gets it right, or is Github highlights it better/properly you can use a GitHub code block. + +**Additional context** +Add any other context about the problem here. From c8d7359ef5c22964fab08c28b32508d2483bdcc4 Mon Sep 17 00:00:00 2001 From: hmmwhatsthisdo Date: Sun, 23 Feb 2020 20:37:09 -0800 Subject: [PATCH 014/816] enh(powershell) Add PowerShell 5.1 default aliases as "built_in"s (#2423) * Add PowerShell 5.1 default aliases as "built_in"s * Add 'gerr' to PowerShell aliases (new in v6/v7) * Set `echo` relevance to 0 (fixes auto-detect conflict w/ shell) --- CHANGES.md | 2 ++ src/languages/powershell.js | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 61271a7d2f..7cd59cf3f2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -39,6 +39,7 @@ Language Improvements: - (fortran) Add Fortran 2018 keywords and coarray intrinsics (#2361) [Sam Miller][] - (delphi) highlight hexadecimal, octal, and binary numbers (#2370) [Robert Riebisch]() - enh(plaintext) added `text` and `txt` as alias (#2360) [Taufik Nurrohman][] +- enh(powershell) added PowerShell v5.1/v7 default aliases as "built_in"s (#2423) [Sean Williams][] Developer Tools: @@ -49,6 +50,7 @@ Developer Tools: [Robert Riebisch]: https://github.com/bttrx [Taufik Nurrohman]: https://github.com/taufik-nurrohman [Josh Goebel]: https://github.com/yyyc514 +[Sean Williams]: https://github.com/hmmwhatsthisdo ## Version 9.18.1 diff --git a/src/languages/powershell.js b/src/languages/powershell.js index e0e3ca7ccb..d0ffa2cace 100644 --- a/src/languages/powershell.js +++ b/src/languages/powershell.js @@ -38,7 +38,16 @@ export default function(hljs){ var KEYWORDS = { keyword: 'if else foreach return do while until elseif begin for trap data dynamicparam ' + 'end break throw param continue finally in switch exit filter try process catch ' + - 'hidden static parameter' + 'hidden static parameter', + // "echo" relevance has been set to 0 to avoid auto-detect conflicts with shell transcripts + built_in: 'ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp ' + + 'cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx ' + + 'fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group ' + + 'gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi ' + + 'iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh ' + + 'popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp ' + + 'rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp ' + + 'spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write' // TODO: 'validate[A-Z]+' can't work in keywords }; @@ -237,7 +246,7 @@ export default function(hljs){ return { name: 'PowerShell', aliases: ["ps", "ps1"], - lexemes: /-?[A-z\.\-]+/, + lexemes: /-?[A-z\.\-]+\b/, case_insensitive: true, keywords: KEYWORDS, contains: GENTLEMANS_SET.concat( From f97acb63c72d38c61b0daa231a9c451351567652 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 25 Feb 2020 12:30:10 -0500 Subject: [PATCH 015/816] (chore) Move supported languages into their own file (#2415) --- README.md | 196 +---------------------------------------- SUPPORTED_LANGUAGES.md | 193 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+), 192 deletions(-) create mode 100644 SUPPORTED_LANGUAGES.md diff --git a/README.md b/README.md index 766dc82a4e..c5896afbbb 100644 --- a/README.md +++ b/README.md @@ -50,198 +50,9 @@ To disable highlighting of a tag completely, use the `nohighlight` class: ### Supported Languages -The table below shows the full list of supported languages (and corresponding classes) that are bundled with the library. Note: Which languages are available may depend on how you've built or included the library in your app. See [Getting the Library](#getting-the-library) below. - -
-Reveal the full list of languages... - -| Language | Classes | Package | -| :-----------------------| :--------------------- | :------ | -| 1C | 1c | | -| 4D | 4d |[highlightjs-4d](https://github.com/highlightjs/highlightjs-4d) | -| ABNF | abnf | | -| Access logs | accesslog | | -| Ada | ada | | -| ARM assembler | armasm, arm | | -| AVR assembler | avrasm | | -| ActionScript | actionscript, as | | -| Alan | alan, i | [highlightjs-alan](https://github.com/highlightjs/highlightjs-alan) | -| AngelScript | angelscript, asc | | -| Apache | apache, apacheconf | | -| AppleScript | applescript, osascript | | -| Arcade | arcade | | -| AsciiDoc | asciidoc, adoc | | -| AspectJ | aspectj | | -| AutoHotkey | autohotkey | | -| AutoIt | autoit | | -| Awk | awk, mawk, nawk, gawk | | -| Axapta | axapta | | -| Bash | bash, sh, zsh | | -| Basic | basic | | -| BNF | bnf | | -| Brainfuck | brainfuck, bf | | -| C# | csharp, cs | | -| C | h | | -| C++ | cpp, hpp, cc, hh, c++, h++, cxx, hxx | | -| C/AL | cal | | -| Cache Object Script | cos, cls | | -| CMake | cmake, cmake.in | | -| Coq | coq | | -| CSP | csp | | -| CSS | css | | -| Cap’n Proto | capnproto, capnp | | -| Clojure | clojure, clj | | -| CoffeeScript | coffeescript, coffee, cson, iced | | -| Crmsh | crmsh, crm, pcmk | | -| Crystal | crystal, cr | | -| Cypher (Neo4j) | cypher | [highlightjs-cypher](https://github.com/highlightjs/highlightjs-cypher) | -| D | d | | -| DNS Zone file | dns, zone, bind | | -| DOS | dos, bat, cmd | | -| Dart | dart | | -| Delphi | delphi, dpr, dfm, pas, pascal, freepascal, lazarus, lpr, lfm | | -| Diff | diff, patch | | -| Django | django, jinja | | -| Dockerfile | dockerfile, docker | | -| dsconfig | dsconfig | | -| DTS (Device Tree) | dts | | -| Dust | dust, dst | | -| Dylan | dylan | [highlight-dylan](https://github.com/highlightjs/highlight-dylan) | -| EBNF | ebnf | | -| Elixir | elixir | | -| Elm | elm | | -| Erlang | erlang, erl | | -| Excel | excel, xls, xlsx | | -| Extempore | extempore, xtlang, xtm | [highlightjs-xtlang](https://github.com/highlightjs/highlightjs-xtlang) | -| F# | fsharp, fs | | -| FIX | fix | | -| Fortran | fortran, f90, f95 | | -| G-Code | gcode, nc | | -| Gams | gams, gms | | -| GAUSS | gauss, gss | | -| GDScript | godot, gdscript | [highlightjs-gdscript](https://github.com/highlightjs/highlightjs-gdscript) | -| Gherkin | gherkin | | -| GN for Ninja | gn, gni | [highlightjs-GN](https://github.com/highlightjs/highlightjs-GN/blob/master/gn.js) | -| Go | go, golang | | -| Grammatical Framework | gf | [highlightjs-gf](https://github.com/johnjcamilleri/highlightjs-gf) | -| Golo | golo, gololang | | -| Gradle | gradle | | -| Groovy | groovy | | -| HTML, XML | xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist, svg | | -| HTTP | http, https | | -| Haml | haml | | -| Handlebars | handlebars, hbs, html.hbs, html.handlebars | | -| Haskell | haskell, hs | | -| Haxe | haxe, hx | | -| Hy | hy, hylang | | -| Ini, TOML | ini, toml | | -| Inform7 | inform7, i7 | | -| IRPF90 | irpf90 | | -| JSON | json | | -| Java | java, jsp | | -| JavaScript | javascript, js, jsx | | -| Kotlin | kotlin, kt | | -| LaTeX | tex | | -| Leaf | leaf | | -| Lasso | lasso, ls, lassoscript | | -| Less | less | | -| LDIF | ldif | | -| Lisp | lisp | | -| LiveCode Server | livecodeserver | | -| LiveScript | livescript, ls | | -| Lua | lua | | -| Makefile | makefile, mk, mak | | -| Markdown | markdown, md, mkdown, mkd | | -| Mathematica | mathematica, mma, wl | | -| Matlab | matlab | | -| Maxima | maxima | | -| Maya Embedded Language | mel | | -| Mercury | mercury | | -| mIRC Scripting Language | mirc, mrc | [highlightjs-mirc](https://github.com/highlightjs/highlightjs-mirc) | -| Mizar | mizar | | -| Mojolicious | mojolicious | | -| Monkey | monkey | | -| Moonscript | moonscript, moon | | -| N1QL | n1ql | | -| NSIS | nsis | | -| Nginx | nginx, nginxconf | | -| Nim | nimrod | | -| Nix | nix | | -| OCaml | ocaml, ml | | -| Objective C | objectivec, mm, objc, obj-c | | -| OpenGL Shading Language | glsl | | -| OpenSCAD | openscad, scad | | -| Oracle Rules Language | ruleslanguage | | -| Oxygene | oxygene | | -| PF | pf, pf.conf | | -| PHP | php, php3, php4, php5, php6, php7 | | -| Parser3 | parser3 | | -| Perl | perl, pl, pm | | -| Plaintext | plaintext, txt, text | | -| Pony | pony | | -| PostgreSQL & PL/pgSQL | pgsql, postgres, postgresql | | -| PowerShell | powershell, ps, ps1 | | -| Processing | processing | | -| Prolog | prolog | | -| Properties | properties | | -| Protocol Buffers | protobuf | | -| Puppet | puppet, pp | | -| Python | python, py, gyp | | -| Python profiler results | profile | | -| Q | k, kdb | | -| QML | qml | | -| R | r | | -| Razor CSHTML | cshtml, razor, razor-cshtml | [highlightjs-cshtml-razor](https://github.com/highlightjs/highlightjs-cshtml-razor) | -| ReasonML | reasonml, re | | -| RenderMan RIB | rib | | -| RenderMan RSL | rsl | | -| Roboconf | graph, instances | | -| Robot Framework | robot, rf | [highlightjs-robot](https://github.com/highlightjs/highlightjs-robot) | -| 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 | | -| SAS | SAS, sas | | -| SCSS | scss | | -| SQL | sql | | -| STEP Part 21 | p21, step, stp | | -| Scala | scala | | -| Scheme | scheme | | -| Scilab | scilab, sci | | -| Shape Expressions | shexc | [highlightjs-shexc](https://github.com/highlightjs/highlightjs-shexc) | -| Shell | shell, console | | -| Smali | smali | | -| Smalltalk | smalltalk, st | | -| Solidity | solidity, sol | [highlightjs-solidity](https://github.com/highlightjs/highlightjs-solidity) | -| Stan | stan, stanfuncs | | -| Stata | stata | | -| Structured Text | iecst, scl, stl, structured-text | [highlightjs-structured-text](https://github.com/highlightjs/highlightjs-structured-text) | -| Stylus | stylus, styl | | -| SubUnit | subunit | | -| Supercollider | supercollider, sc | [highlightjs-supercollider](https://github.com/highlightjs/highlightjs-supercollider) | -| Swift | swift | | -| Tcl | tcl, tk | | -| Terraform (HCL) | terraform, tf, hcl | [highlightjs-terraform](https://github.com/highlightjs/highlightjs-terraform) | -| Test Anything Protocol | tap | | -| Thrift | thrift | | -| TP | tp | | -| Twig | twig, craftcms | | -| TypeScript | typescript, ts | | -| VB.Net | vbnet, vb | | -| VBScript | vbscript, vbs | | -| VHDL | vhdl | | -| Vala | vala | | -| Verilog | verilog, v | | -| Vim Script | vim | | -| x86 Assembly | x86asm | | -| XL | xl, tao | | -| XQuery | xquery, xpath, xq | | -| YAML | yml, yaml | | -| Zephir | zephir, zep | | - -Languages with the specified package name are defined in separate repositories -and not included in `highlight.min.js`. -
- +Highlight.js supports over 180 different languages in the core library. There are also 3rd party +language plugins available for additional languages. You can find the full list of supported languages +in [SUPPORTED_LANGUAGES.md][9]. ## Custom Initialization @@ -407,3 +218,4 @@ Authors and contributors are listed in the [AUTHORS.txt][8] file. [6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html [7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE [8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.txt +[9]: https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md new file mode 100644 index 0000000000..8cfa294f8e --- /dev/null +++ b/SUPPORTED_LANGUAGES.md @@ -0,0 +1,193 @@ +# Supported Languages + +The table below shows the full list of supported languages (and corresponding classes/aliases). Note: Which languages are available may depend on how you've built or included the library in your app. See [Getting the Library][1] in the README. + +Languages that listed a **Package** below are 3rd party languages and are not bundled with the core library. You can find their repositories by following the links. + + +| Language | Classes | Package | +| :-----------------------| :--------------------- | :------ | +| 1C | 1c | | +| 4D | 4d |[highlightjs-4d](https://github.com/highlightjs/highlightjs-4d) | +| ABNF | abnf | | +| Access logs | accesslog | | +| Ada | ada | | +| ARM assembler | armasm, arm | | +| AVR assembler | avrasm | | +| ActionScript | actionscript, as | | +| Alan | alan, i | [highlightjs-alan](https://github.com/highlightjs/highlightjs-alan) | +| AngelScript | angelscript, asc | | +| Apache | apache, apacheconf | | +| AppleScript | applescript, osascript | | +| Arcade | arcade | | +| AsciiDoc | asciidoc, adoc | | +| AspectJ | aspectj | | +| AutoHotkey | autohotkey | | +| AutoIt | autoit | | +| Awk | awk, mawk, nawk, gawk | | +| Axapta | axapta | | +| Bash | bash, sh, zsh | | +| Basic | basic | | +| BNF | bnf | | +| Brainfuck | brainfuck, bf | | +| C# | csharp, cs | | +| C | h | | +| C++ | cpp, hpp, cc, hh, c++, h++, cxx, hxx | | +| C/AL | cal | | +| Cache Object Script | cos, cls | | +| CMake | cmake, cmake.in | | +| Coq | coq | | +| CSP | csp | | +| CSS | css | | +| Cap’n Proto | capnproto, capnp | | +| Clojure | clojure, clj | | +| CoffeeScript | coffeescript, coffee, cson, iced | | +| Crmsh | crmsh, crm, pcmk | | +| Crystal | crystal, cr | | +| Cypher (Neo4j) | cypher | [highlightjs-cypher](https://github.com/highlightjs/highlightjs-cypher) | +| D | d | | +| DNS Zone file | dns, zone, bind | | +| DOS | dos, bat, cmd | | +| Dart | dart | | +| Delphi | delphi, dpr, dfm, pas, pascal, freepascal, lazarus, lpr, lfm | | +| Diff | diff, patch | | +| Django | django, jinja | | +| Dockerfile | dockerfile, docker | | +| dsconfig | dsconfig | | +| DTS (Device Tree) | dts | | +| Dust | dust, dst | | +| Dylan | dylan | [highlight-dylan](https://github.com/highlightjs/highlight-dylan) | +| EBNF | ebnf | | +| Elixir | elixir | | +| Elm | elm | | +| Erlang | erlang, erl | | +| Excel | excel, xls, xlsx | | +| Extempore | extempore, xtlang, xtm | [highlightjs-xtlang](https://github.com/highlightjs/highlightjs-xtlang) | +| F# | fsharp, fs | | +| FIX | fix | | +| Fortran | fortran, f90, f95 | | +| G-Code | gcode, nc | | +| Gams | gams, gms | | +| GAUSS | gauss, gss | | +| GDScript | godot, gdscript | [highlightjs-gdscript](https://github.com/highlightjs/highlightjs-gdscript) | +| Gherkin | gherkin | | +| GN for Ninja | gn, gni | [highlightjs-GN](https://github.com/highlightjs/highlightjs-GN/blob/master/gn.js) | +| Go | go, golang | | +| Grammatical Framework | gf | [highlightjs-gf](https://github.com/johnjcamilleri/highlightjs-gf) | +| Golo | golo, gololang | | +| Gradle | gradle | | +| Groovy | groovy | | +| HTML, XML | xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist, svg | | +| HTTP | http, https | | +| Haml | haml | | +| Handlebars | handlebars, hbs, html.hbs, html.handlebars | | +| Haskell | haskell, hs | | +| Haxe | haxe, hx | | +| Hy | hy, hylang | | +| Ini, TOML | ini, toml | | +| Inform7 | inform7, i7 | | +| IRPF90 | irpf90 | | +| JSON | json | | +| Java | java, jsp | | +| JavaScript | javascript, js, jsx | | +| Kotlin | kotlin, kt | | +| LaTeX | tex | | +| Leaf | leaf | | +| Lasso | lasso, ls, lassoscript | | +| Less | less | | +| LDIF | ldif | | +| Lisp | lisp | | +| LiveCode Server | livecodeserver | | +| LiveScript | livescript, ls | | +| Lua | lua | | +| Makefile | makefile, mk, mak | | +| Markdown | markdown, md, mkdown, mkd | | +| Mathematica | mathematica, mma, wl | | +| Matlab | matlab | | +| Maxima | maxima | | +| Maya Embedded Language | mel | | +| Mercury | mercury | | +| mIRC Scripting Language | mirc, mrc | [highlightjs-mirc](https://github.com/highlightjs/highlightjs-mirc) | +| Mizar | mizar | | +| Mojolicious | mojolicious | | +| Monkey | monkey | | +| Moonscript | moonscript, moon | | +| N1QL | n1ql | | +| NSIS | nsis | | +| Nginx | nginx, nginxconf | | +| Nim | nimrod | | +| Nix | nix | | +| OCaml | ocaml, ml | | +| Objective C | objectivec, mm, objc, obj-c | | +| OpenGL Shading Language | glsl | | +| OpenSCAD | openscad, scad | | +| Oracle Rules Language | ruleslanguage | | +| Oxygene | oxygene | | +| PF | pf, pf.conf | | +| PHP | php, php3, php4, php5, php6, php7 | | +| Parser3 | parser3 | | +| Perl | perl, pl, pm | | +| Plaintext | plaintext, txt, text | | +| Pony | pony | | +| PostgreSQL & PL/pgSQL | pgsql, postgres, postgresql | | +| PowerShell | powershell, ps, ps1 | | +| Processing | processing | | +| Prolog | prolog | | +| Properties | properties | | +| Protocol Buffers | protobuf | | +| Puppet | puppet, pp | | +| Python | python, py, gyp | | +| Python profiler results | profile | | +| Q | k, kdb | | +| QML | qml | | +| R | r | | +| Razor CSHTML | cshtml, razor, razor-cshtml | [highlightjs-cshtml-razor](https://github.com/highlightjs/highlightjs-cshtml-razor) | +| ReasonML | reasonml, re | | +| RenderMan RIB | rib | | +| RenderMan RSL | rsl | | +| Roboconf | graph, instances | | +| Robot Framework | robot, rf | [highlightjs-robot](https://github.com/highlightjs/highlightjs-robot) | +| 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 | | +| SAS | SAS, sas | | +| SCSS | scss | | +| SQL | sql | | +| STEP Part 21 | p21, step, stp | | +| Scala | scala | | +| Scheme | scheme | | +| Scilab | scilab, sci | | +| Shape Expressions | shexc | [highlightjs-shexc](https://github.com/highlightjs/highlightjs-shexc) | +| Shell | shell, console | | +| Smali | smali | | +| Smalltalk | smalltalk, st | | +| Solidity | solidity, sol | [highlightjs-solidity](https://github.com/highlightjs/highlightjs-solidity) | +| Stan | stan, stanfuncs | | +| Stata | stata | | +| Structured Text | iecst, scl, stl, structured-text | [highlightjs-structured-text](https://github.com/highlightjs/highlightjs-structured-text) | +| Stylus | stylus, styl | | +| SubUnit | subunit | | +| Supercollider | supercollider, sc | [highlightjs-supercollider](https://github.com/highlightjs/highlightjs-supercollider) | +| Swift | swift | | +| Tcl | tcl, tk | | +| Terraform (HCL) | terraform, tf, hcl | [highlightjs-terraform](https://github.com/highlightjs/highlightjs-terraform) | +| Test Anything Protocol | tap | | +| Thrift | thrift | | +| TP | tp | | +| Twig | twig, craftcms | | +| TypeScript | typescript, ts | | +| VB.Net | vbnet, vb | | +| VBScript | vbscript, vbs | | +| VHDL | vhdl | | +| Vala | vala | | +| Verilog | verilog, v | | +| Vim Script | vim | | +| x86 Assembly | x86asm | | +| XL | xl, tao | | +| XQuery | xquery, xpath, xq | | +| YAML | yml, yaml | | +| Zephir | zephir, zep | | + + + +[1]: https://github.com/highlightjs/highlight.js#getting-the-library From 51a7af41a2d19b65e85001f4098bc4dfe3b318ba Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 25 Feb 2020 15:49:11 -0500 Subject: [PATCH 016/816] enh(clojure) Adds global definitions with class name `title` (#2419) Adds support for Clojure global definitions with class name `title`, including: * def * defonce * defprotocol * defstruct * defmulti * defmethod * defn * defn- * defmacro * deftype * defrecord Original PR work by Alexandre Grison. Co-authored-by: Alexandre Grison --- AUTHORS.txt | 1 + CHANGES.md | 2 + src/languages/clojure.js | 76 +++++++++++-------- .../clojure/globals_definition.expect.txt | 61 +++++++++++++++ test/markup/clojure/globals_definition.txt | 61 +++++++++++++++ test/markup/clojure/hint_col.expect.txt | 2 +- .../markup/clojure/symbols-numbers.expect.txt | 2 +- 7 files changed, 173 insertions(+), 32 deletions(-) create mode 100644 test/markup/clojure/globals_definition.expect.txt create mode 100644 test/markup/clojure/globals_definition.txt diff --git a/AUTHORS.txt b/AUTHORS.txt index e86ed42e79..799acc064a 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -285,3 +285,4 @@ Contributors: - Thomas Reichel - G8t Guy - Samia Ali +- Alexandre Grison diff --git a/CHANGES.md b/CHANGES.md index 7cd59cf3f2..a01cf8dc94 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Core Changes: Language Improvements: +- enh(clojure) Add support for global definitions name (#2347) [Alexandre Grison][] - enh(fortran) Support Fortran 77 style comments (#2416) [Josh Goebel][] - (csharp) add support for `@identifier` style identifiers (#2414) [Josh Goebel][] - fix(elixir) Support function names with a slash (#2406) [Josh Goebel][] @@ -45,6 +46,7 @@ Developer Tools: - added Dockerfile for optionally developing with a container +[Alexandre Grison]: https://github.com/agrison [Josh Goebel]: https://github.com/yyyc514 [Sam Miller]: https://github.com/smillerc [Robert Riebisch]: https://github.com/bttrx diff --git a/src/languages/clojure.js b/src/languages/clojure.js index d1e732ca0e..00501124f2 100644 --- a/src/languages/clojure.js +++ b/src/languages/clojure.js @@ -2,43 +2,44 @@ Language: Clojure Description: Clojure syntax (based on lisp.js) Author: mfornos -Contributors: Martin Clausen Website: https://clojure.org Category: lisp */ export default function(hljs) { + var globals = 'def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord'; var keywords = { 'builtin-name': // Clojure keywords - 'def defonce cond apply if-not if-let if not not= = < > <= >= == + / * - rem '+ - 'quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? '+ - 'set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? '+ - 'class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? '+ - 'string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . '+ - 'inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last '+ - 'drop-while while intern condp case reduced cycle split-at split-with repeat replicate '+ - 'iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext '+ - 'nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends '+ - 'add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler '+ - 'set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter '+ - 'monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or '+ - 'when when-not when-let comp juxt partial sequence memoize constantly complement identity assert '+ - 'peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast '+ - 'sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import '+ - 'refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! '+ - 'assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger '+ - 'bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline '+ - 'flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking '+ - 'assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! '+ - 'reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! '+ - 'new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty '+ - 'hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list '+ - 'disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer '+ - 'chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate '+ - 'unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta '+ + globals + ' ' + + 'cond apply if-not if-let if not not= = < > <= >= == + / * - rem ' + + 'quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? ' + + 'set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? ' + + 'class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? ' + + 'string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . ' + + 'inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last ' + + 'drop-while while intern condp case reduced cycle split-at split-with repeat replicate ' + + 'iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext ' + + 'nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends ' + + 'add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler ' + + 'set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter ' + + 'monitor-exit macroexpand macroexpand-1 for dosync and or ' + + 'when when-not when-let comp juxt partial sequence memoize constantly complement identity assert ' + + 'peek pop doto proxy first rest cons cast coll last butlast ' + + 'sigs reify second ffirst fnext nfirst nnext meta with-meta ns in-ns create-ns import ' + + 'refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! ' + + 'assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger ' + + 'bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline ' + + 'flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking ' + + 'assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! ' + + 'reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! ' + + 'new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty ' + + 'hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list ' + + 'disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer ' + + 'chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate ' + + 'unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta ' + 'lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize' - }; + }; var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\''; var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*'; @@ -91,7 +92,22 @@ export default function(hljs) { }; var DEFAULT_CONTAINS = [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL, SYMBOL]; - LIST.contains = [hljs.COMMENT('comment', ''), NAME, BODY]; + var GLOBAL = { + beginKeywords: globals, + end: '(\\[|\\#|\\d|"|:|\\{|\\)|\\(|$)', + contains: [ + { + className: 'title', + begin: SYMBOL_RE, + relevance: 0, + excludeEnd: true, + // we can only have a single title + endsParent: true + }, + ].concat(DEFAULT_CONTAINS) + }; + + LIST.contains = [hljs.COMMENT('comment', ''), GLOBAL, NAME, BODY]; BODY.contains = DEFAULT_CONTAINS; COLLECTION.contains = DEFAULT_CONTAINS; HINT_COL.contains = [COLLECTION]; @@ -101,5 +117,5 @@ export default function(hljs) { aliases: ['clj'], illegal: /\S/, contains: [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL] - } + }; } diff --git a/test/markup/clojure/globals_definition.expect.txt b/test/markup/clojure/globals_definition.expect.txt new file mode 100644 index 0000000000..dcc6cd11fe --- /dev/null +++ b/test/markup/clojure/globals_definition.expect.txt @@ -0,0 +1,61 @@ +(ns playground + (:require + [clojure.string :as str])) + +; function +(defn clojure-function [args] + (let [string "multiline\nstring" + regexp #"regexp" + number 100,000 + booleans [false true] + keyword ::the-keyword] + ;; this is comment + (if true + (->> + (list [vector] {:map map} #{'set}))))) + +; global +(def some-var) +; another one +(def alternative-var "132") +; defonce +(defonce ^:private another-var #"foo") + +; private function +(defn- add [x y] (+ x y)) + +; protocols +(defprotocol Fly + "A simple protocol for flying" + (fly [this] "Method to fly")) + +(defrecord Bird [name species] + Fly + (fly [this] (str (:name this) " flies..."))) + +; multimethods +(defmulti service-charge (fn [acct] [(account-level acct) (:tag acct)])) +(defmethod service-charge [::acc/Basic ::acc/Checking] [_] 25) +(defmethod service-charge [::acc/Basic ::acc/Savings] [_] 10) +(defmethod service-charge [::acc/Premium ::acc/Account] [_] 0) + +; macros +(defmacro unless [pred a b] + `(if (not ~pred) ~a ~b)) + +(unless false (println "Will print") (println "Will not print")) + +; types +(deftype Circle [radius]) +(deftype Square [length width]) + +;; multimethods again +(defmulti area class) +(defmethod area Circle [c] + (* Math/PI (* (.radius c) (.radius c)))) +(defmethod area Square [s] + (* (.length s) (.width s))) + +;; create a couple shapes and get their area +(def myCircle (Circle. 10)) +(def mySquare (Square. 5 11)) diff --git a/test/markup/clojure/globals_definition.txt b/test/markup/clojure/globals_definition.txt new file mode 100644 index 0000000000..6faeee7942 --- /dev/null +++ b/test/markup/clojure/globals_definition.txt @@ -0,0 +1,61 @@ +(ns playground + (:require + [clojure.string :as str])) + +; function +(defn clojure-function [args] + (let [string "multiline\nstring" + regexp #"regexp" + number 100,000 + booleans [false true] + keyword ::the-keyword] + ;; this is comment + (if true + (->> + (list [vector] {:map map} #{'set}))))) + +; global +(def some-var) +; another one +(def alternative-var "132") +; defonce +(defonce ^:private another-var #"foo") + +; private function +(defn- add [x y] (+ x y)) + +; protocols +(defprotocol Fly + "A simple protocol for flying" + (fly [this] "Method to fly")) + +(defrecord Bird [name species] + Fly + (fly [this] (str (:name this) " flies..."))) + +; multimethods +(defmulti service-charge (fn [acct] [(account-level acct) (:tag acct)])) +(defmethod service-charge [::acc/Basic ::acc/Checking] [_] 25) +(defmethod service-charge [::acc/Basic ::acc/Savings] [_] 10) +(defmethod service-charge [::acc/Premium ::acc/Account] [_] 0) + +; macros +(defmacro unless [pred a b] + `(if (not ~pred) ~a ~b)) + +(unless false (println "Will print") (println "Will not print")) + +; types +(deftype Circle [radius]) +(deftype Square [length width]) + +;; multimethods again +(defmulti area class) +(defmethod area Circle [c] + (* Math/PI (* (.radius c) (.radius c)))) +(defmethod area Square [s] + (* (.length s) (.width s))) + +;; create a couple shapes and get their area +(def myCircle (Circle. 10)) +(def mySquare (Square. 5 11)) diff --git a/test/markup/clojure/hint_col.expect.txt b/test/markup/clojure/hint_col.expect.txt index 06e96c00c3..fd61cae7dd 100644 --- a/test/markup/clojure/hint_col.expect.txt +++ b/test/markup/clojure/hint_col.expect.txt @@ -4,7 +4,7 @@ (definterface Foo (foo [])) ;; annotation on type -(deftype ^{Deprecated true +(deftype ^{Deprecated true Retention RetentionPolicy/RUNTIME javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] javax.xml.ws.soap.Addressing {:enabled false :required true} diff --git a/test/markup/clojure/symbols-numbers.expect.txt b/test/markup/clojure/symbols-numbers.expect.txt index f9c48b2039..87595d111b 100644 --- a/test/markup/clojure/symbols-numbers.expect.txt +++ b/test/markup/clojure/symbols-numbers.expect.txt @@ -1 +1 @@ -(def +x [(a 1) +2 -3.0 y-5]) +(def +x [(a 1) +2 -3.0 y-5]) From 0a5bbe4a8e87c791a86cbc47418b0570bb659f15 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 25 Feb 2020 16:44:16 -0500 Subject: [PATCH 017/816] add(php-template) Explicit language to detect PHP templates (#2417) - Adds a separate language to detect PHP templates to avoid overloading `xml` XML never should have built-in PHP support in the first place as there are any number of templating languages out there, and they all can't be built into XML. This rectifies that situation. --- CHANGES.md | 1 + VERSION_10_BREAKING.md | 5 +++++ src/languages/php-template.js | 30 +++++++++++++++++++++++++++ src/languages/php.js | 7 ++++++- src/languages/xml.js | 13 ------------ test/detect/php-template/default.txt | 8 +++++++ test/fixtures/expect/sublanguages.txt | 3 ++- 7 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 src/languages/php-template.js create mode 100644 test/detect/php-template/default.txt diff --git a/CHANGES.md b/CHANGES.md index a01cf8dc94..67631e65a2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ New languages: +- (php-template) Explicit language to detect PHP templates (vs xml) [Josh Goebel][] - enh(python) Added `python-repl` for Python REPL sessions New themes: diff --git a/VERSION_10_BREAKING.md b/VERSION_10_BREAKING.md index 0d67efda1f..11a0ac99a6 100644 --- a/VERSION_10_BREAKING.md +++ b/VERSION_10_BREAKING.md @@ -1,13 +1,16 @@ ## Version 10 Breaking Changes Incompatibilities: + - chore(parser): compressed version 9.x language definitions no longer supported (rebuild them minified) [Josh Goebel][] - `nohightlight` and `no-highlight` are the only "ignore me" css classes now (`plain` and `text` no longer count) (to get the old behavior you can customize `noHighlightRe`) - a grammar with a top-level `self` reference will now always throw an error (previously in safe mode this would be silently ignored) +- PHP templates are now detected as `php-template`, not `xml` Renamed Language Files: + - chore(parser): rename `nimrod.js` to `nim.js` [Josh Goebel][] - chore(parser): rename `cs.js` to `csharp.js` [Josh Goebel][] - chore(parser): rename `tex.js` to `latex.js` [Josh Goebel][] @@ -19,11 +22,13 @@ Renamed Language Files: (https://github.com/highlightjs/highlight.js/issues/2146) Legacy Browser Issues: + - **We're now using ES2015 features in the codebase. Internet Explorer 11 is no longer supported.** - In general legacy browsers are no longer supported. - chore(parser): remove `load` listener in favor of only the newer `DOMContentLoaded` [Josh Goebel][] Removed styles: + - chore(styles): darkula.css (use darcula.css instead) [Josh Goebel][] [Josh Goebel]: https://github.com/yyyc514 diff --git a/src/languages/php-template.js b/src/languages/php-template.js new file mode 100644 index 0000000000..dfebbf6be5 --- /dev/null +++ b/src/languages/php-template.js @@ -0,0 +1,30 @@ +/* +Language: PHP Template +Requires: xml.js, php.js +Author: Josh Goebel +Website: https://www.php.net +Category: common +*/ + +export default function(hljs) { + return { + name: "PHP template", + subLanguage: 'xml', + contains: [ + { + begin: /<\?(php|=)?/, + end: /\?>/, + subLanguage: 'php', + contains: [ + // We don't want the php closing tag ?> to close the PHP block when + // inside any of the following blocks: + {begin: '/\\*', end: '\\*/', skip: true}, + {begin: 'b"', end: '"', skip: true}, + {begin: 'b\'', end: '\'', skip: true}, + hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null, className: null, contains: null, skip: true}), + hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null, className: null, contains: null, skip: true}) + ] + } + ] + }; +} diff --git a/src/languages/php.js b/src/languages/php.js index a199a65433..752bc448df 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -11,7 +11,12 @@ export default function(hljs) { begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' }; var PREPROCESSOR = { - className: 'meta', begin: /<\?(php|=)?|\?>/ + className: 'meta', + variants: [ + { begin: /<\?php/, relevance: 10 }, // boost for obvious PHP + { begin: /<\?[=]?/ }, + { begin: /\?>/ } // end php tag + ] }; var STRING = { className: 'string', diff --git a/src/languages/xml.js b/src/languages/xml.js index d9dee3e2f9..1b49fef5c1 100644 --- a/src/languages/xml.js +++ b/src/languages/xml.js @@ -97,19 +97,6 @@ export default function(hljs) { className: 'meta', begin: /<\?xml/, end: /\?>/, relevance: 10 }, - { - begin: /<\?(php)?/, end: /\?>/, - subLanguage: 'php', - contains: [ - // We don't want the php closing tag ?> to close the PHP block when - // inside any of the following blocks: - {begin: '/\\*', end: '\\*/', skip: true}, - {begin: 'b"', end: '"', skip: true}, - {begin: 'b\'', end: '\'', skip: true}, - hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null, className: null, contains: null, skip: true}), - hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null, className: null, contains: null, skip: true}) - ] - }, { className: 'tag', /* diff --git a/test/detect/php-template/default.txt b/test/detect/php-template/default.txt new file mode 100644 index 0000000000..d01ad4a791 --- /dev/null +++ b/test/detect/php-template/default.txt @@ -0,0 +1,8 @@ + + + + + diff --git a/test/fixtures/expect/sublanguages.txt b/test/fixtures/expect/sublanguages.txt index 2a89d6ae2d..9c5be2499d 100644 --- a/test/fixtures/expect/sublanguages.txt +++ b/test/fixtures/expect/sublanguages.txt @@ -1,4 +1,5 @@ -<? echo 'php'; /* ?> */ ?> +<? echo 'php'; /* ?> */ ?> <body> <script>document.write('Legacy code');</script> </body> + From ae18d9cd4647cdf1fbb9457542953e78c7a3fe74 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 25 Feb 2020 16:54:58 -0500 Subject: [PATCH 018/816] (chore) update language contribution guidelines (#2427) --- docs/language-contribution.rst | 49 ++++++++++++++++++++++------------ docs/language-requests.rst | 12 ++++----- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/docs/language-contribution.rst b/docs/language-contribution.rst index 614e816339..f492becb4e 100644 --- a/docs/language-contribution.rst +++ b/docs/language-contribution.rst @@ -1,17 +1,25 @@ Language contributor checklist ============================== -1. Put language definition into a .js file +1. Read ``extra/3RD_PARTY_QUICK_START.md`` ------------------------------------------ +It contains rough high-level steps for creating a 3rd party language grammar for Highlight.js. + + +2. Create a language grammar definition file +-------------------------------------------- + The file defines a function accepting a reference to the library and returning a language object. -The library parameter is useful to access common modes and regexps. You should not immediately call this function, -this is done during the build process and details differ for different build targets. +The library parameter (``hljs``) is useful to access common modes and regexps. You should not +immediately call this function (you only need to export it). Calling it is handled by the build +process and details differ for different build targets. :: - function(hljs) { + export default function(hljs) { return { + name: "Language Name", keywords: 'foo bar', contains: [ ..., hljs.NUMBER_MODE, ... ] } @@ -20,8 +28,8 @@ this is done during the build process and details differ for different build tar The name of the file is used as a short language identifier and should be usable as a class name in HTML and CSS. -2. Provide meta data --------------------- +3. Add language metadata +---------------------------- At the top of the file there is a specially formatted comment with meta data processed by a build system. Meta data format is simply key-value pairs each occupying its own line: @@ -34,6 +42,7 @@ Meta data format is simply key-value pairs each occupying its own line: Author: John Smith Contributors: Mike Johnson <...@...>, Matt Wilson <...@...> Description: Some cool language definition + Website: https://superlanguage.example.com */ ``Language`` — the only required header giving a human-readable language name. @@ -44,10 +53,10 @@ Required files aren't processed in any special way. The build system just makes sure that they will be in the final package in ``LANGUAGES`` object. -The meaning of the other headers is pretty obvious. +The meaning of the other headers should be pretty obvious. -3. Create a code example +4. Create a code example ------------------------ The code example is used both to test language detection and for the demo page @@ -57,21 +66,27 @@ Take inspiration from other languages in ``test/detect/`` and read :ref:`testing instructions ` for more details. -4. Write class reference ------------------------- +5. Write a class reference if your class uses custom classes +------------------------------------------------------------ + +A class reference document should typically be placed at the root of your +language repository: ``css-class-reference.md`` -Class reference lives in the :doc:`CSS classes reference `.. Describe shortly names of all meaningful modes used in your language definition. +Note: If you use custom classes please be aware that all the build-in themes +are not going to support your custom classes and you should likely also +distribute your own custom theme. + -5. Add yourself to AUTHORS.*.txt and CHANGES.md ------------------------------------------------ +6. Request a repository at the ``highlightjs`` organization +---------------------------------------------------------- -If you're a new contributor add yourself to the authors list. -Also it will be good to update CHANGES.md. +*This is optional.* Of course you are free to host your repository anywhere +you would like. -6. Create a pull request +7. Create a pull request ------------------------ -Send your contribution as a pull request on GitHub. +Submit a PR to add your language to `SUPPORTED_LANGUAGES.md`. diff --git a/docs/language-requests.rst b/docs/language-requests.rst index 4e4c2f0b61..cccf990b23 100644 --- a/docs/language-requests.rst +++ b/docs/language-requests.rst @@ -5,13 +5,13 @@ This is a general answer to requests for adding new languages that appear from time to time in the highlight.js issue tracker and discussion group. Highlight.js doesn't have a fundamental plan for implementing languages, - instead the project works by accepting language definitions from - interested contributors. There are also no rules at the moment forbidding - any languages from being added to the library, no matter how obscure or - weird. + instead the project works by encouraging develoment of 3rd party language + grammars from contributors. We're also happy to host 3rd party language + grammars at the ``highlightjs`` GitHub organization - no matter how obscure + or weird. - This means that there's no point in requesting a new language without - providing an implementation for it. If you want to see a particular language + This means that *there's no point in requesting a new language without + providing an implementation for it*. If you want to see a particular language included in highlight.js but cannot implement it, the best way to make it happen is to get another developer interested in doing so. Here's our :doc:`language-guide`. From ec0ec9b6dcad60c964575667345c20f27027262c Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 28 Feb 2020 14:44:54 -0500 Subject: [PATCH 019/816] (chore) simplify BNF grammar --- src/languages/bnf.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/languages/bnf.js b/src/languages/bnf.js index 1b9baf4640..2f9fca8660 100644 --- a/src/languages/bnf.js +++ b/src/languages/bnf.js @@ -16,19 +16,17 @@ export default function(hljs){ // Specific { begin: /::=/, - starts: { - end: /$/, - contains: [ - { - begin: // - }, - // Common - hljs.C_LINE_COMMENT_MODE, - hljs.C_BLOCK_COMMENT_MODE, - hljs.APOS_STRING_MODE, - hljs.QUOTE_STRING_MODE - ] - } + end: /$/, + contains: [ + { + begin: // + }, + // Common + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE, + hljs.APOS_STRING_MODE, + hljs.QUOTE_STRING_MODE + ] } ] }; From 8c0f9e35bcee11c0716ec8ea04f1aeb67e3e85ff Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 28 Feb 2020 15:31:01 -0500 Subject: [PATCH 020/816] (chore) missing spaces --- src/languages/arduino.js | 2 +- src/languages/c-like.js | 2 +- src/languages/ceylon.js | 2 +- src/languages/coq.js | 2 +- src/languages/csp.js | 6 ++--- src/languages/dos.js | 2 +- src/languages/glsl.js | 2 +- src/languages/irpf90.js | 2 +- src/languages/lua.js | 6 ++--- src/languages/mathematica.js | 50 ++++++++++++++++++------------------ src/languages/perl.js | 6 ++--- src/languages/pf.js | 30 +++++++++++----------- src/languages/pgsql.js | 4 +-- src/languages/qml.js | 2 +- src/languages/reasonml.js | 6 ++--- 15 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/languages/arduino.js b/src/languages/arduino.js index a9063dcbe2..8bd1098ce8 100644 --- a/src/languages/arduino.js +++ b/src/languages/arduino.js @@ -12,7 +12,7 @@ export default function(hljs) { keyword: 'boolean byte word String', built_in: - 'setup loop' + + 'setup loop ' + 'KeyboardController MouseController SoftwareSerial ' + 'EthernetServer EthernetClient LiquidCrystal ' + 'RobotControl GSMVoiceCall EthernetUDP EsploraTFT ' + diff --git a/src/languages/c-like.js b/src/languages/c-like.js index 8c2a2bc5ed..90e23073ee 100644 --- a/src/languages/c-like.js +++ b/src/languages/c-like.js @@ -93,7 +93,7 @@ export default function(hljs) { keyword: 'int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof ' + 'dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace ' + 'unsigned long volatile static protected bool template mutable if public friend ' + - 'do goto auto void enum else break extern using asm case typeid wchar_t' + + 'do goto auto void enum else break extern using asm case typeid wchar_t ' + 'short reinterpret_cast|10 default double register explicit signed typename try this ' + 'switch continue inline delete alignas alignof constexpr consteval constinit decltype ' + 'concept co_await co_return co_yield requires ' + diff --git a/src/languages/ceylon.js b/src/languages/ceylon.js index 759309e7c6..0f7eed3c96 100644 --- a/src/languages/ceylon.js +++ b/src/languages/ceylon.js @@ -12,7 +12,7 @@ export default function(hljs) { 'catch finally then let this outer super is exists nonempty'; // 7.4.1 Declaration Modifiers var DECLARATION_MODIFIERS = - 'shared abstract formal default actual variable late native deprecated' + + 'shared abstract formal default actual variable late native deprecated ' + 'final sealed annotation suppressWarnings small'; // 7.4.2 Documentation var DOCUMENTATION = diff --git a/src/languages/coq.js b/src/languages/coq.js index f8c2457bcc..032c16988e 100644 --- a/src/languages/coq.js +++ b/src/languages/coq.js @@ -16,7 +16,7 @@ export default function(hljs) { 'Backtrack Bind Blacklist Canonical Cd Check Class Classes Close Coercion ' + 'Coercions CoFixpoint CoInductive Collection Combined Compute Conjecture ' + 'Conjectures Constant constr Constraint Constructors Context Corollary ' + - 'CreateHintDb Cut Declare Defined Definition Delimit Dependencies Dependent' + + 'CreateHintDb Cut Declare Defined Definition Delimit Dependencies Dependent ' + 'Derive Drop eauto End Equality Eval Example Existential Existentials ' + 'Existing Export exporting Extern Extract Extraction Fact Field Fields File ' + 'Fixpoint Focus for From Function Functional Generalizable Global Goal Grab ' + diff --git a/src/languages/csp.js b/src/languages/csp.js index 849249ac9c..496b106621 100644 --- a/src/languages/csp.js +++ b/src/languages/csp.js @@ -13,9 +13,9 @@ export default function(hljs) { case_insensitive: false, lexemes: '[a-zA-Z][a-zA-Z0-9_-]*', keywords: { - keyword: 'base-uri child-src connect-src default-src font-src form-action' + - ' frame-ancestors frame-src img-src media-src object-src plugin-types' + - ' report-uri sandbox script-src style-src', + keyword: 'base-uri child-src connect-src default-src font-src form-action ' + + 'frame-ancestors frame-src img-src media-src object-src plugin-types ' + + 'report-uri sandbox script-src style-src', }, contains: [ { diff --git a/src/languages/dos.js b/src/languages/dos.js index e6b5295190..9981a0371b 100644 --- a/src/languages/dos.js +++ b/src/languages/dos.js @@ -32,7 +32,7 @@ export default function(hljs) { 'append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color ' + 'comp compact convert date dir diskcomp diskcopy doskey erase fs ' + 'find findstr format ftype graftabl help keyb label md mkdir mode more move path ' + - 'pause print popd pushd promt rd recover rem rename replace restore rmdir shift' + + 'pause print popd pushd promt rd recover rem rename replace restore rmdir shift ' + 'sort start subst time title tree type ver verify vol ' + // winutils 'ping net ipconfig taskkill xcopy ren del' diff --git a/src/languages/glsl.js b/src/languages/glsl.js index 3d291ccacb..bf417a2d3e 100644 --- a/src/languages/glsl.js +++ b/src/languages/glsl.js @@ -28,7 +28,7 @@ export default function(hljs) { type: 'atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 ' + 'dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray ' + - 'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer' + + 'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer ' + 'iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray ' + 'image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray ' + 'isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D ' + diff --git a/src/languages/irpf90.js b/src/languages/irpf90.js index 614459c06c..80d4a80fa1 100644 --- a/src/languages/irpf90.js +++ b/src/languages/irpf90.js @@ -50,7 +50,7 @@ export default function(hljs) { 'set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer ' + 'dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ' + 'ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode ' + - 'is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of' + + 'is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of ' + 'acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 ' + 'atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits ' + 'bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr ' + diff --git a/src/languages/lua.js b/src/languages/lua.js index 76c88b59f6..29935a1af9 100644 --- a/src/languages/lua.js +++ b/src/languages/lua.js @@ -35,9 +35,9 @@ export default function(hljs) { '_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' + + '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 ' + diff --git a/src/languages/mathematica.js b/src/languages/mathematica.js index aaae802984..db85a58c1d 100644 --- a/src/languages/mathematica.js +++ b/src/languages/mathematica.js @@ -21,32 +21,32 @@ export default function(hljs) { // StringStartsQ[#, CharacterRange["A", "Z"] | "$"] &], // First[Characters[#]] &]], " +\n"] // - keywords: 'AASTriangle AbelianGroup Abort AbortKernels AbortProtect AbortScheduledTask Above Abs AbsArg AbsArgPlot Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AcceptanceThreshold AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Activate Active ActiveClassification ActiveClassificationObject ActiveItem ActivePrediction ActivePredictionObject ActiveStyle AcyclicGraphQ AddOnHelpPath AddSides AddTo AddToSearchIndex AddUsers AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AdministrativeDivisionData AffineHalfSpace AffineSpace AffineStateSpaceModel AffineTransform After AggregatedEntityClass AggregationLayer AircraftData AirportData AirPressureData AirTemperatureData AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowAdultContent AllowedCloudExtraParameters AllowedCloudParameterExtensions AllowedDimensions AllowedFrequencyRange AllowedHeads AllowGroupClose AllowIncomplete AllowInlineCells AllowKernelInitialization AllowLooseGrammar AllowReverseGroupClose AllowScriptLevelChange AllTrue Alphabet AlphabeticOrder AlphabeticSort AlphaChannel AlternateImage AlternatingFactorial AlternatingGroup AlternativeHypothesis Alternatives AltitudeMethod AmbientLight AmbiguityFunction AmbiguityList Analytic AnatomyData AnatomyForm AnatomyPlot3D AnatomySkinStyle AnatomyStyling AnchoredSearch And AndersonDarlingTest AngerJ AngleBisector AngleBracket AnglePath AnglePath3D AngleVector AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning AnimationRunTime AnimationTimeIndex Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotate Annotation AnnotationDelete AnnotationNames AnnotationRules AnnotationValue Annuity AnnuityDue Annulus AnomalyDetection AnomalyDetectorFunction Anonymous Antialiasing AntihermitianMatrixQ Antisymmetric AntisymmetricMatrixQ Antonyms AnyOrder AnySubset AnyTrue Apart ApartSquareFree APIFunction Appearance AppearanceElements AppearanceRules AppellF1 Append AppendCheck AppendLayer AppendTo ApplicationIdentificationKey Apply ApplySides ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcCurvature ARCHProcess ArcLength ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Area Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess Around AroundReplace ARProcess Array ArrayComponents ArrayDepth ArrayFilter ArrayFlatten ArrayMesh ArrayPad ArrayPlot ArrayQ ArrayResample ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads ASATriangle Ask AskAppend AskConfirm AskDisplay AskedQ AskedValue AskFunction AskState AskTemplateDisplay AspectRatio AspectRatioFixed Assert AssociateTo Association AssociationFormat AssociationMap AssociationQ AssociationThread AssumeDeterministic Assuming Assumptions AstronomicalData AsymptoticDSolveValue AsymptoticEqual AsymptoticEquivalent AsymptoticGreater AsymptoticGreaterEqual AsymptoticIntegrate AsymptoticLess AsymptoticLessEqual AsymptoticOutputTracker AsymptoticRSolveValue AsymptoticSolve AsymptoticSum Asynchronous AsynchronousTaskObject AsynchronousTasks Atom AtomCoordinates AtomCount AtomDiagramCoordinates AtomList AtomQ AttentionLayer Attributes Audio AudioAmplify AudioAnnotate AudioAnnotationLookup AudioBlockMap AudioCapture AudioChannelAssignment AudioChannelCombine AudioChannelMix AudioChannels AudioChannelSeparate AudioData AudioDelay AudioDelete AudioDevice AudioDistance AudioFade AudioFrequencyShift AudioGenerator AudioIdentify AudioInputDevice AudioInsert AudioIntervals AudioJoin AudioLabel AudioLength AudioLocalMeasurements AudioLooping AudioLoudness AudioMeasurements AudioNormalize AudioOutputDevice AudioOverlay AudioPad AudioPan AudioPartition AudioPause AudioPitchShift AudioPlay AudioPlot AudioQ AudioRecord AudioReplace AudioResample AudioReverb AudioSampleRate AudioSpectralMap AudioSpectralTransformation AudioSplit AudioStop AudioStream AudioStreams AudioTimeStretch AudioTrim AudioType AugmentedPolyhedron AugmentedSymmetricPolynomial Authenticate Authentication AuthenticationDialog AutoAction Autocomplete AutocompletionFunction AutoCopy AutocorrelationTest AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutoQuoteCharacters AutoRefreshed AutoRemove AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords AutoSubmitting Axes AxesEdge AxesLabel AxesOrigin AxesStyle AxiomaticTheory Axis' + - 'BabyMonsterGroupB Back Background BackgroundAppearance BackgroundTasksSettings Backslash Backsubstitution Backward Ball Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarcodeImage BarcodeRecognize BaringhausHenzeTest BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseDecode BaseEncode BaseForm Baseline BaselinePosition BaseStyle BasicRecurrentLayer BatchNormalizationLayer BatchSize BatesDistribution BattleLemarieWavelet BayesianMaximization BayesianMaximizationObject BayesianMinimization BayesianMinimizationObject Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized Between BetweennessCentrality BeveledPolyhedron BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryDeserialize BinaryDistance BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinarySerialize BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BiquadraticFilterModel BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor BiweightLocation BiweightMidvariance Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockchainAddressData BlockchainBase BlockchainBlockData BlockchainContractValue BlockchainData BlockchainGet BlockchainKeyEncode BlockchainPut BlockchainTokenData BlockchainTransaction BlockchainTransactionData BlockchainTransactionSign BlockchainTransactionSubmit BlockMap BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bond BondCount BondList BondQ Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms BooleanQ BooleanRegion Booleans BooleanStrings BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryDiscretizeGraphics BoundaryDiscretizeRegion BoundaryMesh BoundaryMeshRegion BoundaryMeshRegionQ BoundaryStyle BoundedRegionQ BoundingRegion Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxObject BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break BridgeData BrightnessEqualize BroadcastStationData Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurve3DBoxOptions BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BSplineSurface3DBoxOptions BubbleChart BubbleChart3D BubbleScale BubbleSizes BuildingData BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteArray ByteArrayFormat ByteArrayQ ByteArrayToString ByteCount ByteOrdering' + - 'C CachedValue CacheGraphics CachePersistence CalendarConvert CalendarData CalendarType Callout CalloutMarker CalloutStyle CallPacket CanberraDistance Cancel CancelButton CandlestickChart CanonicalGraph CanonicalizePolygon CanonicalizePolyhedron CanonicalName CanonicalWarpingCorrespondence CanonicalWarpingDistance CantorMesh CantorStaircase Cap CapForm CapitalDifferentialD Capitalize CapsuleShape CaptureRunning CardinalBSplineBasis CarlemanLinearize CarmichaelLambda CaseOrdering Cases CaseSensitive Cashflow Casoratian Catalan CatalanNumber Catch Catenate CatenateLayer CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling CelestialSystem Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEvaluationLanguage CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellLabelStyle CellLabelTemplate CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterArray CenterDot CentralFeature CentralMoment CentralMomentGeneratingFunction Cepstrogram CepstrogramArray CepstrumArray CForm ChampernowneNumber ChangeOptions ChannelBase ChannelBrokerAction ChannelDatabin ChannelHistoryLength ChannelListen ChannelListener ChannelListeners ChannelListenerWait ChannelObject ChannelPreSendFunction ChannelReceiverFunction ChannelSend ChannelSubscribers ChanVeseBinarize Character CharacterCounts CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterName CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop ChromaticityPlot ChromaticityPlot3D ChromaticPolynomial Circle CircleBox CircleDot CircleMinus CirclePlus CirclePoints CircleThrough CircleTimes CirculantGraph CircularOrthogonalMatrixDistribution CircularQuaternionMatrixDistribution CircularRealMatrixDistribution CircularSymplecticMatrixDistribution CircularUnitaryMatrixDistribution Circumsphere CityData ClassifierFunction ClassifierInformation ClassifierMeasurements ClassifierMeasurementsObject Classify ClassPriors Clear ClearAll ClearAttributes ClearCookies ClearPermissions ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipPlanesStyle ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent CloudAccountData CloudBase CloudConnect CloudDeploy CloudDirectory CloudDisconnect CloudEvaluate CloudExport CloudExpression CloudExpressions CloudFunction CloudGet CloudImport CloudLoggingData CloudObject CloudObjectInformation CloudObjectInformationData CloudObjectNameFormat CloudObjects CloudObjectURLType CloudPublish CloudPut CloudRenderingMethod CloudSave CloudShare CloudSubmit CloudSymbol CloudUnshare ClusterClassify ClusterDissimilarityFunction ClusteringComponents ClusteringTree CMYKColor Coarse CodeAssistOptions Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorBalance ColorCombine ColorConvert ColorCoverage ColorData ColorDataFunction ColorDetect ColorDistance ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQ ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorsNear ColorSpace ColorToneMapping Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CombinedEntityClass CombinerFunction CometData CommonDefaultFormatTypes Commonest CommonestFilter CommonName CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompanyData CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledCodeFunction CompiledFunction CompilerOptions Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComplexListPlot ComplexPlot ComplexPlot3D ComponentMeasurements ComponentwiseContextMenu Compose ComposeList ComposeSeries CompositeQ Composition CompoundElement CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData ComputeUncertainty Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath ConformAudio ConformImages Congruent ConicHullRegion ConicHullRegion3DBox ConicHullRegionBox ConicOptimization Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphComponents ConnectedGraphQ ConnectedMeshComponents ConnectedMoleculeComponents ConnectedMoleculeQ ConnectionSettings ConnectLibraryCallbackFunction ConnectSystemModelComponents ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray ConstantArrayLayer ConstantImage ConstantPlusLayer ConstantRegionQ Constants ConstantTimesLayer ConstellationData ConstrainedMax ConstrainedMin Construct Containing ContainsAll ContainsAny ContainsExactly ContainsNone ContainsOnly ContentFieldOptions ContentLocationFunction ContentObject ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTask ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean ContrastiveLossLayer Control ControlActive ControlAlignment ControlGroupContentsBox ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket ConvexHullMesh ConvexPolygonQ ConvexPolyhedronQ ConvolutionLayer Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CookieFunction Cookies CoordinateBoundingBox CoordinateBoundingBoxArray CoordinateBounds CoordinateBoundsArray CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDatabin CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CountDistinct CountDistinctBy CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Counts CountsBy Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateCellID CreateChannel CreateCloudExpression CreateDatabin CreateDataSystemModel CreateDialog CreateDirectory CreateDocument CreateFile CreateIntermediateDirectories CreateManagedLibraryExpression CreateNotebook CreatePalette CreatePalettePacket CreatePermissionsGroup CreateScheduledTask CreateSearchIndex CreateSystemModel CreateTemporary CreateUUID CreateWindow CriterionFunction CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossEntropyLossLayer CrossingCount CrossingDetect CrossingPolygon CrossMatrix Csc Csch CTCLossLayer Cube CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrencyConvert CurrentDate CurrentImage CurrentlySpeakingPacket CurrentNotebookImage CurrentScreenImage CurrentValue Curry CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition' + - 'D DagumDistribution DamData DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DatabaseConnect DatabaseDisconnect DatabaseReference Databin DatabinAdd DatabinRemove Databins DatabinUpload DataCompression DataDistribution DataRange DataReversed Dataset Date DateBounds Dated DateDelimiters DateDifference DatedUnit DateFormat DateFunction DateHistogram DateList DateListLogPlot DateListPlot DateListStepPlot DateObject DateObjectQ DateOverlapsQ DatePattern DatePlus DateRange DateReduction DateString DateTicksFormat DateValue DateWithinQ DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayHemisphere DaylightQ DayMatchQ DayName DayNightTerminator DayPlus DayRange DayRound DeBruijnGraph DeBruijnSequence Debug DebugTag Decapitalize Decimal DecimalForm DeclareKnownSymbols DeclarePackage Decompose DeconvolutionLayer Decrement Decrypt DecryptFile DedekindEta DeepSpaceProbeData Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultPrintPrecision DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValue DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod DefineResourceFunction Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic DEigensystem DEigenvalues Deinitialization Del DelaunayMesh Delayed Deletable Delete DeleteAnomalies DeleteBorderComponents DeleteCases DeleteChannel DeleteCloudExpression DeleteContents DeleteDirectory DeleteDuplicates DeleteDuplicatesBy DeleteFile DeleteMissing DeleteObject DeletePermissionsKey DeleteSearchIndex DeleteSmallComponents DeleteStopwords DeleteWithContents DeletionWarning DelimitedArray DelimitedSequence Delimiter DelimiterFlashTime DelimiterMatching Delimiters DeliveryFunction Dendrogram Denominator DensityGraphics DensityHistogram DensityPlot DensityPlot3D DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DerivedKey DescriptorStateSpace DesignMatrix DestroyAfterEvaluation Det DeviceClose DeviceConfigure DeviceExecute DeviceExecuteAsynchronous DeviceObject DeviceOpen DeviceOpenQ DeviceRead DeviceReadBuffer DeviceReadLatest DeviceReadList DeviceReadTimeSeries Devices DeviceStreams DeviceWrite DeviceWriteBuffer DGaussianWavelet DiacriticalPositioning Diagonal DiagonalizableMatrixQ DiagonalMatrix DiagonalMatrixQ Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DictionaryWordQ DifferenceDelta DifferenceOrder DifferenceQuotient DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitalSignature DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralAngle DihedralGroup Dilation DimensionalCombinations DimensionalMeshComponents DimensionReduce DimensionReducerFunction DimensionReduction Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletBeta DirichletCharacter DirichletCondition DirichletConvolve DirichletDistribution DirichletEta DirichletL DirichletLambda DirichletTransform DirichletWindow DisableConsolePrintPacket DisableFormatting DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLimit DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscreteMaxLimit DiscreteMinLimit DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform DiscreteWaveletTransform DiscretizeGraphics DiscretizeRegion Discriminant DisjointQ Disjunction Disk DiskBox DiskMatrix DiskSegment Dispatch DispatchQ DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceMatrix DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers DivideSides Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentGenerator DocumentGeneratorInformation DocumentGeneratorInformationData DocumentGenerators DocumentNotebook DocumentWeightingRules Dodecahedron DomainRegistrationInformation DominantColors DOSTextFormat Dot DotDashed DotEqual DotLayer DotPlusLayer Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DropoutLayer DSolve DSolveValue Dt DualLinearProgramming DualPolyhedron DualSystemsModel DumpGet DumpSave DuplicateFreeQ Duration Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicGeoGraphics DynamicImage DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions' + - 'E EarthImpactData EarthquakeData EccentricityCentrality Echo EchoFunction EclipseType EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeContract EdgeCost EdgeCount EdgeCoverQ EdgeCycleMatrix EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight EdgeWeightedGraphQ Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData ElementwiseLayer ElidedForms Eliminate EliminationOrder Ellipsoid EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmbedCode EmbeddedHTML EmbeddedService EmbeddingLayer EmbeddingObject EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EmptyRegion EnableConsolePrintPacket Enabled Encode Encrypt EncryptedObject EncryptFile End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfBuffer EndOfFile EndOfLine EndOfString EndPackage EngineEnvironment EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entity EntityClass EntityClassList EntityCopies EntityFunction EntityGroup EntityInstance EntityList EntityPrefetch EntityProperties EntityProperty EntityPropertyClass EntityRegister EntityStore EntityStores EntityTypeName EntityUnregister EntityValue Entropy EntropyFilter Environment Epilog EpilogFunction Equal EqualColumns EqualRows EqualTilde EqualTo EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EscapeRadius EstimatedBackground EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerAngles EulerCharacteristic EulerE EulerGamma EulerianGraphQ EulerMatrix EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluateScheduledTask EvaluationBox EvaluationCell EvaluationCompletionAction EvaluationData EvaluationElements EvaluationEnvironment EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels EventSeries ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludedLines ExcludedPhysicalQuantities ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog ExoplanetData Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi ExpirationDate Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportByteArray ExportForm ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpressionUUID ExpToTrig ExtendedEntityClass ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalBundle ExternalCall ExternalDataCharacterEncoding ExternalEvaluate ExternalFunction ExternalFunctionName ExternalObject ExternalOptions ExternalSessionObject ExternalSessions ExternalTypeSignature ExternalValue Extract ExtractArchive ExtractLayer ExtremeValueDistribution' + + keywords: 'AASTriangle AbelianGroup Abort AbortKernels AbortProtect AbortScheduledTask Above Abs AbsArg AbsArgPlot Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AcceptanceThreshold AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Activate Active ActiveClassification ActiveClassificationObject ActiveItem ActivePrediction ActivePredictionObject ActiveStyle AcyclicGraphQ AddOnHelpPath AddSides AddTo AddToSearchIndex AddUsers AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AdministrativeDivisionData AffineHalfSpace AffineSpace AffineStateSpaceModel AffineTransform After AggregatedEntityClass AggregationLayer AircraftData AirportData AirPressureData AirTemperatureData AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowAdultContent AllowedCloudExtraParameters AllowedCloudParameterExtensions AllowedDimensions AllowedFrequencyRange AllowedHeads AllowGroupClose AllowIncomplete AllowInlineCells AllowKernelInitialization AllowLooseGrammar AllowReverseGroupClose AllowScriptLevelChange AllTrue Alphabet AlphabeticOrder AlphabeticSort AlphaChannel AlternateImage AlternatingFactorial AlternatingGroup AlternativeHypothesis Alternatives AltitudeMethod AmbientLight AmbiguityFunction AmbiguityList Analytic AnatomyData AnatomyForm AnatomyPlot3D AnatomySkinStyle AnatomyStyling AnchoredSearch And AndersonDarlingTest AngerJ AngleBisector AngleBracket AnglePath AnglePath3D AngleVector AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning AnimationRunTime AnimationTimeIndex Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotate Annotation AnnotationDelete AnnotationNames AnnotationRules AnnotationValue Annuity AnnuityDue Annulus AnomalyDetection AnomalyDetectorFunction Anonymous Antialiasing AntihermitianMatrixQ Antisymmetric AntisymmetricMatrixQ Antonyms AnyOrder AnySubset AnyTrue Apart ApartSquareFree APIFunction Appearance AppearanceElements AppearanceRules AppellF1 Append AppendCheck AppendLayer AppendTo ApplicationIdentificationKey Apply ApplySides ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcCurvature ARCHProcess ArcLength ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Area Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess Around AroundReplace ARProcess Array ArrayComponents ArrayDepth ArrayFilter ArrayFlatten ArrayMesh ArrayPad ArrayPlot ArrayQ ArrayResample ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads ASATriangle Ask AskAppend AskConfirm AskDisplay AskedQ AskedValue AskFunction AskState AskTemplateDisplay AspectRatio AspectRatioFixed Assert AssociateTo Association AssociationFormat AssociationMap AssociationQ AssociationThread AssumeDeterministic Assuming Assumptions AstronomicalData AsymptoticDSolveValue AsymptoticEqual AsymptoticEquivalent AsymptoticGreater AsymptoticGreaterEqual AsymptoticIntegrate AsymptoticLess AsymptoticLessEqual AsymptoticOutputTracker AsymptoticRSolveValue AsymptoticSolve AsymptoticSum Asynchronous AsynchronousTaskObject AsynchronousTasks Atom AtomCoordinates AtomCount AtomDiagramCoordinates AtomList AtomQ AttentionLayer Attributes Audio AudioAmplify AudioAnnotate AudioAnnotationLookup AudioBlockMap AudioCapture AudioChannelAssignment AudioChannelCombine AudioChannelMix AudioChannels AudioChannelSeparate AudioData AudioDelay AudioDelete AudioDevice AudioDistance AudioFade AudioFrequencyShift AudioGenerator AudioIdentify AudioInputDevice AudioInsert AudioIntervals AudioJoin AudioLabel AudioLength AudioLocalMeasurements AudioLooping AudioLoudness AudioMeasurements AudioNormalize AudioOutputDevice AudioOverlay AudioPad AudioPan AudioPartition AudioPause AudioPitchShift AudioPlay AudioPlot AudioQ AudioRecord AudioReplace AudioResample AudioReverb AudioSampleRate AudioSpectralMap AudioSpectralTransformation AudioSplit AudioStop AudioStream AudioStreams AudioTimeStretch AudioTrim AudioType AugmentedPolyhedron AugmentedSymmetricPolynomial Authenticate Authentication AuthenticationDialog AutoAction Autocomplete AutocompletionFunction AutoCopy AutocorrelationTest AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutoQuoteCharacters AutoRefreshed AutoRemove AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords AutoSubmitting Axes AxesEdge AxesLabel AxesOrigin AxesStyle AxiomaticTheory Axis ' + + 'BabyMonsterGroupB Back Background BackgroundAppearance BackgroundTasksSettings Backslash Backsubstitution Backward Ball Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarcodeImage BarcodeRecognize BaringhausHenzeTest BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseDecode BaseEncode BaseForm Baseline BaselinePosition BaseStyle BasicRecurrentLayer BatchNormalizationLayer BatchSize BatesDistribution BattleLemarieWavelet BayesianMaximization BayesianMaximizationObject BayesianMinimization BayesianMinimizationObject Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized Between BetweennessCentrality BeveledPolyhedron BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryDeserialize BinaryDistance BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinarySerialize BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BiquadraticFilterModel BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor BiweightLocation BiweightMidvariance Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockchainAddressData BlockchainBase BlockchainBlockData BlockchainContractValue BlockchainData BlockchainGet BlockchainKeyEncode BlockchainPut BlockchainTokenData BlockchainTransaction BlockchainTransactionData BlockchainTransactionSign BlockchainTransactionSubmit BlockMap BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bond BondCount BondList BondQ Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms BooleanQ BooleanRegion Booleans BooleanStrings BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryDiscretizeGraphics BoundaryDiscretizeRegion BoundaryMesh BoundaryMeshRegion BoundaryMeshRegionQ BoundaryStyle BoundedRegionQ BoundingRegion Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxObject BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break BridgeData BrightnessEqualize BroadcastStationData Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurve3DBoxOptions BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BSplineSurface3DBoxOptions BubbleChart BubbleChart3D BubbleScale BubbleSizes BuildingData BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteArray ByteArrayFormat ByteArrayQ ByteArrayToString ByteCount ByteOrdering ' + + 'C CachedValue CacheGraphics CachePersistence CalendarConvert CalendarData CalendarType Callout CalloutMarker CalloutStyle CallPacket CanberraDistance Cancel CancelButton CandlestickChart CanonicalGraph CanonicalizePolygon CanonicalizePolyhedron CanonicalName CanonicalWarpingCorrespondence CanonicalWarpingDistance CantorMesh CantorStaircase Cap CapForm CapitalDifferentialD Capitalize CapsuleShape CaptureRunning CardinalBSplineBasis CarlemanLinearize CarmichaelLambda CaseOrdering Cases CaseSensitive Cashflow Casoratian Catalan CatalanNumber Catch Catenate CatenateLayer CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling CelestialSystem Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEvaluationLanguage CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellLabelStyle CellLabelTemplate CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterArray CenterDot CentralFeature CentralMoment CentralMomentGeneratingFunction Cepstrogram CepstrogramArray CepstrumArray CForm ChampernowneNumber ChangeOptions ChannelBase ChannelBrokerAction ChannelDatabin ChannelHistoryLength ChannelListen ChannelListener ChannelListeners ChannelListenerWait ChannelObject ChannelPreSendFunction ChannelReceiverFunction ChannelSend ChannelSubscribers ChanVeseBinarize Character CharacterCounts CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterName CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop ChromaticityPlot ChromaticityPlot3D ChromaticPolynomial Circle CircleBox CircleDot CircleMinus CirclePlus CirclePoints CircleThrough CircleTimes CirculantGraph CircularOrthogonalMatrixDistribution CircularQuaternionMatrixDistribution CircularRealMatrixDistribution CircularSymplecticMatrixDistribution CircularUnitaryMatrixDistribution Circumsphere CityData ClassifierFunction ClassifierInformation ClassifierMeasurements ClassifierMeasurementsObject Classify ClassPriors Clear ClearAll ClearAttributes ClearCookies ClearPermissions ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipPlanesStyle ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent CloudAccountData CloudBase CloudConnect CloudDeploy CloudDirectory CloudDisconnect CloudEvaluate CloudExport CloudExpression CloudExpressions CloudFunction CloudGet CloudImport CloudLoggingData CloudObject CloudObjectInformation CloudObjectInformationData CloudObjectNameFormat CloudObjects CloudObjectURLType CloudPublish CloudPut CloudRenderingMethod CloudSave CloudShare CloudSubmit CloudSymbol CloudUnshare ClusterClassify ClusterDissimilarityFunction ClusteringComponents ClusteringTree CMYKColor Coarse CodeAssistOptions Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorBalance ColorCombine ColorConvert ColorCoverage ColorData ColorDataFunction ColorDetect ColorDistance ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQ ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorsNear ColorSpace ColorToneMapping Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CombinedEntityClass CombinerFunction CometData CommonDefaultFormatTypes Commonest CommonestFilter CommonName CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompanyData CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledCodeFunction CompiledFunction CompilerOptions Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComplexListPlot ComplexPlot ComplexPlot3D ComponentMeasurements ComponentwiseContextMenu Compose ComposeList ComposeSeries CompositeQ Composition CompoundElement CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData ComputeUncertainty Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath ConformAudio ConformImages Congruent ConicHullRegion ConicHullRegion3DBox ConicHullRegionBox ConicOptimization Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphComponents ConnectedGraphQ ConnectedMeshComponents ConnectedMoleculeComponents ConnectedMoleculeQ ConnectionSettings ConnectLibraryCallbackFunction ConnectSystemModelComponents ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray ConstantArrayLayer ConstantImage ConstantPlusLayer ConstantRegionQ Constants ConstantTimesLayer ConstellationData ConstrainedMax ConstrainedMin Construct Containing ContainsAll ContainsAny ContainsExactly ContainsNone ContainsOnly ContentFieldOptions ContentLocationFunction ContentObject ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTask ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean ContrastiveLossLayer Control ControlActive ControlAlignment ControlGroupContentsBox ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket ConvexHullMesh ConvexPolygonQ ConvexPolyhedronQ ConvolutionLayer Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CookieFunction Cookies CoordinateBoundingBox CoordinateBoundingBoxArray CoordinateBounds CoordinateBoundsArray CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDatabin CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CountDistinct CountDistinctBy CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Counts CountsBy Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateCellID CreateChannel CreateCloudExpression CreateDatabin CreateDataSystemModel CreateDialog CreateDirectory CreateDocument CreateFile CreateIntermediateDirectories CreateManagedLibraryExpression CreateNotebook CreatePalette CreatePalettePacket CreatePermissionsGroup CreateScheduledTask CreateSearchIndex CreateSystemModel CreateTemporary CreateUUID CreateWindow CriterionFunction CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossEntropyLossLayer CrossingCount CrossingDetect CrossingPolygon CrossMatrix Csc Csch CTCLossLayer Cube CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrencyConvert CurrentDate CurrentImage CurrentlySpeakingPacket CurrentNotebookImage CurrentScreenImage CurrentValue Curry CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition ' + + 'D DagumDistribution DamData DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DatabaseConnect DatabaseDisconnect DatabaseReference Databin DatabinAdd DatabinRemove Databins DatabinUpload DataCompression DataDistribution DataRange DataReversed Dataset Date DateBounds Dated DateDelimiters DateDifference DatedUnit DateFormat DateFunction DateHistogram DateList DateListLogPlot DateListPlot DateListStepPlot DateObject DateObjectQ DateOverlapsQ DatePattern DatePlus DateRange DateReduction DateString DateTicksFormat DateValue DateWithinQ DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayHemisphere DaylightQ DayMatchQ DayName DayNightTerminator DayPlus DayRange DayRound DeBruijnGraph DeBruijnSequence Debug DebugTag Decapitalize Decimal DecimalForm DeclareKnownSymbols DeclarePackage Decompose DeconvolutionLayer Decrement Decrypt DecryptFile DedekindEta DeepSpaceProbeData Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultPrintPrecision DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValue DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod DefineResourceFunction Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic DEigensystem DEigenvalues Deinitialization Del DelaunayMesh Delayed Deletable Delete DeleteAnomalies DeleteBorderComponents DeleteCases DeleteChannel DeleteCloudExpression DeleteContents DeleteDirectory DeleteDuplicates DeleteDuplicatesBy DeleteFile DeleteMissing DeleteObject DeletePermissionsKey DeleteSearchIndex DeleteSmallComponents DeleteStopwords DeleteWithContents DeletionWarning DelimitedArray DelimitedSequence Delimiter DelimiterFlashTime DelimiterMatching Delimiters DeliveryFunction Dendrogram Denominator DensityGraphics DensityHistogram DensityPlot DensityPlot3D DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DerivedKey DescriptorStateSpace DesignMatrix DestroyAfterEvaluation Det DeviceClose DeviceConfigure DeviceExecute DeviceExecuteAsynchronous DeviceObject DeviceOpen DeviceOpenQ DeviceRead DeviceReadBuffer DeviceReadLatest DeviceReadList DeviceReadTimeSeries Devices DeviceStreams DeviceWrite DeviceWriteBuffer DGaussianWavelet DiacriticalPositioning Diagonal DiagonalizableMatrixQ DiagonalMatrix DiagonalMatrixQ Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DictionaryWordQ DifferenceDelta DifferenceOrder DifferenceQuotient DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitalSignature DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralAngle DihedralGroup Dilation DimensionalCombinations DimensionalMeshComponents DimensionReduce DimensionReducerFunction DimensionReduction Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletBeta DirichletCharacter DirichletCondition DirichletConvolve DirichletDistribution DirichletEta DirichletL DirichletLambda DirichletTransform DirichletWindow DisableConsolePrintPacket DisableFormatting DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLimit DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscreteMaxLimit DiscreteMinLimit DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform DiscreteWaveletTransform DiscretizeGraphics DiscretizeRegion Discriminant DisjointQ Disjunction Disk DiskBox DiskMatrix DiskSegment Dispatch DispatchQ DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceMatrix DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers DivideSides Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentGenerator DocumentGeneratorInformation DocumentGeneratorInformationData DocumentGenerators DocumentNotebook DocumentWeightingRules Dodecahedron DomainRegistrationInformation DominantColors DOSTextFormat Dot DotDashed DotEqual DotLayer DotPlusLayer Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DropoutLayer DSolve DSolveValue Dt DualLinearProgramming DualPolyhedron DualSystemsModel DumpGet DumpSave DuplicateFreeQ Duration Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicGeoGraphics DynamicImage DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions ' + + 'E EarthImpactData EarthquakeData EccentricityCentrality Echo EchoFunction EclipseType EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeContract EdgeCost EdgeCount EdgeCoverQ EdgeCycleMatrix EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight EdgeWeightedGraphQ Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData ElementwiseLayer ElidedForms Eliminate EliminationOrder Ellipsoid EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmbedCode EmbeddedHTML EmbeddedService EmbeddingLayer EmbeddingObject EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EmptyRegion EnableConsolePrintPacket Enabled Encode Encrypt EncryptedObject EncryptFile End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfBuffer EndOfFile EndOfLine EndOfString EndPackage EngineEnvironment EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entity EntityClass EntityClassList EntityCopies EntityFunction EntityGroup EntityInstance EntityList EntityPrefetch EntityProperties EntityProperty EntityPropertyClass EntityRegister EntityStore EntityStores EntityTypeName EntityUnregister EntityValue Entropy EntropyFilter Environment Epilog EpilogFunction Equal EqualColumns EqualRows EqualTilde EqualTo EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EscapeRadius EstimatedBackground EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerAngles EulerCharacteristic EulerE EulerGamma EulerianGraphQ EulerMatrix EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluateScheduledTask EvaluationBox EvaluationCell EvaluationCompletionAction EvaluationData EvaluationElements EvaluationEnvironment EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels EventSeries ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludedLines ExcludedPhysicalQuantities ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog ExoplanetData Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi ExpirationDate Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportByteArray ExportForm ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpressionUUID ExpToTrig ExtendedEntityClass ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalBundle ExternalCall ExternalDataCharacterEncoding ExternalEvaluate ExternalFunction ExternalFunctionName ExternalObject ExternalOptions ExternalSessionObject ExternalSessions ExternalTypeSignature ExternalValue Extract ExtractArchive ExtractLayer ExtremeValueDistribution ' + 'FaceForm FaceGrids FaceGridsStyle FacialFeatures Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail Failure FailureAction FailureDistribution FailureQ False FareySequence FARIMAProcess FeatureDistance FeatureExtract FeatureExtraction FeatureExtractor FeatureExtractorFunction FeatureNames FeatureNearest FeatureSpacePlot FeatureSpacePlot3D FeatureTypes FEDisableConsolePrintPacket FeedbackLinearize FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket FetalGrowthData Fibonacci Fibonorial FieldCompletionFunction FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileConvert FileDate FileExistsQ FileExtension FileFormat FileHandler FileHash FileInformation FileName FileNameDepth FileNameDialogSettings FileNameDrop FileNameForms FileNameJoin FileNames FileNameSetter FileNameSplit FileNameTake FilePrint FileSize FileSystemMap FileSystemScan FileTemplate FileTemplateApply FileType FilledCurve FilledCurveBox FilledCurveBoxOptions Filling FillingStyle FillingTransform FilteredEntityClass FilterRules FinancialBond FinancialData FinancialDerivative FinancialIndicator Find FindAnomalies FindArgMax FindArgMin FindChannels FindClique FindClusters FindCookies FindCurvePath FindCycle FindDevices FindDistribution FindDistributionParameters FindDivisions FindEdgeCover FindEdgeCut FindEdgeIndependentPaths FindEquationalProof FindEulerianCycle FindExternalEvaluators FindFaces FindFile FindFit FindFormula FindFundamentalCycles FindGeneratingFunction FindGeoLocation FindGeometricConjectures FindGeometricTransform FindGraphCommunities FindGraphIsomorphism FindGraphPartition FindHamiltonianCycle FindHamiltonianPath FindHiddenMarkovStates FindIndependentEdgeSet FindIndependentVertexSet FindInstance FindIntegerNullVector FindKClan FindKClique FindKClub FindKPlex FindLibrary FindLinearRecurrence FindList FindMatchingColor FindMaximum FindMaximumFlow FindMaxValue FindMeshDefects FindMinimum FindMinimumCostFlow FindMinimumCut FindMinValue FindMoleculeSubstructure FindPath FindPeaks FindPermutation FindPostmanTour FindProcessParameters FindRepeat FindRoot FindSequenceFunction FindSettings FindShortestPath FindShortestTour FindSpanningTree FindSystemModelEquilibrium FindTextualAnswer FindThreshold FindTransientRepeat FindVertexCover FindVertexCut FindVertexIndependentPaths Fine FinishDynamic FiniteAbelianGroupCount FiniteGroupCount FiniteGroupData First FirstCase FirstPassageTimeDistribution FirstPosition FischerGroupFi22 FischerGroupFi23 FischerGroupFi24Prime FisherHypergeometricDistribution FisherRatioTest FisherZDistribution Fit FitAll FitRegularization FittedModel FixedOrder FixedPoint FixedPointList FlashSelection Flat Flatten FlattenAt FlattenLayer FlatTopWindow FlipView Floor FlowPolynomial FlushPrintOutputPacket Fold FoldList FoldPair FoldPairList FollowRedirects Font FontColor FontFamily FontForm FontName FontOpacity FontPostScriptName FontProperties FontReencoding FontSize FontSlant FontSubstitutions FontTracking FontVariations FontWeight For ForAll Format FormatRules FormatType FormatTypeAutoConvert FormatValues FormBox FormBoxOptions FormControl FormFunction FormLayoutFunction FormObject FormPage FormTheme FormulaData FormulaLookup FortranForm Forward ForwardBackward Fourier FourierCoefficient FourierCosCoefficient FourierCosSeries FourierCosTransform FourierDCT FourierDCTFilter FourierDCTMatrix FourierDST FourierDSTMatrix FourierMatrix FourierParameters FourierSequenceTransform FourierSeries FourierSinCoefficient FourierSinSeries FourierSinTransform FourierTransform FourierTrigSeries FractionalBrownianMotionProcess FractionalGaussianNoiseProcess FractionalPart FractionBox FractionBoxOptions FractionLine Frame FrameBox FrameBoxOptions Framed FrameInset FrameLabel Frameless FrameMargins FrameRate FrameStyle FrameTicks FrameTicksStyle FRatioDistribution FrechetDistribution FreeQ FrenetSerretSystem FrequencySamplingFilterKernel FresnelC FresnelF FresnelG FresnelS Friday FrobeniusNumber FrobeniusSolve FromAbsoluteTime FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS FromEntity FromJulianDate FromLetterNumber FromPolarCoordinates FromRomanNumeral FromSphericalCoordinates FromUnixTime Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullInformationOutputRegulator FullOptions FullRegion FullSimplify Function FunctionCompile FunctionCompileExport FunctionCompileExportByteArray FunctionCompileExportLibrary FunctionCompileExportString FunctionDomain FunctionExpand FunctionInterpolation FunctionPeriod FunctionRange FunctionSpace FussellVeselyImportance' + - 'GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins GalaxyData GalleryView Gamma GammaDistribution GammaRegularized GapPenalty GARCHProcess GatedRecurrentLayer Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianOrthogonalMatrixDistribution GaussianSymplecticMatrixDistribution GaussianUnitaryMatrixDistribution GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateAsymmetricKeyPair GenerateConditions GeneratedCell GeneratedDocumentBinding GenerateDerivedKey GenerateDigitalSignature GenerateDocument GeneratedParameters GeneratedQuantityMagnitudes GenerateHTTPResponse GenerateSecuredAuthenticationKey GenerateSymmetricKey GeneratingFunction GeneratorDescription GeneratorHistoryLength GeneratorOutputType Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeoAntipode GeoArea GeoArraySize GeoBackground GeoBoundingBox GeoBounds GeoBoundsRegion GeoBubbleChart GeoCenter GeoCircle GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDisk GeoDisplacement GeoDistance GeoDistanceList GeoElevationData GeoEntities GeoGraphics GeogravityModelData GeoGridDirectionDifference GeoGridLines GeoGridLinesStyle GeoGridPosition GeoGridRange GeoGridRangePadding GeoGridUnitArea GeoGridUnitDistance GeoGridVector GeoGroup GeoHemisphere GeoHemisphereBoundary GeoHistogram GeoIdentify GeoImage GeoLabels GeoLength GeoListPlot GeoLocation GeologicalPeriodData GeomagneticModelData GeoMarker GeometricAssertion GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricScene GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoModel GeoNearest GeoPath GeoPosition GeoPositionENU GeoPositionXYZ GeoProjection GeoProjectionData GeoRange GeoRangePadding GeoRegionValuePlot GeoResolution GeoScaleBar GeoServer GeoSmoothHistogram GeoStreamPlot GeoStyling GeoStylingImageFunction GeoVariant GeoVector GeoVectorENU GeoVectorPlot GeoVectorXYZ GeoVisibleRegion GeoVisibleRegionBoundary GeoWithinQ GeoZoomLevel GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenAngle GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter GrammarApply GrammarRules GrammarToken Graph Graph3D GraphAssortativity GraphAutomorphismGroup GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel Greater GreaterEqual GreaterEqualLess GreaterEqualThan GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterThan GreaterTilde Green GreenFunction Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupBy GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators Groupings GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain GroupTogetherGrouping GroupTogetherNestedGrouping GrowCutComponents Gudermannian GuidedFilter GumbelDistribution' + - 'HaarWavelet HadamardMatrix HalfLine HalfNormalDistribution HalfPlane HalfSpace HamiltonianGraphQ HammingDistance HammingWindow HandlerFunctions HandlerFunctionsKeys HankelH1 HankelH2 HankelMatrix HankelTransform HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash Haversine HazardFunction Head HeadCompose HeaderLines Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings Here HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenMarkovProcess HiddenSurface Highlighted HighlightGraph HighlightImage HighlightMesh HighpassFilter HigmanSimsGroupHS HilbertCurve HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HistoricalPeriodData HitMissTransform HITSCentrality HjorthDistribution HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HostLookup HotellingTSquareDistribution HoytDistribution HTMLSave HTTPErrorResponse HTTPRedirect HTTPRequest HTTPRequestData HTTPResponse Hue HumanGrowthData HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyperplane Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData' + - 'I IconData Iconize IconizedObject IconRules Icosahedron Identity IdentityMatrix If IgnoreCase IgnoreDiacritics IgnorePunctuation IgnoreSpellCheck IgnoringInactive Im Image Image3D Image3DProjection Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageApplyIndexed ImageAspectRatio ImageAssemble ImageAugmentationLayer ImageBoundingBoxes ImageCache ImageCacheValid ImageCapture ImageCaptureFunction ImageCases ImageChannels ImageClip ImageCollage ImageColorSpace ImageCompose ImageContainsQ ImageContents ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDisplacements ImageDistance ImageEffect ImageExposureCombine ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageFocusCombine ImageForestingComponents ImageFormattingWidth ImageForwardTransformation ImageGraphics ImageHistogram ImageIdentify ImageInstanceQ ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarker ImageMarkers ImageMeasurements ImageMesh ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImagePosition ImagePreviewFunction ImagePyramid ImagePyramidApply ImageQ ImageRangeCache ImageRecolor ImageReflect ImageRegion ImageResize ImageResolution ImageRestyle ImageRotate ImageRotated ImageSaliencyFilter ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions ImagingDevice ImplicitRegion Implies Import ImportAutoReplacements ImportByteArray ImportOptions ImportString ImprovementImportance In Inactivate Inactive IncidenceGraph IncidenceList IncidenceMatrix IncludeAromaticBonds IncludeConstantBasis IncludeDefinitions IncludeDirectories IncludeFileExtension IncludeGeneratorTasks IncludeHydrogens IncludeInflections IncludeMetaInformation IncludePods IncludeQuantities IncludeRelatedTables IncludeSingularTerm IncludeWindowTimes Increment IndefiniteMatrixQ Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentPhysicalQuantity IndependentUnit IndependentUnitDimension IndependentVertexSetQ Indeterminate IndeterminateThreshold IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers InfiniteLine InfinitePlane Infinity Infix InflationAdjust InflationMethod Information InformationData InformationDataGrid Inherited InheritScope InhomogeneousPoissonProcess InitialEvaluationHistory Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InitializationObjects InitializationValue Initialize InitialSeeding InlineCounterAssignments InlineCounterIncrements InlineRules Inner InnerPolygon InnerPolyhedron Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionFunction InsertionPointObject InsertLinebreaks InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Insphere Install InstallService InstanceNormalizationLayer InString Integer IntegerDigits IntegerExponent IntegerLength IntegerName IntegerPart IntegerPartitions IntegerQ IntegerReverse Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction Interpreter InterpretTemplate InterquartileRange Interrupt InterruptSettings IntersectingQ Intersection Interval IntervalIntersection IntervalMarkers IntervalMarkersStyle IntervalMemberQ IntervalSlider IntervalUnion Into Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHankelTransform InverseHaversine InverseImagePyramid InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InverseMellinTransform InversePermutation InverseRadon InverseRadonTransform InverseSeries InverseShortTimeFourier InverseSpectrogram InverseSurvivalFunction InverseTransformedRegion InverseWaveletTransform InverseWeierstrassP InverseWishartMatrixDistribution InverseZTransform Invisible InvisibleApplication InvisibleTimes IPAddress IrreduciblePolynomialQ IslandData IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemAspectRatio ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess' + - 'JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join JoinAcross Joined JoinedCurve JoinedCurveBox JoinedCurveBoxOptions JoinForm JordanDecomposition JordanModelDecomposition JulianDate JuliaSetBoettcher JuliaSetIterationCount JuliaSetPlot JuliaSetPoints' + - 'K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KEdgeConnectedComponents KEdgeConnectedGraphQ KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelFunction KernelMixtureDistribution Kernels Ket Key KeyCollisionFunction KeyComplement KeyDrop KeyDropFrom KeyExistsQ KeyFreeQ KeyIntersection KeyMap KeyMemberQ KeypointStrength Keys KeySelect KeySort KeySortBy KeyTake KeyUnion KeyValueMap KeyValuePattern Khinchin KillProcess KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnapsackSolve KnightTourGraph KnotData KnownUnitQ KochCurve KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter KVertexConnectedComponents KVertexConnectedGraphQ' + - 'LABColor Label Labeled LabeledSlider LabelingFunction LabelingSize LabelStyle LabelVisibility LaguerreL LakeData LambdaComponents LambertW LaminaData LanczosWindow LandauDistribution Language LanguageCategory LanguageData LanguageIdentify LanguageOptions LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCHColor LCM LeaderSize LeafCount LeapYearQ LearnDistribution LearnedDistribution LearningRate LearningRateMultipliers LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessEqualThan LessFullEqual LessGreater LessLess LessSlantEqual LessThan LessTilde LetterCharacter LetterCounts LetterNumber LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryDataType LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox Line3DBoxOptions LinearFilter LinearFractionalOptimization LinearFractionalTransform LinearGradientImage LinearizingTransformationData LinearLayer LinearModelFit LinearOffsetFunction LinearOptimization LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBoxOptions LineBreak LinebreakAdjustments LineBreakChart LinebreakSemicolonWeighting LineBreakWithin LineColor LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRankCentrality LinkRead LinkReadHeld LinkReadyQ Links LinkService LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot ListDensityPlot3D Listen ListFormat ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListSliceContourPlot3D ListSliceDensityPlot3D ListSliceVectorPlot3D ListStepPlot ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalAdaptiveBinarize LocalCache LocalClusteringCoefficient LocalizeDefinitions LocalizeVariables LocalObject LocalObjects LocalResponseNormalizationLayer LocalSubmit LocalSymbol LocalTime LocalTimeZone LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogisticSigmoid LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongestOrderedSequence LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow LongShortTermMemoryLayer Lookup Loopback LoopFreeGraphQ LossFunction LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowerTriangularMatrixQ LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LunarEclipse LUVColor LyapunovSolve LyonsGroupLy' + - 'MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MailAddressValidation MailExecute MailFolder MailItem MailReceiverFunction MailResponseFunction MailSearch MailServerConnect MailServerConnection MailSettings MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules ManagedLibraryExpressionID ManagedLibraryExpressionQ MandelbrotSetBoettcher MandelbrotSetDistance MandelbrotSetIterationCount MandelbrotSetMemberQ MandelbrotSetPlot MangoldtLambda ManhattanDistance Manipulate Manipulator MannedSpaceMissionData MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarchenkoPasturDistribution MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicalFunctionData MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixNormalDistribution MatrixPlot MatrixPower MatrixPropertyDistribution MatrixQ MatrixRank MatrixTDistribution Max MaxBend MaxCellMeasure MaxColorDistance MaxDetect MaxDuration MaxExtraBandwidths MaxExtraConditions MaxFeatureDisplacement MaxFeatures MaxFilter MaximalBy Maximize MaxItems MaxIterations MaxLimit MaxMemoryUsed MaxMixtureKernels MaxOverlapFraction MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxTrainingRounds MaxValue MaxwellDistribution MaxWordGap McLaughlinGroupMcL Mean MeanAbsoluteLossLayer MeanAround MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter MeanSquaredLossLayer Median MedianDeviation MedianFilter MedicalTestData Medium MeijerG MeijerGReduce MeixnerDistribution MellinConvolve MellinTransform MemberQ MemoryAvailable MemoryConstrained MemoryConstraint MemoryInUse MengerMesh Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuList MenuPacket MenuSortingValue MenuStyle MenuView Merge MergeDifferences MergingFunction MersennePrimeExponent MersennePrimeExponentQ Mesh MeshCellCentroid MeshCellCount MeshCellHighlight MeshCellIndex MeshCellLabel MeshCellMarker MeshCellMeasure MeshCellQuality MeshCells MeshCellShapeFunction MeshCellStyle MeshCoordinates MeshFunctions MeshPrimitives MeshQualityGoal MeshRange MeshRefinementFunction MeshRegion MeshRegionQ MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageObject MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation MeteorShowerData Method MethodOptions MexicanHatWavelet MeyerWavelet Midpoint Min MinColorDistance MinDetect MineralData MinFilter MinimalBy MinimalPolynomial MinimalStateSpaceModel Minimize MinimumTimeIncrement MinIntervalSize MinkowskiQuestionMark MinLimit MinMax MinorPlanetData Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingBehavior MissingDataMethod MissingDataRules MissingQ MissingString MissingStyle MissingValuePattern MittagLefflerE MixedFractionParts MixedGraphQ MixedMagnitude MixedRadix MixedRadixQuantity MixedUnit MixtureDistribution Mod Modal Mode Modular ModularInverse ModularLambda Module Modulus MoebiusMu Molecule MoleculeContainsQ MoleculeEquivalentQ MoleculeGraph MoleculeModify MoleculePattern MoleculePlot MoleculePlot3D MoleculeProperty MoleculeQ MoleculeValue Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction MomentOfInertia Monday Monitor MonomialList MonomialOrder MonsterGroupM MoonPhase MoonPosition MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform MortalityData Most MountainData MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovieData MovingAverage MovingMap MovingMedian MoyalDistribution Multicolumn MultiedgeStyle MultigraphQ MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity MultiplySides Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution' + - 'N NakagamiDistribution NameQ Names NamespaceBox NamespaceBoxOptions Nand NArgMax NArgMin NBernoulliB NBodySimulation NBodySimulationData NCache NDEigensystem NDEigenvalues NDSolve NDSolveValue Nearest NearestFunction NearestNeighborGraph NearestTo NebulaData NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeDefiniteMatrixQ NegativeIntegers NegativeMultinomialDistribution NegativeRationals NegativeReals NegativeSemidefiniteMatrixQ NeighborhoodData NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestGraph NestList NestWhile NestWhileList NetAppend NetBidirectionalOperator NetChain NetDecoder NetDelete NetDrop NetEncoder NetEvaluationMode NetExtract NetFlatten NetFoldOperator NetGraph NetInformation NetInitialize NetInsert NetInsertSharedArrays NetJoin NetMapOperator NetMapThreadOperator NetMeasurements NetModel NetNestOperator NetPairEmbeddingOperator NetPort NetPortGradient NetPrepend NetRename NetReplace NetReplacePart NetSharedArray NetStateObject NetTake NetTrain NetTrainResultsObject NetworkPacketCapture NetworkPacketRecording NetworkPacketRecordingDuring NetworkPacketTrace NeumannValue NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextCell NextDate NextPrime NextScheduledTaskTime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NightHemisphere NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants NondimensionalizationTransform None NoneTrue NonlinearModelFit NonlinearStateSpaceModel NonlocalMeansFilter NonNegative NonNegativeIntegers NonNegativeRationals NonNegativeReals NonPositive NonPositiveIntegers NonPositiveRationals NonPositiveReals Nor NorlundB Norm Normal NormalDistribution NormalGrouping NormalizationLayer Normalize Normalized NormalizedSquaredEuclideanDistance NormalMatrixQ NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookImport NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookTemplate NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde Nothing NotHumpDownHump NotHumpEqual NotificationFunction NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar Now NoWhitespace NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms NuclearExplosionData NuclearReactorData Null NullRecords NullSpace NullWords Number NumberCompose NumberDecompose NumberExpand NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberLinePlot NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator NumberSigns NumberString Numerator NumeratorDenominator NumericalOrder NumericalSort NumericArray NumericArrayQ NumericArrayType NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot' + - 'O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OceanData Octahedron OddQ Off Offset OLEData On ONanGroupON Once OneIdentity Opacity OpacityFunction OpacityFunctionScaling Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionalElement OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering OrderingBy OrderingLayer Orderless OrderlessPatternSequence OrnsteinUhlenbeckProcess Orthogonalize OrthogonalMatrixQ Out Outer OuterPolygon OuterPolyhedron OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OverwriteTarget OwenT OwnValues' + - 'Package PackingMethod PaddedForm Padding PaddingLayer PaddingSize PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageTheme PageWidth Pagination PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath PalindromeQ Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo Parallelepiped ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds Parallelogram ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParametricRegion ParentBox ParentCell ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParentNotebook ParetoDistribution ParetoPickandsDistribution ParkData Part PartBehavior PartialCorrelationFunction PartialD ParticleAcceleratorData ParticleData Partition PartitionGranularity PartitionsP PartitionsQ PartLayer PartOfSpeech PartProtection ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteAutoQuoteCharacters PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PeakDetect PeanoCurve PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PercentForm PerfectNumber PerfectNumberQ PerformanceGoal Perimeter PeriodicBoundaryCondition PeriodicInterpolation Periodogram PeriodogramArray Permanent Permissions PermissionsGroup PermissionsGroupMemberQ PermissionsGroups PermissionsKey PermissionsKeys PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PerpendicularBisector PersistenceLocation PersistenceTime PersistentObject PersistentObjects PersistentValue PersonData PERTDistribution PetersenGraph PhaseMargins PhaseRange PhysicalSystemData Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest PingTime Pink PitchRecognize Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarAngle PlanarGraph PlanarGraphQ PlanckRadiationLaw PlaneCurveData PlanetaryMoonData PlanetData PlantData Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLabels PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangeClipPlanesStyle PlotRangePadding PlotRegion PlotStyle PlotTheme Pluralize Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox Point3DBoxOptions PointBox PointBoxOptions PointFigureChart PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonalNumber PolygonAngle PolygonBox PolygonBoxOptions PolygonCoordinates PolygonDecomposition PolygonHoleScale PolygonIntersections PolygonScale Polyhedron PolyhedronAngle PolyhedronCoordinates PolyhedronData PolyhedronDecomposition PolyhedronGenus PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PoolingLayer PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position PositionIndex Positive PositiveDefiniteMatrixQ PositiveIntegers PositiveRationals PositiveReals PositiveSemidefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList PowerRange PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement Predict PredictionRoot PredictorFunction PredictorInformation PredictorMeasurements PredictorMeasurementsObject PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependLayer PrependTo PreprocessingRules PreserveColor PreserveImageOptions Previous PreviousCell PreviousDate PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitivePolynomialQ PrimitiveRoot PrimitiveRootList PrincipalComponents PrincipalValue Print PrintableASCIIQ PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment Printout3D Printout3DPreviewer PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateKey PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessConnection ProcessDirectory ProcessEnvironment Processes ProcessEstimator ProcessInformation ProcessObject ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessStatus ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm ProofObject Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse PsychrometricPropertyData PublicKey PublisherID PulsarData PunctuationCharacter Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions' + - 'QBinomial QFactorial QGamma QHypergeometricPFQ QnDispersion QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ QuadraticOptimization Quantile QuantilePlot Quantity QuantityArray QuantityDistribution QuantityForm QuantityMagnitude QuantityQ QuantityUnit QuantityVariable QuantityVariableCanonicalUnit QuantityVariableDimensions QuantityVariableIdentifier QuantityVariablePhysicalQuantity Quartics QuartileDeviation Quartiles QuartileSkewness Query QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder' + - 'RadialGradientImage RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RadonTransform RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Ramp Random RandomChoice RandomColor RandomComplex RandomEntity RandomFunction RandomGeoPosition RandomGraph RandomImage RandomInstance RandomInteger RandomPermutation RandomPoint RandomPolygon RandomPolyhedron RandomPrime RandomReal RandomSample RandomSeed RandomSeeding RandomVariate RandomWalkProcess RandomWord Range RangeFilter RangeSpecification RankedMax RankedMin RarerProbability Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadByteArray ReadLine ReadList ReadProtected ReadString Real RealAbs RealBlockDiagonalForm RealDigits RealExponent Reals RealSign Reap RecognitionPrior RecognitionThreshold Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RectangularRepeatingElement RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate Region RegionBinarize RegionBoundary RegionBounds RegionCentroid RegionDifference RegionDimension RegionDisjoint RegionDistance RegionDistanceFunction RegionEmbeddingDimension RegionEqual RegionFunction RegionImage RegionIntersection RegionMeasure RegionMember RegionMemberFunction RegionMoment RegionNearest RegionNearestFunction RegionPlot RegionPlot3D RegionProduct RegionQ RegionResize RegionSize RegionSymmetricDifference RegionUnion RegionWithin RegisterExternalEvaluator RegularExpression Regularization RegularlySampledQ RegularPolygon ReIm ReImLabels ReImPlot ReImStyle Reinstall RelationalDatabase RelationGraph Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot RemoteAuthorizationCaching RemoteConnect RemoteConnectionObject RemoteFile RemoteRun RemoteRunProcess Remove RemoveAlphaChannel RemoveAsynchronousTask RemoveAudioStream RemoveBackground RemoveChannelListener RemoveChannelSubscribers Removed RemoveDiacritics RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RemoveUsers RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart RepairMesh Repeated RepeatedNull RepeatedString RepeatedTiming RepeatingElement Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated ReplicateLayer RequiredPhysicalQuantities Resampling ResamplingAlgorithmData ResamplingMethod Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask ReshapeLayer Residue ResizeLayer Resolve ResourceAcquire ResourceData ResourceFunction ResourceObject ResourceRegister ResourceRemove ResourceSearch ResourceSubmissionObject ResourceSubmit ResourceSystemBase ResourceUpdate ResponseForm Rest RestartInterval Restricted Resultant ResumePacket Return ReturnEntersInput ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnReceiptFunction ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseSort ReverseSortBy ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ RiemannXi Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightComposition RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity RollPitchYawAngles RollPitchYawMatrix RomanNumeral Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RSolveValue RudinShapiro RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulePlot RulerUnits Run RunProcess RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity' + - 'SameQ SameTest SampledEntityClass SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SASTriangle SatelliteData SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveConnection SaveDefinitions SavitzkyGolayMatrix SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTask ScheduledTaskActiveQ ScheduledTaskInformation ScheduledTaskInformationData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScientificNotationThreshold ScorerGi ScorerGiPrime ScorerHi ScorerHiPrime ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptForm ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition SearchAdjustment SearchIndexObject SearchIndices SearchQueryString SearchResultObject Sec Sech SechDistribution SecondOrderConeOptimization SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SecuredAuthenticationKey SecuredAuthenticationKeys SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook SelectFirst Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemanticImport SemanticImportString SemanticInterpretation SemialgebraicComponentInstances SemidefiniteOptimization SendMail SendMessage Sequence SequenceAlignment SequenceAttentionLayer SequenceCases SequenceCount SequenceFold SequenceFoldList SequenceForm SequenceHold SequenceLastLayer SequenceMostLayer SequencePosition SequencePredict SequencePredictorFunction SequenceReplace SequenceRestLayer SequenceReverseLayer SequenceSplit Series SeriesCoefficient SeriesData ServiceConnect ServiceDisconnect ServiceExecute ServiceObject ServiceRequest ServiceResponse ServiceSubmit SessionSubmit SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetCloudDirectory SetCookies SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPermissions SetPrecision SetProperty SetSecuredAuthenticationKey SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemModel SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetUsers SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share SharingList Sharpen ShearingMatrix ShearingTransform ShellRegion ShenCastanMatrix ShiftedGompertzDistribution ShiftRegisterSequence Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortTimeFourier ShortTimeFourierData ShortUpArrow Show ShowAutoConvert ShowAutoSpellCheck ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowCodeAssist ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiderealTime SiegelTheta SiegelTukeyTest SierpinskiCurve SierpinskiMesh Sign Signature SignedRankTest SignedRegionDistance SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ SimplePolygonQ SimplePolyhedronQ Simplex Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution SkinStyle Skip SliceContourPlot3D SliceDensityPlot3D SliceDistribution SliceVectorPlot3D Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDecomposition SmithDelayCompensator SmithWatermanSimilarity SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SnDispersion Snippet SnubPolyhedron SocialMediaData Socket SocketConnect SocketListen SocketListener SocketObject SocketOpen SocketReadMessage SocketReadyQ Sockets SocketWaitAll SocketWaitNext SoftmaxLayer SokalSneathDissimilarity SolarEclipse SolarSystemFeatureData SolidAngle SolidData SolidRegionQ Solve SolveAlways SolveDelayed Sort SortBy SortedBy SortedEntityClass Sound SoundAndGraphics SoundNote SoundVolume SourceLink Sow Space SpaceCurveData SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution SpatialMedian SpatialTransformationLayer Speak SpeakTextPacket SpearmanRankTest SpearmanRho SpeciesData SpecificityGoal SpectralLineData Spectrogram SpectrogramArray Specularity SpeechRecognize SpeechSynthesize SpellingCorrection SpellingCorrectionList SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SpherePoints SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SphericalShell SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquareMatrixQ SquareRepeatingElement SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave SSSTriangle StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackedDateListPlot StackedListPlot StackInhibit StadiumShape StandardAtmosphereData StandardDeviation StandardDeviationFilter StandardForm Standardize Standardized StandardOceanData StandbyDistribution Star StarClusterData StarData StarGraph StartAsynchronousTask StartExternalSession StartingStepSize StartOfLine StartOfString StartProcess StartScheduledTask StartupSound StartWebSession StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StateTransformationLinearize StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StereochemistryElements StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StoppingPowerData StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamMarkers StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringContainsQ StringCount StringDelete StringDrop StringEndsQ StringExpression StringExtract StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPadLeft StringPadRight StringPart StringPartition StringPosition StringQ StringRepeat StringReplace StringReplaceList StringReplacePart StringReverse StringRiffle StringRotateLeft StringRotateRight StringSkeleton StringSplit StringStartsQ StringTake StringTemplate StringToByteArray StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleData StyleDefinitions StyleForm StyleHints StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subdivide Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subsequences Subset SubsetEqual SubsetMap SubsetQ Subsets SubStar SubstitutionSystem Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubtractSides SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde Success SuchThat Sum SumConvergence SummationLayer Sunday SunPosition Sunrise Sunset SuperDagger SuperMinus SupernovaData SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceArea SurfaceColor SurfaceData SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricKey SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Synonyms Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SynthesizeMissingValues SystemDialogInput SystemException SystemGet SystemHelpPath SystemInformation SystemInformationData SystemInstall SystemModel SystemModeler SystemModelExamples SystemModelLinearize SystemModelParametricSimulate SystemModelPlot SystemModelProgressReporting SystemModelReliability SystemModels SystemModelSimulate SystemModelSimulateSensitivity SystemModelSimulationData SystemOpen SystemOptions SystemProcessData SystemProcesses SystemsConnectionsModel SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelLinearity SystemsModelMerge SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemsModelVectorRelativeOrders SystemStub SystemTest' + - 'Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TableViewBoxBackground TableViewBoxOptions TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeDrop TakeLargest TakeLargestBy TakeList TakeSmallest TakeSmallestBy TakeWhile Tally Tan Tanh TargetDevice TargetFunctions TargetSystem TargetUnits TaskAbort TaskExecute TaskObject TaskRemove TaskResume Tasks TaskSuspend TaskWait TautologyQ TelegraphProcess TemplateApply TemplateArgBox TemplateBox TemplateBoxOptions TemplateEvaluate TemplateExpression TemplateIf TemplateObject TemplateSequence TemplateSlot TemplateSlotSequence TemplateUnevaluated TemplateVerbatim TemplateWith TemporalData TemporalRegularity Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge TestID TestReport TestReportObject TestResultObject Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCases TextCell TextClipboardType TextContents TextData TextElement TextForm TextGrid TextJustification TextLine TextPacket TextParagraph TextPosition TextRecognize TextSearch TextSearchReport TextSentences TextString TextStructure TextStyle TextTranslation Texture TextureCoordinateFunction TextureCoordinateScaling TextWords Therefore ThermodynamicData ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreadingLayer ThreeJSymbol Threshold Through Throw ThueMorse Thumbnail Thursday Ticks TicksStyle TideData Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint TimeDirection TimeFormat TimeGoal TimelinePlot TimeObject TimeObjectQ Times TimesBy TimeSeries TimeSeriesAggregate TimeSeriesForecast TimeSeriesInsert TimeSeriesInvertibility TimeSeriesMap TimeSeriesMapThread TimeSeriesModel TimeSeriesModelFit TimeSeriesResample TimeSeriesRescale TimeSeriesShift TimeSeriesThread TimeSeriesWindow TimeUsed TimeValue TimeWarpingCorrespondence TimeWarpingDistance TimeZone TimeZoneConvert TimeZoneOffset Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate Today ToDiscreteTimeModel ToEntity ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase Tomorrow ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform ToPolarCoordinates TopologicalSort ToRadicals ToRules ToSphericalCoordinates ToString Total TotalHeight TotalLayer TotalVariationFilter TotalWidth TouchPosition TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TrackingFunction TracyWidomDistribution TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TrainingProgressCheckpointing TrainingProgressFunction TrainingProgressMeasurements TrainingProgressReporting TrainingStoppingCriterion TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationClass TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField TransformedProcess TransformedRegion TransitionDirection TransitionDuration TransitionEffect TransitiveClosureGraph TransitiveReductionGraph Translate TranslationOptions TranslationTransform Transliterate Transparent TransparentColor Transpose TransposeLayer TrapSelection TravelDirections TravelDirectionsData TravelDistance TravelDistanceList TravelMethod TravelTime TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle Triangle TriangleCenter TriangleConstruct TriangleMeasurement TriangleWave TriangularDistribution TriangulateMesh Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean TrimmedVariance TropicalStormData True TrueQ TruncatedDistribution TruncatedPolyhedron TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBoxOptions TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow TunnelData Tuples TuranGraph TuringMachine TuttePolynomial TwoWayRule Typed TypeSpecifier' + - 'UnateQ Uncompress UnconstrainedParameters Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UnderseaFeatureData UndirectedEdge UndirectedGraph UndirectedGraphQ UndoOptions UndoTrackedVariables Unequal UnequalTo Unevaluated UniformDistribution UniformGraphDistribution UniformPolyhedron UniformSumDistribution Uninstall Union UnionPlus Unique UnitaryMatrixQ UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitSystem UnitTriangle UnitVector UnitVectorLayer UnityDimensions UniverseModelData UniversityData UnixTime Unprotect UnregisterExternalEvaluator UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpdateSearchIndex UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize UpperTriangularMatrixQ Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpTo UpValues URL URLBuild URLDecode URLDispatcher URLDownload URLDownloadSubmit URLEncode URLExecute URLExpand URLFetch URLFetchAsynchronous URLParse URLQueryDecode URLQueryEncode URLRead URLResponseTime URLSave URLSaveAsynchronous URLShorten URLSubmit UseGraphicsRange UserDefinedWavelet Using UsingFrontEnd UtilityFunction' + - 'V2Get ValenceErrorHandling ValidationLength ValidationSet Value ValueBox ValueBoxOptions ValueDimensions ValueForm ValuePreprocessingFunction ValueQ Values ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorAround VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorGreater VectorGreaterEqual VectorLess VectorLessEqual VectorMarkers VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerificationTest VerifyConvergence VerifyDerivedKey VerifyDigitalSignature VerifyInterpretation VerifySecurityCertificates VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexContract VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight VertexWeightedGraphQ Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewProjection ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoiceStyleData VoigtDistribution VolcanoData Volume VonMisesDistribution VoronoiMesh' + - 'WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WarpingCorrespondence WarpingDistance WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeatherForecastData WebAudioSearch WebElementObject WeberE WebExecute WebImage WebImageSearch WebSearch WebSessionObject WebSessions WebWindowObject Wedge Wednesday WeibullDistribution WeierstrassE1 WeierstrassE2 WeierstrassE3 WeierstrassEta1 WeierstrassEta2 WeierstrassEta3 WeierstrassHalfPeriods WeierstrassHalfPeriodW1 WeierstrassHalfPeriodW2 WeierstrassHalfPeriodW3 WeierstrassInvariantG2 WeierstrassInvariantG3 WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White WhiteNoiseProcess WhitePoint Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WikipediaData WikipediaSearch WilksW WilksWTest WindDirectionData WindingCount WindingPolygon WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowPersistentStyles WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth WindSpeedData WindVectorData WinsorizedMean WinsorizedVariance WishartMatrixDistribution With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult WolframLanguageData Word WordBoundary WordCharacter WordCloud WordCount WordCounts WordData WordDefinition WordFrequency WordFrequencyData WordList WordOrientation WordSearch WordSelectionFunction WordSeparators WordSpacings WordStem WordTranslation WorkingPrecision WrapAround Write WriteLine WriteString Wronskian' + - 'XMLElement XMLObject XMLTemplate Xnor Xor XYZColor' + - 'Yellow Yesterday YuleDissimilarity' + - 'ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZIPCodeData ZipfDistribution ZoomCenter ZoomFactor ZTest ZTransform' + + 'GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins GalaxyData GalleryView Gamma GammaDistribution GammaRegularized GapPenalty GARCHProcess GatedRecurrentLayer Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianOrthogonalMatrixDistribution GaussianSymplecticMatrixDistribution GaussianUnitaryMatrixDistribution GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateAsymmetricKeyPair GenerateConditions GeneratedCell GeneratedDocumentBinding GenerateDerivedKey GenerateDigitalSignature GenerateDocument GeneratedParameters GeneratedQuantityMagnitudes GenerateHTTPResponse GenerateSecuredAuthenticationKey GenerateSymmetricKey GeneratingFunction GeneratorDescription GeneratorHistoryLength GeneratorOutputType Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeoAntipode GeoArea GeoArraySize GeoBackground GeoBoundingBox GeoBounds GeoBoundsRegion GeoBubbleChart GeoCenter GeoCircle GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDisk GeoDisplacement GeoDistance GeoDistanceList GeoElevationData GeoEntities GeoGraphics GeogravityModelData GeoGridDirectionDifference GeoGridLines GeoGridLinesStyle GeoGridPosition GeoGridRange GeoGridRangePadding GeoGridUnitArea GeoGridUnitDistance GeoGridVector GeoGroup GeoHemisphere GeoHemisphereBoundary GeoHistogram GeoIdentify GeoImage GeoLabels GeoLength GeoListPlot GeoLocation GeologicalPeriodData GeomagneticModelData GeoMarker GeometricAssertion GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricScene GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoModel GeoNearest GeoPath GeoPosition GeoPositionENU GeoPositionXYZ GeoProjection GeoProjectionData GeoRange GeoRangePadding GeoRegionValuePlot GeoResolution GeoScaleBar GeoServer GeoSmoothHistogram GeoStreamPlot GeoStyling GeoStylingImageFunction GeoVariant GeoVector GeoVectorENU GeoVectorPlot GeoVectorXYZ GeoVisibleRegion GeoVisibleRegionBoundary GeoWithinQ GeoZoomLevel GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenAngle GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter GrammarApply GrammarRules GrammarToken Graph Graph3D GraphAssortativity GraphAutomorphismGroup GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel Greater GreaterEqual GreaterEqualLess GreaterEqualThan GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterThan GreaterTilde Green GreenFunction Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupBy GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators Groupings GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain GroupTogetherGrouping GroupTogetherNestedGrouping GrowCutComponents Gudermannian GuidedFilter GumbelDistribution ' + + 'HaarWavelet HadamardMatrix HalfLine HalfNormalDistribution HalfPlane HalfSpace HamiltonianGraphQ HammingDistance HammingWindow HandlerFunctions HandlerFunctionsKeys HankelH1 HankelH2 HankelMatrix HankelTransform HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash Haversine HazardFunction Head HeadCompose HeaderLines Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings Here HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenMarkovProcess HiddenSurface Highlighted HighlightGraph HighlightImage HighlightMesh HighpassFilter HigmanSimsGroupHS HilbertCurve HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HistoricalPeriodData HitMissTransform HITSCentrality HjorthDistribution HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HostLookup HotellingTSquareDistribution HoytDistribution HTMLSave HTTPErrorResponse HTTPRedirect HTTPRequest HTTPRequestData HTTPResponse Hue HumanGrowthData HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyperplane Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData ' + + 'I IconData Iconize IconizedObject IconRules Icosahedron Identity IdentityMatrix If IgnoreCase IgnoreDiacritics IgnorePunctuation IgnoreSpellCheck IgnoringInactive Im Image Image3D Image3DProjection Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageApplyIndexed ImageAspectRatio ImageAssemble ImageAugmentationLayer ImageBoundingBoxes ImageCache ImageCacheValid ImageCapture ImageCaptureFunction ImageCases ImageChannels ImageClip ImageCollage ImageColorSpace ImageCompose ImageContainsQ ImageContents ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDisplacements ImageDistance ImageEffect ImageExposureCombine ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageFocusCombine ImageForestingComponents ImageFormattingWidth ImageForwardTransformation ImageGraphics ImageHistogram ImageIdentify ImageInstanceQ ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarker ImageMarkers ImageMeasurements ImageMesh ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImagePosition ImagePreviewFunction ImagePyramid ImagePyramidApply ImageQ ImageRangeCache ImageRecolor ImageReflect ImageRegion ImageResize ImageResolution ImageRestyle ImageRotate ImageRotated ImageSaliencyFilter ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions ImagingDevice ImplicitRegion Implies Import ImportAutoReplacements ImportByteArray ImportOptions ImportString ImprovementImportance In Inactivate Inactive IncidenceGraph IncidenceList IncidenceMatrix IncludeAromaticBonds IncludeConstantBasis IncludeDefinitions IncludeDirectories IncludeFileExtension IncludeGeneratorTasks IncludeHydrogens IncludeInflections IncludeMetaInformation IncludePods IncludeQuantities IncludeRelatedTables IncludeSingularTerm IncludeWindowTimes Increment IndefiniteMatrixQ Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentPhysicalQuantity IndependentUnit IndependentUnitDimension IndependentVertexSetQ Indeterminate IndeterminateThreshold IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers InfiniteLine InfinitePlane Infinity Infix InflationAdjust InflationMethod Information InformationData InformationDataGrid Inherited InheritScope InhomogeneousPoissonProcess InitialEvaluationHistory Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InitializationObjects InitializationValue Initialize InitialSeeding InlineCounterAssignments InlineCounterIncrements InlineRules Inner InnerPolygon InnerPolyhedron Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionFunction InsertionPointObject InsertLinebreaks InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Insphere Install InstallService InstanceNormalizationLayer InString Integer IntegerDigits IntegerExponent IntegerLength IntegerName IntegerPart IntegerPartitions IntegerQ IntegerReverse Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction Interpreter InterpretTemplate InterquartileRange Interrupt InterruptSettings IntersectingQ Intersection Interval IntervalIntersection IntervalMarkers IntervalMarkersStyle IntervalMemberQ IntervalSlider IntervalUnion Into Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHankelTransform InverseHaversine InverseImagePyramid InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InverseMellinTransform InversePermutation InverseRadon InverseRadonTransform InverseSeries InverseShortTimeFourier InverseSpectrogram InverseSurvivalFunction InverseTransformedRegion InverseWaveletTransform InverseWeierstrassP InverseWishartMatrixDistribution InverseZTransform Invisible InvisibleApplication InvisibleTimes IPAddress IrreduciblePolynomialQ IslandData IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemAspectRatio ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess ' + + 'JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join JoinAcross Joined JoinedCurve JoinedCurveBox JoinedCurveBoxOptions JoinForm JordanDecomposition JordanModelDecomposition JulianDate JuliaSetBoettcher JuliaSetIterationCount JuliaSetPlot JuliaSetPoints ' + + 'K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KEdgeConnectedComponents KEdgeConnectedGraphQ KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelFunction KernelMixtureDistribution Kernels Ket Key KeyCollisionFunction KeyComplement KeyDrop KeyDropFrom KeyExistsQ KeyFreeQ KeyIntersection KeyMap KeyMemberQ KeypointStrength Keys KeySelect KeySort KeySortBy KeyTake KeyUnion KeyValueMap KeyValuePattern Khinchin KillProcess KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnapsackSolve KnightTourGraph KnotData KnownUnitQ KochCurve KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter KVertexConnectedComponents KVertexConnectedGraphQ ' + + 'LABColor Label Labeled LabeledSlider LabelingFunction LabelingSize LabelStyle LabelVisibility LaguerreL LakeData LambdaComponents LambertW LaminaData LanczosWindow LandauDistribution Language LanguageCategory LanguageData LanguageIdentify LanguageOptions LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCHColor LCM LeaderSize LeafCount LeapYearQ LearnDistribution LearnedDistribution LearningRate LearningRateMultipliers LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessEqualThan LessFullEqual LessGreater LessLess LessSlantEqual LessThan LessTilde LetterCharacter LetterCounts LetterNumber LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryDataType LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox Line3DBoxOptions LinearFilter LinearFractionalOptimization LinearFractionalTransform LinearGradientImage LinearizingTransformationData LinearLayer LinearModelFit LinearOffsetFunction LinearOptimization LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBoxOptions LineBreak LinebreakAdjustments LineBreakChart LinebreakSemicolonWeighting LineBreakWithin LineColor LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRankCentrality LinkRead LinkReadHeld LinkReadyQ Links LinkService LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot ListDensityPlot3D Listen ListFormat ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListSliceContourPlot3D ListSliceDensityPlot3D ListSliceVectorPlot3D ListStepPlot ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalAdaptiveBinarize LocalCache LocalClusteringCoefficient LocalizeDefinitions LocalizeVariables LocalObject LocalObjects LocalResponseNormalizationLayer LocalSubmit LocalSymbol LocalTime LocalTimeZone LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogisticSigmoid LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongestOrderedSequence LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow LongShortTermMemoryLayer Lookup Loopback LoopFreeGraphQ LossFunction LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowerTriangularMatrixQ LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LunarEclipse LUVColor LyapunovSolve LyonsGroupLy ' + + 'MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MailAddressValidation MailExecute MailFolder MailItem MailReceiverFunction MailResponseFunction MailSearch MailServerConnect MailServerConnection MailSettings MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules ManagedLibraryExpressionID ManagedLibraryExpressionQ MandelbrotSetBoettcher MandelbrotSetDistance MandelbrotSetIterationCount MandelbrotSetMemberQ MandelbrotSetPlot MangoldtLambda ManhattanDistance Manipulate Manipulator MannedSpaceMissionData MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarchenkoPasturDistribution MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicalFunctionData MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixNormalDistribution MatrixPlot MatrixPower MatrixPropertyDistribution MatrixQ MatrixRank MatrixTDistribution Max MaxBend MaxCellMeasure MaxColorDistance MaxDetect MaxDuration MaxExtraBandwidths MaxExtraConditions MaxFeatureDisplacement MaxFeatures MaxFilter MaximalBy Maximize MaxItems MaxIterations MaxLimit MaxMemoryUsed MaxMixtureKernels MaxOverlapFraction MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxTrainingRounds MaxValue MaxwellDistribution MaxWordGap McLaughlinGroupMcL Mean MeanAbsoluteLossLayer MeanAround MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter MeanSquaredLossLayer Median MedianDeviation MedianFilter MedicalTestData Medium MeijerG MeijerGReduce MeixnerDistribution MellinConvolve MellinTransform MemberQ MemoryAvailable MemoryConstrained MemoryConstraint MemoryInUse MengerMesh Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuList MenuPacket MenuSortingValue MenuStyle MenuView Merge MergeDifferences MergingFunction MersennePrimeExponent MersennePrimeExponentQ Mesh MeshCellCentroid MeshCellCount MeshCellHighlight MeshCellIndex MeshCellLabel MeshCellMarker MeshCellMeasure MeshCellQuality MeshCells MeshCellShapeFunction MeshCellStyle MeshCoordinates MeshFunctions MeshPrimitives MeshQualityGoal MeshRange MeshRefinementFunction MeshRegion MeshRegionQ MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageObject MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation MeteorShowerData Method MethodOptions MexicanHatWavelet MeyerWavelet Midpoint Min MinColorDistance MinDetect MineralData MinFilter MinimalBy MinimalPolynomial MinimalStateSpaceModel Minimize MinimumTimeIncrement MinIntervalSize MinkowskiQuestionMark MinLimit MinMax MinorPlanetData Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingBehavior MissingDataMethod MissingDataRules MissingQ MissingString MissingStyle MissingValuePattern MittagLefflerE MixedFractionParts MixedGraphQ MixedMagnitude MixedRadix MixedRadixQuantity MixedUnit MixtureDistribution Mod Modal Mode Modular ModularInverse ModularLambda Module Modulus MoebiusMu Molecule MoleculeContainsQ MoleculeEquivalentQ MoleculeGraph MoleculeModify MoleculePattern MoleculePlot MoleculePlot3D MoleculeProperty MoleculeQ MoleculeValue Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction MomentOfInertia Monday Monitor MonomialList MonomialOrder MonsterGroupM MoonPhase MoonPosition MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform MortalityData Most MountainData MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovieData MovingAverage MovingMap MovingMedian MoyalDistribution Multicolumn MultiedgeStyle MultigraphQ MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity MultiplySides Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution ' + + 'N NakagamiDistribution NameQ Names NamespaceBox NamespaceBoxOptions Nand NArgMax NArgMin NBernoulliB NBodySimulation NBodySimulationData NCache NDEigensystem NDEigenvalues NDSolve NDSolveValue Nearest NearestFunction NearestNeighborGraph NearestTo NebulaData NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeDefiniteMatrixQ NegativeIntegers NegativeMultinomialDistribution NegativeRationals NegativeReals NegativeSemidefiniteMatrixQ NeighborhoodData NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestGraph NestList NestWhile NestWhileList NetAppend NetBidirectionalOperator NetChain NetDecoder NetDelete NetDrop NetEncoder NetEvaluationMode NetExtract NetFlatten NetFoldOperator NetGraph NetInformation NetInitialize NetInsert NetInsertSharedArrays NetJoin NetMapOperator NetMapThreadOperator NetMeasurements NetModel NetNestOperator NetPairEmbeddingOperator NetPort NetPortGradient NetPrepend NetRename NetReplace NetReplacePart NetSharedArray NetStateObject NetTake NetTrain NetTrainResultsObject NetworkPacketCapture NetworkPacketRecording NetworkPacketRecordingDuring NetworkPacketTrace NeumannValue NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextCell NextDate NextPrime NextScheduledTaskTime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NightHemisphere NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants NondimensionalizationTransform None NoneTrue NonlinearModelFit NonlinearStateSpaceModel NonlocalMeansFilter NonNegative NonNegativeIntegers NonNegativeRationals NonNegativeReals NonPositive NonPositiveIntegers NonPositiveRationals NonPositiveReals Nor NorlundB Norm Normal NormalDistribution NormalGrouping NormalizationLayer Normalize Normalized NormalizedSquaredEuclideanDistance NormalMatrixQ NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookImport NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookTemplate NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde Nothing NotHumpDownHump NotHumpEqual NotificationFunction NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar Now NoWhitespace NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms NuclearExplosionData NuclearReactorData Null NullRecords NullSpace NullWords Number NumberCompose NumberDecompose NumberExpand NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberLinePlot NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator NumberSigns NumberString Numerator NumeratorDenominator NumericalOrder NumericalSort NumericArray NumericArrayQ NumericArrayType NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot ' + + 'O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OceanData Octahedron OddQ Off Offset OLEData On ONanGroupON Once OneIdentity Opacity OpacityFunction OpacityFunctionScaling Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionalElement OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering OrderingBy OrderingLayer Orderless OrderlessPatternSequence OrnsteinUhlenbeckProcess Orthogonalize OrthogonalMatrixQ Out Outer OuterPolygon OuterPolyhedron OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OverwriteTarget OwenT OwnValues ' + + 'Package PackingMethod PaddedForm Padding PaddingLayer PaddingSize PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageTheme PageWidth Pagination PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath PalindromeQ Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo Parallelepiped ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds Parallelogram ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParametricRegion ParentBox ParentCell ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParentNotebook ParetoDistribution ParetoPickandsDistribution ParkData Part PartBehavior PartialCorrelationFunction PartialD ParticleAcceleratorData ParticleData Partition PartitionGranularity PartitionsP PartitionsQ PartLayer PartOfSpeech PartProtection ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteAutoQuoteCharacters PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PeakDetect PeanoCurve PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PercentForm PerfectNumber PerfectNumberQ PerformanceGoal Perimeter PeriodicBoundaryCondition PeriodicInterpolation Periodogram PeriodogramArray Permanent Permissions PermissionsGroup PermissionsGroupMemberQ PermissionsGroups PermissionsKey PermissionsKeys PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PerpendicularBisector PersistenceLocation PersistenceTime PersistentObject PersistentObjects PersistentValue PersonData PERTDistribution PetersenGraph PhaseMargins PhaseRange PhysicalSystemData Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest PingTime Pink PitchRecognize Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarAngle PlanarGraph PlanarGraphQ PlanckRadiationLaw PlaneCurveData PlanetaryMoonData PlanetData PlantData Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLabels PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangeClipPlanesStyle PlotRangePadding PlotRegion PlotStyle PlotTheme Pluralize Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox Point3DBoxOptions PointBox PointBoxOptions PointFigureChart PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonalNumber PolygonAngle PolygonBox PolygonBoxOptions PolygonCoordinates PolygonDecomposition PolygonHoleScale PolygonIntersections PolygonScale Polyhedron PolyhedronAngle PolyhedronCoordinates PolyhedronData PolyhedronDecomposition PolyhedronGenus PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PoolingLayer PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position PositionIndex Positive PositiveDefiniteMatrixQ PositiveIntegers PositiveRationals PositiveReals PositiveSemidefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList PowerRange PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement Predict PredictionRoot PredictorFunction PredictorInformation PredictorMeasurements PredictorMeasurementsObject PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependLayer PrependTo PreprocessingRules PreserveColor PreserveImageOptions Previous PreviousCell PreviousDate PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitivePolynomialQ PrimitiveRoot PrimitiveRootList PrincipalComponents PrincipalValue Print PrintableASCIIQ PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment Printout3D Printout3DPreviewer PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateKey PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessConnection ProcessDirectory ProcessEnvironment Processes ProcessEstimator ProcessInformation ProcessObject ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessStatus ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm ProofObject Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse PsychrometricPropertyData PublicKey PublisherID PulsarData PunctuationCharacter Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions ' + + 'QBinomial QFactorial QGamma QHypergeometricPFQ QnDispersion QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ QuadraticOptimization Quantile QuantilePlot Quantity QuantityArray QuantityDistribution QuantityForm QuantityMagnitude QuantityQ QuantityUnit QuantityVariable QuantityVariableCanonicalUnit QuantityVariableDimensions QuantityVariableIdentifier QuantityVariablePhysicalQuantity Quartics QuartileDeviation Quartiles QuartileSkewness Query QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder ' + + 'RadialGradientImage RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RadonTransform RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Ramp Random RandomChoice RandomColor RandomComplex RandomEntity RandomFunction RandomGeoPosition RandomGraph RandomImage RandomInstance RandomInteger RandomPermutation RandomPoint RandomPolygon RandomPolyhedron RandomPrime RandomReal RandomSample RandomSeed RandomSeeding RandomVariate RandomWalkProcess RandomWord Range RangeFilter RangeSpecification RankedMax RankedMin RarerProbability Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadByteArray ReadLine ReadList ReadProtected ReadString Real RealAbs RealBlockDiagonalForm RealDigits RealExponent Reals RealSign Reap RecognitionPrior RecognitionThreshold Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RectangularRepeatingElement RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate Region RegionBinarize RegionBoundary RegionBounds RegionCentroid RegionDifference RegionDimension RegionDisjoint RegionDistance RegionDistanceFunction RegionEmbeddingDimension RegionEqual RegionFunction RegionImage RegionIntersection RegionMeasure RegionMember RegionMemberFunction RegionMoment RegionNearest RegionNearestFunction RegionPlot RegionPlot3D RegionProduct RegionQ RegionResize RegionSize RegionSymmetricDifference RegionUnion RegionWithin RegisterExternalEvaluator RegularExpression Regularization RegularlySampledQ RegularPolygon ReIm ReImLabels ReImPlot ReImStyle Reinstall RelationalDatabase RelationGraph Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot RemoteAuthorizationCaching RemoteConnect RemoteConnectionObject RemoteFile RemoteRun RemoteRunProcess Remove RemoveAlphaChannel RemoveAsynchronousTask RemoveAudioStream RemoveBackground RemoveChannelListener RemoveChannelSubscribers Removed RemoveDiacritics RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RemoveUsers RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart RepairMesh Repeated RepeatedNull RepeatedString RepeatedTiming RepeatingElement Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated ReplicateLayer RequiredPhysicalQuantities Resampling ResamplingAlgorithmData ResamplingMethod Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask ReshapeLayer Residue ResizeLayer Resolve ResourceAcquire ResourceData ResourceFunction ResourceObject ResourceRegister ResourceRemove ResourceSearch ResourceSubmissionObject ResourceSubmit ResourceSystemBase ResourceUpdate ResponseForm Rest RestartInterval Restricted Resultant ResumePacket Return ReturnEntersInput ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnReceiptFunction ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseSort ReverseSortBy ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ RiemannXi Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightComposition RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity RollPitchYawAngles RollPitchYawMatrix RomanNumeral Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RSolveValue RudinShapiro RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulePlot RulerUnits Run RunProcess RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity ' + + 'SameQ SameTest SampledEntityClass SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SASTriangle SatelliteData SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveConnection SaveDefinitions SavitzkyGolayMatrix SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTask ScheduledTaskActiveQ ScheduledTaskInformation ScheduledTaskInformationData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScientificNotationThreshold ScorerGi ScorerGiPrime ScorerHi ScorerHiPrime ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptForm ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition SearchAdjustment SearchIndexObject SearchIndices SearchQueryString SearchResultObject Sec Sech SechDistribution SecondOrderConeOptimization SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SecuredAuthenticationKey SecuredAuthenticationKeys SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook SelectFirst Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemanticImport SemanticImportString SemanticInterpretation SemialgebraicComponentInstances SemidefiniteOptimization SendMail SendMessage Sequence SequenceAlignment SequenceAttentionLayer SequenceCases SequenceCount SequenceFold SequenceFoldList SequenceForm SequenceHold SequenceLastLayer SequenceMostLayer SequencePosition SequencePredict SequencePredictorFunction SequenceReplace SequenceRestLayer SequenceReverseLayer SequenceSplit Series SeriesCoefficient SeriesData ServiceConnect ServiceDisconnect ServiceExecute ServiceObject ServiceRequest ServiceResponse ServiceSubmit SessionSubmit SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetCloudDirectory SetCookies SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPermissions SetPrecision SetProperty SetSecuredAuthenticationKey SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemModel SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetUsers SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share SharingList Sharpen ShearingMatrix ShearingTransform ShellRegion ShenCastanMatrix ShiftedGompertzDistribution ShiftRegisterSequence Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortTimeFourier ShortTimeFourierData ShortUpArrow Show ShowAutoConvert ShowAutoSpellCheck ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowCodeAssist ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiderealTime SiegelTheta SiegelTukeyTest SierpinskiCurve SierpinskiMesh Sign Signature SignedRankTest SignedRegionDistance SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ SimplePolygonQ SimplePolyhedronQ Simplex Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution SkinStyle Skip SliceContourPlot3D SliceDensityPlot3D SliceDistribution SliceVectorPlot3D Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDecomposition SmithDelayCompensator SmithWatermanSimilarity SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SnDispersion Snippet SnubPolyhedron SocialMediaData Socket SocketConnect SocketListen SocketListener SocketObject SocketOpen SocketReadMessage SocketReadyQ Sockets SocketWaitAll SocketWaitNext SoftmaxLayer SokalSneathDissimilarity SolarEclipse SolarSystemFeatureData SolidAngle SolidData SolidRegionQ Solve SolveAlways SolveDelayed Sort SortBy SortedBy SortedEntityClass Sound SoundAndGraphics SoundNote SoundVolume SourceLink Sow Space SpaceCurveData SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution SpatialMedian SpatialTransformationLayer Speak SpeakTextPacket SpearmanRankTest SpearmanRho SpeciesData SpecificityGoal SpectralLineData Spectrogram SpectrogramArray Specularity SpeechRecognize SpeechSynthesize SpellingCorrection SpellingCorrectionList SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SpherePoints SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SphericalShell SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquareMatrixQ SquareRepeatingElement SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave SSSTriangle StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackedDateListPlot StackedListPlot StackInhibit StadiumShape StandardAtmosphereData StandardDeviation StandardDeviationFilter StandardForm Standardize Standardized StandardOceanData StandbyDistribution Star StarClusterData StarData StarGraph StartAsynchronousTask StartExternalSession StartingStepSize StartOfLine StartOfString StartProcess StartScheduledTask StartupSound StartWebSession StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StateTransformationLinearize StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StereochemistryElements StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StoppingPowerData StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamMarkers StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringContainsQ StringCount StringDelete StringDrop StringEndsQ StringExpression StringExtract StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPadLeft StringPadRight StringPart StringPartition StringPosition StringQ StringRepeat StringReplace StringReplaceList StringReplacePart StringReverse StringRiffle StringRotateLeft StringRotateRight StringSkeleton StringSplit StringStartsQ StringTake StringTemplate StringToByteArray StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleData StyleDefinitions StyleForm StyleHints StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subdivide Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subsequences Subset SubsetEqual SubsetMap SubsetQ Subsets SubStar SubstitutionSystem Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubtractSides SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde Success SuchThat Sum SumConvergence SummationLayer Sunday SunPosition Sunrise Sunset SuperDagger SuperMinus SupernovaData SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceArea SurfaceColor SurfaceData SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricKey SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Synonyms Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SynthesizeMissingValues SystemDialogInput SystemException SystemGet SystemHelpPath SystemInformation SystemInformationData SystemInstall SystemModel SystemModeler SystemModelExamples SystemModelLinearize SystemModelParametricSimulate SystemModelPlot SystemModelProgressReporting SystemModelReliability SystemModels SystemModelSimulate SystemModelSimulateSensitivity SystemModelSimulationData SystemOpen SystemOptions SystemProcessData SystemProcesses SystemsConnectionsModel SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelLinearity SystemsModelMerge SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemsModelVectorRelativeOrders SystemStub SystemTest ' + + 'Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TableViewBoxBackground TableViewBoxOptions TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeDrop TakeLargest TakeLargestBy TakeList TakeSmallest TakeSmallestBy TakeWhile Tally Tan Tanh TargetDevice TargetFunctions TargetSystem TargetUnits TaskAbort TaskExecute TaskObject TaskRemove TaskResume Tasks TaskSuspend TaskWait TautologyQ TelegraphProcess TemplateApply TemplateArgBox TemplateBox TemplateBoxOptions TemplateEvaluate TemplateExpression TemplateIf TemplateObject TemplateSequence TemplateSlot TemplateSlotSequence TemplateUnevaluated TemplateVerbatim TemplateWith TemporalData TemporalRegularity Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge TestID TestReport TestReportObject TestResultObject Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCases TextCell TextClipboardType TextContents TextData TextElement TextForm TextGrid TextJustification TextLine TextPacket TextParagraph TextPosition TextRecognize TextSearch TextSearchReport TextSentences TextString TextStructure TextStyle TextTranslation Texture TextureCoordinateFunction TextureCoordinateScaling TextWords Therefore ThermodynamicData ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreadingLayer ThreeJSymbol Threshold Through Throw ThueMorse Thumbnail Thursday Ticks TicksStyle TideData Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint TimeDirection TimeFormat TimeGoal TimelinePlot TimeObject TimeObjectQ Times TimesBy TimeSeries TimeSeriesAggregate TimeSeriesForecast TimeSeriesInsert TimeSeriesInvertibility TimeSeriesMap TimeSeriesMapThread TimeSeriesModel TimeSeriesModelFit TimeSeriesResample TimeSeriesRescale TimeSeriesShift TimeSeriesThread TimeSeriesWindow TimeUsed TimeValue TimeWarpingCorrespondence TimeWarpingDistance TimeZone TimeZoneConvert TimeZoneOffset Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate Today ToDiscreteTimeModel ToEntity ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase Tomorrow ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform ToPolarCoordinates TopologicalSort ToRadicals ToRules ToSphericalCoordinates ToString Total TotalHeight TotalLayer TotalVariationFilter TotalWidth TouchPosition TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TrackingFunction TracyWidomDistribution TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TrainingProgressCheckpointing TrainingProgressFunction TrainingProgressMeasurements TrainingProgressReporting TrainingStoppingCriterion TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationClass TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField TransformedProcess TransformedRegion TransitionDirection TransitionDuration TransitionEffect TransitiveClosureGraph TransitiveReductionGraph Translate TranslationOptions TranslationTransform Transliterate Transparent TransparentColor Transpose TransposeLayer TrapSelection TravelDirections TravelDirectionsData TravelDistance TravelDistanceList TravelMethod TravelTime TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle Triangle TriangleCenter TriangleConstruct TriangleMeasurement TriangleWave TriangularDistribution TriangulateMesh Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean TrimmedVariance TropicalStormData True TrueQ TruncatedDistribution TruncatedPolyhedron TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBoxOptions TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow TunnelData Tuples TuranGraph TuringMachine TuttePolynomial TwoWayRule Typed TypeSpecifier ' + + 'UnateQ Uncompress UnconstrainedParameters Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UnderseaFeatureData UndirectedEdge UndirectedGraph UndirectedGraphQ UndoOptions UndoTrackedVariables Unequal UnequalTo Unevaluated UniformDistribution UniformGraphDistribution UniformPolyhedron UniformSumDistribution Uninstall Union UnionPlus Unique UnitaryMatrixQ UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitSystem UnitTriangle UnitVector UnitVectorLayer UnityDimensions UniverseModelData UniversityData UnixTime Unprotect UnregisterExternalEvaluator UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpdateSearchIndex UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize UpperTriangularMatrixQ Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpTo UpValues URL URLBuild URLDecode URLDispatcher URLDownload URLDownloadSubmit URLEncode URLExecute URLExpand URLFetch URLFetchAsynchronous URLParse URLQueryDecode URLQueryEncode URLRead URLResponseTime URLSave URLSaveAsynchronous URLShorten URLSubmit UseGraphicsRange UserDefinedWavelet Using UsingFrontEnd UtilityFunction ' + + 'V2Get ValenceErrorHandling ValidationLength ValidationSet Value ValueBox ValueBoxOptions ValueDimensions ValueForm ValuePreprocessingFunction ValueQ Values ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorAround VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorGreater VectorGreaterEqual VectorLess VectorLessEqual VectorMarkers VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerificationTest VerifyConvergence VerifyDerivedKey VerifyDigitalSignature VerifyInterpretation VerifySecurityCertificates VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexContract VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight VertexWeightedGraphQ Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewProjection ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoiceStyleData VoigtDistribution VolcanoData Volume VonMisesDistribution VoronoiMesh ' + + 'WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WarpingCorrespondence WarpingDistance WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeatherForecastData WebAudioSearch WebElementObject WeberE WebExecute WebImage WebImageSearch WebSearch WebSessionObject WebSessions WebWindowObject Wedge Wednesday WeibullDistribution WeierstrassE1 WeierstrassE2 WeierstrassE3 WeierstrassEta1 WeierstrassEta2 WeierstrassEta3 WeierstrassHalfPeriods WeierstrassHalfPeriodW1 WeierstrassHalfPeriodW2 WeierstrassHalfPeriodW3 WeierstrassInvariantG2 WeierstrassInvariantG3 WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White WhiteNoiseProcess WhitePoint Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WikipediaData WikipediaSearch WilksW WilksWTest WindDirectionData WindingCount WindingPolygon WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowPersistentStyles WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth WindSpeedData WindVectorData WinsorizedMean WinsorizedVariance WishartMatrixDistribution With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult WolframLanguageData Word WordBoundary WordCharacter WordCloud WordCount WordCounts WordData WordDefinition WordFrequency WordFrequencyData WordList WordOrientation WordSearch WordSelectionFunction WordSeparators WordSpacings WordStem WordTranslation WorkingPrecision WrapAround Write WriteLine WriteString Wronskian ' + + 'XMLElement XMLObject XMLTemplate Xnor Xor XYZColor ' + + 'Yellow Yesterday YuleDissimilarity ' + + 'ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZIPCodeData ZipfDistribution ZoomCenter ZoomFactor ZTest ZTransform ' + '$Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AllowExternalChannelFunctions $AssertFunction $Assumptions $AsynchronousTask $AudioInputDevices $AudioOutputDevices $BaseDirectory $BatchInput $BatchOutput $BlockchainBase $BoxForms $ByteOrdering $CacheBaseDirectory $Canceled $ChannelBase $CharacterEncoding $CharacterEncodings $CloudBase $CloudConnected $CloudCreditsAvailable $CloudEvaluation $CloudExpressionBase $CloudObjectNameFormat $CloudObjectURLType $CloudRootDirectory $CloudSymbolBase $CloudUserID $CloudUserUUID $CloudVersion $CloudVersionNumber $CloudWolframEngineVersionNumber $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $Cookies $CookieStore $CreationDate $CurrentLink $CurrentTask $CurrentWebSession $DateStringFormat $DefaultAudioInputDevice $DefaultAudioOutputDevice $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultLocalBase $DefaultMailbox $DefaultNetworkInterface $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $EmbedCodeEnvironments $EmbeddableServices $EntityStores $Epilog $EvaluationCloudBase $EvaluationCloudObject $EvaluationEnvironment $ExportFormats $Failed $FinancialDataSource $FontFamilies $FormatType $FrontEnd $FrontEndSession $GeoEntityTypes $GeoLocation $GeoLocationCity $GeoLocationCountry $GeoLocationPrecision $GeoLocationSource $HistoryLength $HomeDirectory $HTMLExportRules $HTTPCookies $HTTPRequest $IgnoreEOF $ImageFormattingWidth $ImagingDevice $ImagingDevices $ImportFormats $IncomingMailSettings $InitialDirectory $Initialization $InitializationContexts $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $InterpreterTypes $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $LocalBase $LocalSymbolBase $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $MobilePhone $ModuleNumber $NetworkConnected $NetworkInterfaces $NetworkLicense $NewMessage $NewSymbol $Notebooks $NoValue $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $Permissions $PermissionsGroupBase $PersistenceBase $PersistencePath $PipeSupported $PlotTheme $Post $Pre $PreferencesDirectory $PreInitialization $PrePrint $PreRead $PrintForms $PrintLiteral $Printout3DPreviewer $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $PublisherID $RandomState $RecursionLimit $RegisteredDeviceClasses $RegisteredUserName $ReleaseNumber $RequesterAddress $RequesterWolframID $RequesterWolframUUID $ResourceSystemBase $RootDirectory $ScheduledTask $ScriptCommandLine $ScriptInputString $SecuredAuthenticationKeyTokens $ServiceCreditsAvailable $Services $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SourceLink $SSHAuthentication $SummaryBoxDataSizeLimit $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemMemory $SystemShell $SystemTimeZone $SystemWordLength $TemplatePath $TemporaryDirectory $TemporaryPrefix $TestFileName $TextStyle $TimedOut $TimeUnit $TimeZone $TimeZoneEntity $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $UnitSystem $Urgent $UserAddOnsDirectory $UserAgentLanguages $UserAgentMachine $UserAgentName $UserAgentOperatingSystem $UserAgentString $UserAgentVersion $UserBaseDirectory $UserDocumentsDirectory $Username $UserName $UserURLBase $Version $VersionNumber $VoiceStyles $WolframID $WolframUUID', contains: [ hljs.COMMENT('\\(\\*', '\\*\\)', {contains: ['self']}), diff --git a/src/languages/perl.js b/src/languages/perl.js index 1d2af34d7c..9647b41ddc 100644 --- a/src/languages/perl.js +++ b/src/languages/perl.js @@ -8,9 +8,9 @@ Category: common export default function(hljs) { var PERL_KEYWORDS = 'getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ' + 'ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime ' + - 'readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq' + + 'readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq ' + 'fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent ' + - 'shutdown dump chomp connect getsockname die socketpair close flock exists index shmget' + + 'shutdown dump chomp connect getsockname die socketpair close flock exists index shmget ' + 'sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr ' + 'unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 ' + 'getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline ' + @@ -22,7 +22,7 @@ export default function(hljs) { 'lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and ' + 'sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 ' + 'chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach ' + - 'tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir' + + 'tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir ' + 'ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe ' + 'atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when'; var SUBST = { diff --git a/src/languages/pf.js b/src/languages/pf.js index ccf522989e..369cec34e3 100644 --- a/src/languages/pf.js +++ b/src/languages/pf.js @@ -30,21 +30,21 @@ export default function(hljs) { */ 'block match pass load anchor|5 antispoof|10 set table', keyword: - 'in out log quick on rdomain inet inet6 proto from port os to route' + - 'allow-opts divert-packet divert-reply divert-to flags group icmp-type' + - 'icmp6-type label once probability recieved-on rtable prio queue' + - 'tos tag tagged user keep fragment for os drop' + - 'af-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robin' + - 'source-hash static-port' + - 'dup-to reply-to route-to' + - 'parent bandwidth default min max qlimit' + - 'block-policy debug fingerprints hostid limit loginterface optimization' + - 'reassemble ruleset-optimization basic none profile skip state-defaults' + - 'state-policy timeout' + - 'const counters persist' + - 'no modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppy' + - 'source-track global rule max-src-nodes max-src-states max-src-conn' + - 'max-src-conn-rate overload flush' + + 'in out log quick on rdomain inet inet6 proto from port os to route ' + + 'allow-opts divert-packet divert-reply divert-to flags group icmp-type ' + + 'icmp6-type label once probability recieved-on rtable prio queue ' + + 'tos tag tagged user keep fragment for os drop ' + + 'af-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robin ' + + 'source-hash static-port ' + + 'dup-to reply-to route-to ' + + 'parent bandwidth default min max qlimit ' + + 'block-policy debug fingerprints hostid limit loginterface optimization ' + + 'reassemble ruleset-optimization basic none profile skip state-defaults ' + + 'state-policy timeout ' + + 'const counters persist ' + + 'no modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppy ' + + 'source-track global rule max-src-nodes max-src-states max-src-conn ' + + 'max-src-conn-rate overload flush ' + 'scrub|5 max-mss min-ttl no-df|10 random-id', literal: 'all any no-route self urpf-failed egress|5 unknown' diff --git a/src/languages/pgsql.js b/src/languages/pgsql.js index 1ba55f2470..55d855a521 100644 --- a/src/languages/pgsql.js +++ b/src/languages/pgsql.js @@ -210,7 +210,7 @@ export default function(hljs) { 'ACOS ACOSD ASIN ASIND ATAN ATAND ATAN2 ATAN2D COS COSD COT COTD SIN SIND TAN TAND ' + // https://www.postgresql.org/docs/11/static/functions-string.html 'BIT_LENGTH CHAR_LENGTH CHARACTER_LENGTH LOWER OCTET_LENGTH OVERLAY POSITION SUBSTRING TREAT TRIM UPPER ' + - 'ASCII BTRIM CHR CONCAT CONCAT_WS CONVERT CONVERT_FROM CONVERT_TO DECODE ENCODE INITCAP' + + 'ASCII BTRIM CHR CONCAT CONCAT_WS CONVERT CONVERT_FROM CONVERT_TO DECODE ENCODE INITCAP ' + 'LEFT LENGTH LPAD LTRIM MD5 PARSE_IDENT PG_CLIENT_ENCODING QUOTE_IDENT|10 QUOTE_LITERAL|10 ' + 'QUOTE_NULLABLE|10 REGEXP_MATCH REGEXP_MATCHES REGEXP_REPLACE REGEXP_SPLIT_TO_ARRAY ' + 'REGEXP_SPLIT_TO_TABLE REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SPLIT_PART STRPOS SUBSTR ' + @@ -229,7 +229,7 @@ export default function(hljs) { 'AREA CENTER DIAMETER HEIGHT ISCLOSED ISOPEN NPOINTS PCLOSE POPEN RADIUS WIDTH ' + 'BOX BOUND_BOX CIRCLE LINE LSEG PATH POLYGON ' + // https://www.postgresql.org/docs/11/static/functions-net.html - 'ABBREV BROADCAST HOST HOSTMASK MASKLEN NETMASK NETWORK SET_MASKLEN TEXT INET_SAME_FAMILY' + + 'ABBREV BROADCAST HOST HOSTMASK MASKLEN NETMASK NETWORK SET_MASKLEN TEXT INET_SAME_FAMILY ' + 'INET_MERGE MACADDR8_SET7BIT ' + // https://www.postgresql.org/docs/11/static/functions-textsearch.html 'ARRAY_TO_TSVECTOR GET_CURRENT_TS_CONFIG NUMNODE PLAINTO_TSQUERY PHRASETO_TSQUERY WEBSEARCH_TO_TSQUERY ' + diff --git a/src/languages/qml.js b/src/languages/qml.js index e52dd42fb7..6cb83acb11 100644 --- a/src/languages/qml.js +++ b/src/languages/qml.js @@ -26,7 +26,7 @@ export default function(hljs) { 'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' + 'Behavior bool color coordinate date double enumeration font geocircle georectangle ' + 'geoshape int list matrix4x4 parent point quaternion real rect ' + - 'size string url variant vector2d vector3d vector4d' + + 'size string url variant vector2d vector3d vector4d ' + 'Promise' }; diff --git a/src/languages/reasonml.js b/src/languages/reasonml.js index eabbf25b27..37d423701b 100644 --- a/src/languages/reasonml.js +++ b/src/languages/reasonml.js @@ -30,9 +30,9 @@ export default function(hljs) { var KEYWORDS = { keyword: - 'and as asr assert begin class constraint do done downto else end exception external' + - 'for fun function functor if in include inherit initializer' + - 'land lazy let lor lsl lsr lxor match method mod module mutable new nonrec' + + 'and as asr assert begin class constraint do done downto else end exception external ' + + 'for fun function functor if in include inherit initializer ' + + 'land lazy let lor lsl lsr lxor match method mod module mutable new nonrec ' + 'object of open or private rec sig struct then to try type val virtual when while with', built_in: 'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ', From 7f314a67f240caa28053b1c51cd37801ebf208d0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 28 Feb 2020 15:53:24 -0500 Subject: [PATCH 021/816] (bug) fix actual intention of Stan rule It's obvious `\s+` is what was intended, not that the first character should be optional. --- src/languages/stan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/stan.js b/src/languages/stan.js index e26e9876a0..c9ad712269 100644 --- a/src/languages/stan.js +++ b/src/languages/stan.js @@ -193,7 +193,7 @@ export default function(hljs) { { // hack: in range constraints, upper must follow either , or < // or - begin: /[<,]*upper\s*=/, + begin: /[<,]\s*upper\s*=/, keywords: 'upper' }, { From 381a5c6d374326d000b89db214237b081d51b01f Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 29 Feb 2020 08:03:37 -0500 Subject: [PATCH 022/816] bug(clojure) Now highlights `defn-` properly (#2438) --- CHANGES.md | 1 + src/languages/clojure.js | 1 + src/lib/mode_compiler.js | 7 ++++++- test/markup/clojure/globals_definition.expect.txt | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 67631e65a2..0f57683f60 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ Core Changes: Language Improvements: +- bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][] - enh(clojure) Add support for global definitions name (#2347) [Alexandre Grison][] - enh(fortran) Support Fortran 77 style comments (#2416) [Josh Goebel][] - (csharp) add support for `@identifier` style identifiers (#2414) [Josh Goebel][] diff --git a/src/languages/clojure.js b/src/languages/clojure.js index 00501124f2..5be1dfc517 100644 --- a/src/languages/clojure.js +++ b/src/languages/clojure.js @@ -94,6 +94,7 @@ export default function(hljs) { var GLOBAL = { beginKeywords: globals, + lexemes: SYMBOL_RE, end: '(\\[|\\#|\\d|"|:|\\{|\\)|\\(|$)', contains: [ { diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index b425b02952..d468022a28 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -83,7 +83,12 @@ export function compileLanguage(language) { if (parent) { if (mode.beginKeywords) { - mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')\\b'; + // for languages with keywords that include non-word characters checking for + // a word boundary is not sufficient, so instead we check for a word boundary + // or whitespace - this does no harm in any case since our keyword engine + // doesn't allow spaces in keywords anyways and we still check for the boundary + // first + mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?=\\b|\\s)'; } if (!mode.begin) mode.begin = /\B|\b/; diff --git a/test/markup/clojure/globals_definition.expect.txt b/test/markup/clojure/globals_definition.expect.txt index dcc6cd11fe..5e54172d67 100644 --- a/test/markup/clojure/globals_definition.expect.txt +++ b/test/markup/clojure/globals_definition.expect.txt @@ -22,7 +22,7 @@ (defonce ^:private another-var #"foo") ; private function -(defn- add [x y] (+ x y)) +(defn- add [x y] (+ x y)) ; protocols (defprotocol Fly From d93c13edd98d2476a4e96abc6a465524df0420bf Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 29 Feb 2020 09:33:59 -0500 Subject: [PATCH 023/816] fix(javascript) prevent get/set variables conflicting with keywords (#2440) --- CHANGES.md | 1 + src/languages/javascript.js | 28 +++++++++++++------ .../keyword_as_identifier.expect.txt | 9 ++++++ .../javascript/keyword_as_identifier.txt | 9 ++++++ 4 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 test/markup/javascript/keyword_as_identifier.expect.txt create mode 100644 test/markup/javascript/keyword_as_identifier.txt diff --git a/CHANGES.md b/CHANGES.md index 0f57683f60..9061a346cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ Core Changes: Language Improvements: +- fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][] - bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][] - enh(clojure) Add support for global definitions name (#2347) [Alexandre Grison][] - enh(fortran) Support Fortran 77 style comments (#2416) [Josh Goebel][] diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 7ff30465b6..9636f508da 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -93,6 +93,13 @@ export default function(hljs) { hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE ]); + var PARAMS = { + className: 'params', + begin: /\(/, end: /\)/, + excludeBegin: true, + excludeEnd: true, + contains: PARAMS_CONTAINS + }; return { name: 'JavaScript', @@ -220,13 +227,7 @@ export default function(hljs) { beginKeywords: 'function', end: /\{/, excludeEnd: true, contains: [ hljs.inherit(hljs.TITLE_MODE, {begin: IDENT_RE}), - { - className: 'params', - begin: /\(/, end: /\)/, - excludeBegin: true, - excludeEnd: true, - contains: PARAMS_CONTAINS - } + PARAMS ], illegal: /\[|%/ }, @@ -245,7 +246,18 @@ export default function(hljs) { ] }, { - beginKeywords: 'constructor get set', end: /\{/, excludeEnd: true + beginKeywords: 'constructor', end: /\{/, excludeEnd: true + }, + { + begin:'(get|set)\\s*(?=' + IDENT_RE+ '\\()', + end: /{/, + keywords: "get set", + contains: [ + hljs.inherit(hljs.TITLE_MODE, {begin: IDENT_RE}), + { begin: /\(\)/ }, // eat to avoid empty params + PARAMS + ] + } ], illegal: /#(?!!)/ diff --git a/test/markup/javascript/keyword_as_identifier.expect.txt b/test/markup/javascript/keyword_as_identifier.expect.txt new file mode 100644 index 0000000000..dab606e707 --- /dev/null +++ b/test/markup/javascript/keyword_as_identifier.expect.txt @@ -0,0 +1,9 @@ +const set = new Set([1, 2]); +for (const e of set) + +class A { + set value(x) { + } + get valid() { + } +} diff --git a/test/markup/javascript/keyword_as_identifier.txt b/test/markup/javascript/keyword_as_identifier.txt new file mode 100644 index 0000000000..e3fcfcb236 --- /dev/null +++ b/test/markup/javascript/keyword_as_identifier.txt @@ -0,0 +1,9 @@ +const set = new Set([1, 2]); +for (const e of set) + +class A { + set value(x) { + } + get valid() { + } +} From 3fd4cf171252d82d15fb18f9be37e7d0de54088a Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 28 Feb 2020 18:21:00 -0500 Subject: [PATCH 024/816] enh(bash) add arithmetic support --- CHANGES.md | 1 + src/languages/bash.js | 10 ++++++++++ test/markup/bash/arithmetic.expect.txt | 8 ++++++++ test/markup/bash/arithmetic.txt | 8 ++++++++ 4 files changed, 27 insertions(+) create mode 100644 test/markup/bash/arithmetic.expect.txt create mode 100644 test/markup/bash/arithmetic.txt diff --git a/CHANGES.md b/CHANGES.md index 9061a346cb..86ca1dcf7b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ Language Improvements: - fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][] - bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][] +- enh(bash) Add arithmetic expression support (#2439) [Josh Goebel][] - enh(clojure) Add support for global definitions name (#2347) [Alexandre Grison][] - enh(fortran) Support Fortran 77 style comments (#2416) [Josh Goebel][] - (csharp) add support for `@identifier` style identifiers (#2414) [Josh Goebel][] diff --git a/src/languages/bash.js b/src/languages/bash.js index 3d37ded159..04856e01bd 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -36,6 +36,15 @@ export default function(hljs) { className: 'string', begin: /'/, end: /'/ }; + const ARITHEMETIC = { + begin: /\$\(\(/, + end: /\)\)/, + contains: [ + { begin: /\d+#[0-9a-f]+/, className: "number" }, + hljs.NUMBER_MODE, + VAR + ] + }; return { name: 'Bash', @@ -79,6 +88,7 @@ export default function(hljs) { contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\w[\w\d_]*/})], relevance: 0 }, + ARITHEMETIC, hljs.HASH_COMMENT_MODE, QUOTE_STRING, ESCAPED_QUOTE, diff --git a/test/markup/bash/arithmetic.expect.txt b/test/markup/bash/arithmetic.expect.txt new file mode 100644 index 0000000000..28ebd37413 --- /dev/null +++ b/test/markup/bash/arithmetic.expect.txt @@ -0,0 +1,8 @@ +echo $(( 16#deadbeef / 1003 )) + +yumi=deadbeef +echo $(( 16#$yumi / 1003 )) + +B=20 +yumi=deadbeef +echo $(( $B#$yumi / 1003 )) diff --git a/test/markup/bash/arithmetic.txt b/test/markup/bash/arithmetic.txt new file mode 100644 index 0000000000..d44dea465e --- /dev/null +++ b/test/markup/bash/arithmetic.txt @@ -0,0 +1,8 @@ +echo $(( 16#deadbeef / 1003 )) + +yumi=deadbeef +echo $(( 16#$yumi / 1003 )) + +B=20 +yumi=deadbeef +echo $(( $B#$yumi / 1003 )) From 8d5efdb0d5726a9e2af2c5faa308d8b71264fe43 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 28 Feb 2020 18:47:35 -0500 Subject: [PATCH 025/816] enh(bash) string nested within string --- CHANGES.md | 1 + src/languages/bash.js | 12 +++++++----- test/markup/bash/strings.expect.txt | 3 +++ test/markup/bash/strings.txt | 3 +++ 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 test/markup/bash/strings.expect.txt create mode 100644 test/markup/bash/strings.txt diff --git a/CHANGES.md b/CHANGES.md index 86ca1dcf7b..12aba8e042 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ Language Improvements: - fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][] - bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][] +- enh(bash) string nested within string (#2439) [Josh Goebel][] - enh(bash) Add arithmetic expression support (#2439) [Josh Goebel][] - enh(clojure) Add support for global definitions name (#2347) [Alexandre Grison][] - enh(fortran) Support Fortran 77 style comments (#2416) [Josh Goebel][] diff --git a/src/languages/bash.js b/src/languages/bash.js index 04856e01bd..e115e81b4e 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -14,19 +14,21 @@ export default function(hljs) { {begin: /\$\{(.*?)}/} ] }; + var SUBST = { + className: 'subst', + begin: /\$\(/, end: /\)/, + contains: [hljs.BACKSLASH_ESCAPE] + }; var QUOTE_STRING = { className: 'string', begin: /"/, end: /"/, contains: [ hljs.BACKSLASH_ESCAPE, VAR, - { - className: 'variable', - begin: /\$\(/, end: /\)/, - contains: [hljs.BACKSLASH_ESCAPE] - } + SUBST ] }; + SUBST.contains.push(QUOTE_STRING); var ESCAPED_QUOTE = { className: '', begin: /\\"/ diff --git a/test/markup/bash/strings.expect.txt b/test/markup/bash/strings.expect.txt new file mode 100644 index 0000000000..39abcc1b1d --- /dev/null +++ b/test/markup/bash/strings.expect.txt @@ -0,0 +1,3 @@ +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +TLS_DIR="$SCRIPT_DIR/../src/main/resources/tls" +ROOT_DIR="$SCRIPT_DIR/.." diff --git a/test/markup/bash/strings.txt b/test/markup/bash/strings.txt new file mode 100644 index 0000000000..c2d7f55732 --- /dev/null +++ b/test/markup/bash/strings.txt @@ -0,0 +1,3 @@ +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +TLS_DIR="$SCRIPT_DIR/../src/main/resources/tls" +ROOT_DIR="$SCRIPT_DIR/.." From e39b28de7e4fa7570a0d87fb619e16ef887f7b24 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 28 Feb 2020 18:49:53 -0500 Subject: [PATCH 026/816] (chore) cleanup bash a bit --- src/languages/bash.js | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/languages/bash.js b/src/languages/bash.js index e115e81b4e..093947df27 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -7,19 +7,19 @@ Category: common */ export default function(hljs) { - var VAR = { + const VAR = { className: 'variable', variants: [ {begin: /\$[\w\d#@][\w\d_]*/}, {begin: /\$\{(.*?)}/} ] }; - var SUBST = { + const SUBST = { className: 'subst', begin: /\$\(/, end: /\)/, contains: [hljs.BACKSLASH_ESCAPE] }; - var QUOTE_STRING = { + const QUOTE_STRING = { className: 'string', begin: /"/, end: /"/, contains: [ @@ -29,16 +29,16 @@ export default function(hljs) { ] }; SUBST.contains.push(QUOTE_STRING); - var ESCAPED_QUOTE = { + const ESCAPED_QUOTE = { className: '', begin: /\\"/ }; - var APOS_STRING = { + const APOS_STRING = { className: 'string', begin: /'/, end: /'/ }; - const ARITHEMETIC = { + const ARITHMETIC = { begin: /\$\(\(/, end: /\)\)/, contains: [ @@ -47,6 +47,18 @@ export default function(hljs) { VAR ] }; + const SHEBANG = { + className: 'meta', + begin: /^#![^\n]+sh\s*$/, + relevance: 10 + }; + const FUNCTION = { + className: 'function', + begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/, + returnBegin: true, + contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\w[\w\d_]*/})], + relevance: 0 + }; return { name: 'Bash', @@ -78,19 +90,9 @@ export default function(hljs) { '-ne -eq -lt -gt -f -d -e -s -l -a' // relevance booster }, contains: [ - { - className: 'meta', - begin: /^#![^\n]+sh\s*$/, - relevance: 10 - }, - { - className: 'function', - begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/, - returnBegin: true, - contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\w[\w\d_]*/})], - relevance: 0 - }, - ARITHEMETIC, + SHEBANG, + FUNCTION, + ARITHMETIC, hljs.HASH_COMMENT_MODE, QUOTE_STRING, ESCAPED_QUOTE, From 08c21ad407f0760072692f3ed3496dcbfa796096 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 28 Feb 2020 19:16:53 -0500 Subject: [PATCH 027/816] enh(bash) default value is another variable --- CHANGES.md | 1 + src/languages/bash.js | 14 +++++++++++--- test/markup/bash/variables.expect.txt | 3 +++ test/markup/bash/variables.txt | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 test/markup/bash/variables.expect.txt create mode 100644 test/markup/bash/variables.txt diff --git a/CHANGES.md b/CHANGES.md index 12aba8e042..b9ef99e36d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ Language Improvements: - fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][] - bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][] +- enh(bash) default value is another variable (#2439) [Josh Goebel][] - enh(bash) string nested within string (#2439) [Josh Goebel][] - enh(bash) Add arithmetic expression support (#2439) [Josh Goebel][] - enh(clojure) Add support for global definitions name (#2347) [Alexandre Grison][] diff --git a/src/languages/bash.js b/src/languages/bash.js index 093947df27..be9c8c92fc 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -7,13 +7,21 @@ Category: common */ export default function(hljs) { - const VAR = { + const VAR = {}; + const BRACED_VAR = { + begin: /\$\{/, end:/\}/, + contains: [ + { begin: /:-/, contains: [VAR] } // default values + ] + }; + Object.assign(VAR,{ className: 'variable', variants: [ {begin: /\$[\w\d#@][\w\d_]*/}, - {begin: /\$\{(.*?)}/} + BRACED_VAR ] - }; + }); + const SUBST = { className: 'subst', begin: /\$\(/, end: /\)/, diff --git a/test/markup/bash/variables.expect.txt b/test/markup/bash/variables.expect.txt new file mode 100644 index 0000000000..708b15f2f2 --- /dev/null +++ b/test/markup/bash/variables.expect.txt @@ -0,0 +1,3 @@ +$A +${B} +${WURST:-${CARNE}} diff --git a/test/markup/bash/variables.txt b/test/markup/bash/variables.txt new file mode 100644 index 0000000000..eb89ed0cda --- /dev/null +++ b/test/markup/bash/variables.txt @@ -0,0 +1,3 @@ +$A +${B} +${WURST:-${CARNE}} From 7260f8f7ad067c17ec2dff9d4cf9e65e15b1b1b6 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 23 Oct 2019 21:32:47 -0400 Subject: [PATCH 028/816] (enh) Add TokenTree and HTMLRenderer --- CHANGES.md | 1 + src/highlight.js | 111 ++++++++++++++++++++++++--------------- src/lib/html_renderer.js | 46 ++++++++++++++++ src/lib/token_tree.js | 88 +++++++++++++++++++++++++++++++ 4 files changed, 203 insertions(+), 43 deletions(-) create mode 100644 src/lib/html_renderer.js create mode 100644 src/lib/token_tree.js diff --git a/CHANGES.md b/CHANGES.md index b9ef99e36d..2dbc7b86fe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ New themes: Core Changes: +- split out parse tree generation and HTML rendering concerns (#2404) [Josh Goebel][] - every language can have a `name` attribute now (#2400) [Josh Goebel][] - improve regular expression detect (less false-positives) (#2380) [Josh Goebel][] - make `noHighlightRe` and `languagePrefixRe` configurable (#2374) [Josh Goebel][] diff --git a/src/highlight.js b/src/highlight.js index 9d46bc2687..f735eb98ba 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -4,6 +4,8 @@ https://highlightjs.org/ */ import deepFreeze from './vendor/deep_freeze'; +import TokenTree from './lib/token_tree'; +import HTMLRenderer from './lib/html_renderer'; import * as regex from './lib/regex'; import * as utils from './lib/utils'; import * as MODES from './lib/modes'; @@ -11,10 +13,12 @@ import { compileLanguage } from './lib/mode_compiler'; const escape = utils.escapeHTML; const inherit = utils.inherit; + const { nodeStream, mergeStreams } = utils; const HLJS = function(hljs) { + // Convenience variables for build-in objects var ArrayProto = []; @@ -107,49 +111,48 @@ const HLJS = function(hljs) { return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str]; } - function buildSpan(className, insideSpan, leaveOpen, noPrefix) { - if (!leaveOpen && insideSpan === '') return ''; - if (!className) return insideSpan; - - var classPrefix = noPrefix ? '' : options.classPrefix, - openSpan = ''; - - return openSpan + insideSpan + closeSpan; - } - function processKeywords() { - var keyword_match, last_index, match, result; + var keyword_match, last_index, match, result, buf; - if (!top.keywords) - return escape(mode_buffer); + if (!top.keywords) { + emitter.addText(mode_buffer); + return; + } - result = ''; last_index = 0; top.lexemesRe.lastIndex = 0; match = top.lexemesRe.exec(mode_buffer); + buf = ""; while (match) { - result += escape(mode_buffer.substring(last_index, match.index)); + buf += mode_buffer.substring(last_index, match.index); keyword_match = keywordMatch(top, match); + var kind = null; if (keyword_match) { + emitter.addText(buf); + buf = ""; + relevance += keyword_match[1]; - result += buildSpan(keyword_match[0], escape(match[0])); + kind = keyword_match[0]; + emitter.addKeyword(match[0], kind); } else { - result += escape(match[0]); + buf += match[0]; } last_index = top.lexemesRe.lastIndex; match = top.lexemesRe.exec(mode_buffer); } - return result + escape(mode_buffer.substr(last_index)); + buf += mode_buffer.substr(last_index); + emitter.addText(buf); } function processSubLanguage() { + if (mode_buffer === "") return; + var explicit = typeof top.subLanguage === 'string'; + if (explicit && !languages[top.subLanguage]) { - return escape(mode_buffer); + emitter.addText(mode_buffer); + return; } var result = explicit ? @@ -166,16 +169,18 @@ const HLJS = function(hljs) { if (explicit) { continuations[top.subLanguage] = result.top; } - return buildSpan(result.language, result.value, false, true); + emitter.addSublanguage(result.emitter, result.language) } function processBuffer() { - result += (top.subLanguage != null ? processSubLanguage() : processKeywords()); + (top.subLanguage != null ? processSubLanguage() : processKeywords()); mode_buffer = ''; } function startNewMode(mode) { - result += mode.className? buildSpan(mode.className, '', true): ''; + if (mode.className) { + emitter.openNode(mode.className) + } top = Object.create(mode, {parent: {value: top}}); } @@ -223,7 +228,7 @@ const HLJS = function(hljs) { } do { if (top.className) { - result += spanEndTag; + emitter.closeNode(); } if (!top.skip && !top.subLanguage) { relevance += top.relevance; @@ -239,6 +244,16 @@ const HLJS = function(hljs) { return origin.returnEnd ? 0 : lexeme.length; } + function processContinuations() { + var list = [] + for(var current = top; current !== language; current = current.parent) { + if (current.className) { + list.unshift(current.className) + } + } + list.forEach(item => emitter.openNode(item)) + } + var lastMatch = {}; function processLexeme(text_before_match, match) { @@ -273,7 +288,9 @@ const HLJS = function(hljs) { return doBeginMatch(match); } else if (match.type==="illegal" && !ignore_illegals) { // illegal match, we do not continue processing - throw new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); + var err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); + err.mode = top; + throw err; } else if (match.type==="end") { var processed = doEndMatch(match); if (processed != undefined) @@ -305,48 +322,55 @@ const HLJS = function(hljs) { compileLanguage(language); var top = continuation || language; var continuations = {}; // keep continuations for sub-languages - var result = '', current; - for(current = top; current !== language; current = current.parent) { - if (current.className) { - result = buildSpan(current.className, '', true) + result; - } - } + var result; + var emitter = new TokenTree(); + processContinuations(); var mode_buffer = ''; var relevance = 0; + var match, processedCount, index = 0; + try { - var match, count, index = 0; while (true) { top.terminators.lastIndex = index; match = top.terminators.exec(codeToHighlight); if (!match) break; - count = processLexeme(codeToHighlight.substring(index, match.index), match); - index = match.index + count; + let beforeMatch = codeToHighlight.substring(index, match.index); + processedCount = processLexeme(beforeMatch, match); + index = match.index + processedCount; } processLexeme(codeToHighlight.substr(index)); - for(current = top; current.parent; current = current.parent) { // close dangling modes - if (current.className) { - result += spanEndTag; - } - } + emitter.closeAllNodes(); + emitter.finalize(); + result = new HTMLRenderer(emitter, options).value(); + return { relevance: relevance, value: result, - illegal:false, language: languageName, + illegal: false, + emitter: emitter, top: top }; } catch (err) { if (err.message && err.message.includes('Illegal')) { return { illegal: true, + illegalBy: { + msg: err.message, + context: codeToHighlight.slice(index-100,index+100), + mode: err.mode + }, + sofar: result, relevance: 0, - value: escape(codeToHighlight) + value: escape(codeToHighlight), + emitter: emitter, }; } else if (SAFE_MODE) { return { relevance: 0, value: escape(codeToHighlight), + emitter: emitter, language: languageName, top: top, errorRaised: err @@ -372,6 +396,7 @@ const HLJS = function(hljs) { languageSubset = languageSubset || options.languages || Object.keys(languages); var result = { relevance: 0, + emitter: new TokenTree(), value: escape(code) }; var second_best = result; diff --git a/src/lib/html_renderer.js b/src/lib/html_renderer.js new file mode 100644 index 0000000000..2ed5f04946 --- /dev/null +++ b/src/lib/html_renderer.js @@ -0,0 +1,46 @@ +const SPAN_CLOSE = ''; + +import {escapeHTML} from './utils'; + +const emitsWrappingTags = (node) => { + return !!node.kind; +} + +export default class HTMLRenderer { + constructor(tree, options) { + this.buffer = ""; + this.classPrefix = options.classPrefix; + tree.walk(this); + } + + // renderer API + + addText(text) { + this.buffer += escapeHTML(text) + } + + openNode(node) { + if (!emitsWrappingTags(node)) return; + + let className = node.kind; + if (!node.sublanguage) + className = `${this.classPrefix}${className}`; + this.span(className); + } + + closeNode(node) { + if (!emitsWrappingTags(node)) return; + + this.buffer += SPAN_CLOSE; + } + + // helpers + + span(className) { + this.buffer += `` + } + + value() { + return this.buffer; + } +} diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js new file mode 100644 index 0000000000..0d568c904b --- /dev/null +++ b/src/lib/token_tree.js @@ -0,0 +1,88 @@ +export default class TokenTree { + constructor() { + this.rootNode = { children: [] }; + this.stack = [ this.rootNode ]; + } + + get top() { + return this.stack[this.stack.length - 1]; + } + + add(node) { + this.top.children.push(node); + } + + addKeyword(text, kind) { + if (text === "") { return; } + + this.openNode(kind); + this.addText(text); + this.closeNode(); + } + + addText(text) { + if (text === "") { return; } + + this.add(text); + } + + addSublanguage({rootNode}, name) { + let node = rootNode; + node.kind = name; + node.sublanguage = true; + this.add(node); + } + + openNode(kind) { + var node = { kind, children: [] }; + this.add(node); + this.stack.push(node); + } + + closeNode() { + if (this.stack.length > 1) + return this.stack.pop(); + } + + closeAllNodes() { + while (this.closeNode()); + } + + toJSON() { + return JSON.stringify(this.rootNode, null, 4); + } + + finalize() { + return; + } + + walk(builder) { + return TokenTree._walk(builder, this.rootNode); + } + + static _walk(builder, node) { + if (typeof node === "string") { + builder.addText(node); + } else if (node.children) { + builder.openNode(node); + node.children.forEach((child) => this._walk(builder, child)) + builder.closeNode(node); + } + return builder; + } + + static _collapse(node) { + if (!node.children) { + return + } + if (node.children.every(el => typeof el === "string")) { + node.text = node.children.join("") + delete node["children"] + } else { + node.children.forEach((child) => { + if (typeof child === "string") return; + TokenTree._collapse(child) + }) + } + } +} From c8884ad0fe5246ab56cf1c32cd473e3ca2b6146c Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 16 Feb 2020 02:40:03 -0500 Subject: [PATCH 029/816] (chore) better naming of utility methods --- src/highlight.js | 7 +++---- src/lib/token_tree.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/highlight.js b/src/highlight.js index f735eb98ba..04daf8b5a3 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -34,7 +34,6 @@ const HLJS = function(hljs) { // Regular expressions used throughout the highlight.js library. var fixMarkupRe = /((^(<[^>]+>|\t|)+|(?:\n)))/gm; - var spanEndTag = ''; var LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?"; // Global options used when within external APIs. This is modified when @@ -50,7 +49,7 @@ const HLJS = function(hljs) { /* Utility functions */ - function isNotHighlighted(language) { + function shouldNotHighlight(language) { return options.noHighlightRe.test(language); } @@ -73,7 +72,7 @@ const HLJS = function(hljs) { return classes .split(/\s+/) - .find((_class) => isNotHighlighted(_class) || getLanguage(_class)) + .find((_class) => shouldNotHighlight(_class) || getLanguage(_class)) } /** @@ -462,7 +461,7 @@ const HLJS = function(hljs) { var node, originalStream, result, resultNode, text; var language = blockLanguage(block); - if (isNotHighlighted(language)) + if (shouldNotHighlight(language)) return; fire("before:highlightBlock", diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js index 0d568c904b..75babbbf3c 100644 --- a/src/lib/token_tree.js +++ b/src/lib/token_tree.js @@ -34,7 +34,7 @@ export default class TokenTree { } openNode(kind) { - var node = { kind, children: [] }; + let node = { kind, children: [] }; this.add(node); this.stack.push(node); } From bc2f74d0ec1fe29904103779b08ff3fa57796803 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 29 Feb 2020 16:10:41 -0500 Subject: [PATCH 030/816] (chore) split out emitter from TokenTree --- src/highlight.js | 6 ++-- src/lib/token_tree.js | 77 +++++++++++++++++++++++++++---------------- 2 files changed, 52 insertions(+), 31 deletions(-) diff --git a/src/highlight.js b/src/highlight.js index 04daf8b5a3..86910cc75b 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -4,7 +4,7 @@ https://highlightjs.org/ */ import deepFreeze from './vendor/deep_freeze'; -import TokenTree from './lib/token_tree'; +import TokenTreeEmitter from './lib/token_tree'; import HTMLRenderer from './lib/html_renderer'; import * as regex from './lib/regex'; import * as utils from './lib/utils'; @@ -322,7 +322,7 @@ const HLJS = function(hljs) { var top = continuation || language; var continuations = {}; // keep continuations for sub-languages var result; - var emitter = new TokenTree(); + var emitter = new TokenTreeEmitter(); processContinuations(); var mode_buffer = ''; var relevance = 0; @@ -395,7 +395,7 @@ const HLJS = function(hljs) { languageSubset = languageSubset || options.languages || Object.keys(languages); var result = { relevance: 0, - emitter: new TokenTree(), + emitter: new TokenTreeEmitter(), value: escape(code) }; var second_best = result; diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js index 75babbbf3c..05c634e669 100644 --- a/src/lib/token_tree.js +++ b/src/lib/token_tree.js @@ -1,4 +1,4 @@ -export default class TokenTree { +class TokenTree { constructor() { this.rootNode = { children: [] }; this.stack = [ this.rootNode ]; @@ -8,31 +8,12 @@ export default class TokenTree { return this.stack[this.stack.length - 1]; } + get root() { return this.rootNode }; + add(node) { this.top.children.push(node); } - addKeyword(text, kind) { - if (text === "") { return; } - - this.openNode(kind); - this.addText(text); - this.closeNode(); - } - - addText(text) { - if (text === "") { return; } - - this.add(text); - } - - addSublanguage({rootNode}, name) { - let node = rootNode; - node.kind = name; - node.sublanguage = true; - this.add(node); - } - openNode(kind) { let node = { kind, children: [] }; this.add(node); @@ -52,12 +33,8 @@ export default class TokenTree { return JSON.stringify(this.rootNode, null, 4); } - finalize() { - return; - } - walk(builder) { - return TokenTree._walk(builder, this.rootNode); + return this.constructor._walk(builder, this.rootNode); } static _walk(builder, node) { @@ -73,7 +50,7 @@ export default class TokenTree { static _collapse(node) { if (!node.children) { - return + return; } if (node.children.every(el => typeof el === "string")) { node.text = node.children.join("") @@ -86,3 +63,47 @@ export default class TokenTree { } } } + +/** + Currently this is all private API, but this is the minimal API necessary + that an Emitter must implement to fully support the parser. + + API: + + - addKeyword(text, kind) + - addText(text) + - addSublanguage(emitter, subLangaugeName) + - finalize() + +*/ +export default class TokenTreeEmitter extends TokenTree { + constructor() { + super(); + } + + addKeyword(text, kind) { + if (text === "") { return; } + + this.openNode(kind); + this.addText(text); + this.closeNode(); + } + + addText(text) { + if (text === "") { return; } + + this.add(text); + } + + addSublanguage(emitter, name) { + let node = emitter.root; + node.kind = name; + node.sublanguage = true; + this.add(node); + } + + finalize() { + return; + } + +} From 1e149620f2579d99a0d1201801485f56655f5266 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 29 Feb 2020 16:34:56 -0500 Subject: [PATCH 031/816] (enh) make emitter a beta config option - make emitter configurable - mark this API as beta/private for now - make rendering HTML a responsibility of the emitter (though it can of course delegate) That wraps emitting/rendering up nicely into a single object. --- src/highlight.js | 12 +++++++----- src/lib/token_tree.js | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/highlight.js b/src/highlight.js index 86910cc75b..e14338e5e6 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -5,7 +5,6 @@ https://highlightjs.org/ import deepFreeze from './vendor/deep_freeze'; import TokenTreeEmitter from './lib/token_tree'; -import HTMLRenderer from './lib/html_renderer'; import * as regex from './lib/regex'; import * as utils from './lib/utils'; import * as MODES from './lib/modes'; @@ -44,7 +43,10 @@ const HLJS = function(hljs) { classPrefix: 'hljs-', tabReplace: null, useBR: false, - languages: undefined + languages: undefined, + // beta configuration options, subject to change, welcome to discuss + // https://github.com/highlightjs/highlight.js/issues/1086 + __emitter: TokenTreeEmitter }; /* Utility functions */ @@ -322,7 +324,7 @@ const HLJS = function(hljs) { var top = continuation || language; var continuations = {}; // keep continuations for sub-languages var result; - var emitter = new TokenTreeEmitter(); + var emitter = new options.__emitter(options); processContinuations(); var mode_buffer = ''; var relevance = 0; @@ -341,7 +343,7 @@ const HLJS = function(hljs) { processLexeme(codeToHighlight.substr(index)); emitter.closeAllNodes(); emitter.finalize(); - result = new HTMLRenderer(emitter, options).value(); + result = emitter.toHTML(); return { relevance: relevance, @@ -395,7 +397,7 @@ const HLJS = function(hljs) { languageSubset = languageSubset || options.languages || Object.keys(languages); var result = { relevance: 0, - emitter: new TokenTreeEmitter(), + emitter: new options.__emitter(options), value: escape(code) }; var second_best = result; diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js index 05c634e669..8e5df9c313 100644 --- a/src/lib/token_tree.js +++ b/src/lib/token_tree.js @@ -1,3 +1,5 @@ +import HTMLRenderer from './html_renderer'; + class TokenTree { constructor() { this.rootNode = { children: [] }; @@ -68,17 +70,22 @@ class TokenTree { Currently this is all private API, but this is the minimal API necessary that an Emitter must implement to fully support the parser. - API: + Minimal interface: - addKeyword(text, kind) - addText(text) - addSublanguage(emitter, subLangaugeName) - finalize() + - openNode(kind) + - closeNode() + - closeAllNodes() + - toHTML() */ export default class TokenTreeEmitter extends TokenTree { - constructor() { + constructor(options) { super(); + this.options = options; } addKeyword(text, kind) { @@ -102,6 +109,11 @@ export default class TokenTreeEmitter extends TokenTree { this.add(node); } + toHTML() { + let renderer = new HTMLRenderer(this, this.options); + return renderer.value(); + } + finalize() { return; } From ad43aa387cdab40a6728c81e75019559808b5366 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 1 Mar 2020 09:25:39 -0500 Subject: [PATCH 032/816] (parser) before/after plugin callbacks for `highlight` (#2395) --- CHANGES.md | 4 +++- docs/api.rst | 1 + docs/plugin-api.rst | 40 ++++++++++++++++++++++++++++++++++++++++ src/highlight.js | 28 ++++++++++++++++++++++++++-- 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2dbc7b86fe..69622b4231 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,8 +9,10 @@ New themes: - none. -Core Changes: +Parser Engine Changes: +- add `before:highlight` plugin API callback (#2395) [Josh Goebel][] +- add `after:highlight` plugin API callback (#2395) [Josh Goebel][] - split out parse tree generation and HTML rendering concerns (#2404) [Josh Goebel][] - every language can have a `name` attribute now (#2400) [Josh Goebel][] - improve regular expression detect (less false-positives) (#2380) [Josh Goebel][] diff --git a/docs/api.rst b/docs/api.rst index 646b1d2f67..deb6f496c2 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -28,6 +28,7 @@ Returns an object with the following properties: * ``value``: HTML string with highlighting markup * ``top``: top of the current mode stack * ``illegal``: boolean representing whether any illegal matches were found +* ``code``: the original raw code ``highlightAuto(code, languageSubset)`` diff --git a/docs/plugin-api.rst b/docs/plugin-api.rst index 83f3fa1ffd..4b9397ddf6 100644 --- a/docs/plugin-api.rst +++ b/docs/plugin-api.rst @@ -61,6 +61,46 @@ This approach is best for simpler plugins. Callbacks --------- +before:highlight({code, language}) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This callback function is passed a context object with two keys: + +code + The code to be highlighted. + +language + The language grammar that should be used for highlighting. + +Your plugin may modify either value and those new values will be used as input +to the highlighting engine. If you add a ``result`` key to the object that +result will be returned as the overall result and the internal highlighting code +will never even be called. + +If you're plugin plans to make its own recursive calls to ``highlight`` you'll +need to manually handle this. Each time ``highlight`` is called your plugin +callbacks will also be called - making it easy to get into an infinite loop. +You'll likely need to use a class based plugin and add a guard so that your +plugin code is only triggered on the initial call to ``highlight`` and not on +any internal calls your plugin itself is making. + +Note: This callback does not fire from highlighting resulting from auto-language detection. + +It returns nothing. + + +after:highlight(result) +^^^^^^^^^^^^^^^^^^^^^^^ + +This callback function is passed the ``result`` object after highlighting is +complete. Your plugin may make any changes it desires to the result object +and that will be the final return value of the initial call to ``highlight``. + +Note: This callback does not fire from highlighting resulting from auto-language detection. + +It returns nothing. + + after:highlightBlock({block, result}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/highlight.js b/src/highlight.js index e14338e5e6..2b97470e3a 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -89,10 +89,34 @@ const HLJS = function(hljs) { * @property {string} language - the language name * @property {number} relevance - the relevance score * @property {string} value - the highlighted HTML code + * @property {string} code - the original raw code * @property {mode} top - top of the current mode stack * @property {boolean} illegal - indicates whether any illegal matches were found */ function highlight(languageName, code, ignore_illegals, continuation) { + var context = { + code, + language: languageName + }; + // the plugin can change the desired language or the code to be highlighted + // just be changing the object it was passed + fire("before:highlight", context); + + // a before plugin can usurp the result completely by providing it's own + // in which case we don't even need to call highlight + var result = context.result ? + context.result : + _highlight(context.language, context.code, ignore_illegals, continuation); + + result.code = context.code; + // the plugin can change anything in result to suite it + fire("after:highlight", result); + + return result; + } + + // private highlight that's used internally and does not fire callbacks + function _highlight(languageName, code, ignore_illegals, continuation) { var codeToHighlight = code; function endOfMode(mode, lexeme) { @@ -157,7 +181,7 @@ const HLJS = function(hljs) { } var result = explicit ? - highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : + _highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); // Counting embedded language score towards the host language may be disabled @@ -402,7 +426,7 @@ const HLJS = function(hljs) { }; var second_best = result; languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) { - var current = highlight(name, code, false); + var current = _highlight(name, code, false); current.language = name; if (current.relevance > second_best.relevance) { second_best = current; From 6816975261ba08a24d008e2d28ef66234390081d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 1 Mar 2020 17:09:30 -0500 Subject: [PATCH 033/816] (chore) document variants/contains:[self] behavior (#2443) Closes #826 --- docs/reference.rst | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/reference.rst b/docs/reference.rst index dafee4abd2..91aff26029 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -300,7 +300,7 @@ each having all the attributes from the main definition augmented or overridden { className: 'string', - contains: [hljs.BACKSLASH_ESCAPE], + contains: ['self', hljs.BACKSLASH_ESCAPE], relevance: 0, variants: [ {begin: /"/, end: /"/}, @@ -308,6 +308,21 @@ each having all the attributes from the main definition augmented or overridden ] } +Note: ``variants`` has very specific behavior with regards to ``contains: ['self']``. +Lets consider the example above. While you might think this would allow you to +embed any type of string (double or single quoted) within any other string, it +does not allow for this. + +The variants are compiled into to two *discrete* modes:: + + { className: 'string', begin: /"/, contains: ['self', ... ] } + { className: 'string', begin: /'/, contains: ['self', ... ] } + +Each mode's ``self`` refers only to the new expanded mode, not the original mode +with variants (which no longer exists after compiling). + +Further info: https://github.com/highlightjs/highlight.js/issues/826 + .. _subLanguage: From b6d0e373eab5c36f9f660612c77b7e986dc35d79 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 1 Mar 2020 20:34:01 -0500 Subject: [PATCH 034/816] enh(xml) deprecate ActionScript inside script tags (#2444) Resolves #1212. --- CHANGES.md | 1 + src/languages/xml.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 69622b4231..07cb83922a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,7 @@ Parser Engine Changes: Language Improvements: +- enh(xml) deprecate ActionScript inside script tags (#2444) [Josh Goebel][] - fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][] - bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][] - enh(bash) default value is another variable (#2439) [Josh Goebel][] diff --git a/src/languages/xml.js b/src/languages/xml.js index 1b49fef5c1..877092f72e 100644 --- a/src/languages/xml.js +++ b/src/languages/xml.js @@ -121,7 +121,7 @@ export default function(hljs) { contains: [TAG_INTERNALS], starts: { end: '\<\/script\>', returnEnd: true, - subLanguage: ['actionscript', 'javascript', 'handlebars', 'xml'] + subLanguage: ['javascript', 'handlebars', 'xml'] } }, { From 8c248fd7107c0e98b8cbef14220e4ce91c8f5637 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 2 Mar 2020 16:32:55 -0500 Subject: [PATCH 035/816] (bug) Fix `beginKeywords` to ignore . matches (#2434) - split out complex multi-regex matching into discrete classes - new classes allow multiple regex matches at the same index position so if a one mode match is found unsuitable another mode matchcan be attempted - add private ` __onBegin` hook for mode matching (to allow rejecting `.` matches for `beginKeywords`) --- CHANGES.md | 15 +-- docs/reference.rst | 12 ++- src/highlight.js | 36 ++++++- src/lib/mode_compiler.js | 209 ++++++++++++++++++++++++++++++-------- test/api/beginKeywords.js | 51 ++++++++++ 5 files changed, 269 insertions(+), 54 deletions(-) create mode 100644 test/api/beginKeywords.js diff --git a/CHANGES.md b/CHANGES.md index 07cb83922a..a1bf0402fa 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ New languages: -- (php-template) Explicit language to detect PHP templates (vs xml) [Josh Goebel][] +- add(php-template) Explicit language to detect PHP templates (vs xml) [Josh Goebel][] - enh(python) Added `python-repl` for Python REPL sessions New themes: @@ -11,12 +11,13 @@ New themes: Parser Engine Changes: -- add `before:highlight` plugin API callback (#2395) [Josh Goebel][] -- add `after:highlight` plugin API callback (#2395) [Josh Goebel][] -- split out parse tree generation and HTML rendering concerns (#2404) [Josh Goebel][] -- every language can have a `name` attribute now (#2400) [Josh Goebel][] -- improve regular expression detect (less false-positives) (#2380) [Josh Goebel][] -- make `noHighlightRe` and `languagePrefixRe` configurable (#2374) [Josh Goebel][] +- (bug) Fix `beginKeywords` to ignore . matches (#2434) [Josh Goebel][] +- (enh) add `before:highlight` plugin API callback (#2395) [Josh Goebel][] +- (enh) add `after:highlight` plugin API callback (#2395) [Josh Goebel][] +- (enh) split out parse tree generation and HTML rendering concerns (#2404) [Josh Goebel][] +- (enh) every language can have a `name` attribute now (#2400) [Josh Goebel][] +- (enh) improve regular expression detect (less false-positives) (#2380) [Josh Goebel][] +- (enh) make `noHighlightRe` and `languagePrefixRe` configurable (#2374) [Josh Goebel][] Language Improvements: diff --git a/docs/reference.rst b/docs/reference.rst index 91aff26029..8d5b0b80e6 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -89,21 +89,25 @@ Used instead of ``begin`` for modes starting with keywords to avoid needless rep :: { - begin: '\\b(extends|implements) ', - keywords: 'extends implements' + begin: '\\b(class|interface)\\b', + keywords: 'class interface' } -… becomes: +… can often be shortened to: :: { - beginKeywords: 'extends implements' + beginKeywords: 'class interface' } Unlike the :ref:`keywords ` attribute, this one allows only a simple list of space separated keywords. If you do need additional features of ``keywords`` or you just need more keywords for this mode you may include ``keywords`` along with ``beginKeywords``. +Note: ``beginKeywords`` also checks for a ``.`` before or after the keywords and will fail to match if one is found. +This is to avoid false positives for method calls or property accesses. + +Ex. ``class A { ... }`` would match while ``A.class == B.class`` would not. .. _endsWithParent: diff --git a/src/highlight.js b/src/highlight.js index 2b97470e3a..24fb7d3395 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -209,11 +209,30 @@ const HLJS = function(hljs) { top = Object.create(mode, {parent: {value: top}}); } + function doIgnore(lexeme) { + if (top.matcher.regexIndex === 0) { + // no more regexs to potentially match here, so we move the cursor forward one + // space + mode_buffer += lexeme[0]; + return 1; + } else { + // no need to move the cursor, we still have additional regexes to try and + // match at this very spot + continueScanAtSamePosition = true; + return 0; + } + } function doBeginMatch(match) { var lexeme = match[0]; var new_mode = match.rule; + if (new_mode.__onBegin) { + let res = new_mode.__onBegin(match) || {}; + if (res.ignoreMatch) + return doIgnore(lexeme); + } + if (new_mode && new_mode.endSameAsBegin) { new_mode.endRe = regex.escape( lexeme ); } @@ -292,6 +311,8 @@ const HLJS = function(hljs) { return 0; } + + // we've found a 0 width match and we're stuck, so we need to advance // this happens when we have badly behaved rules that have optional matchers to the degree that // sometimes they can end up matching nothing at all @@ -355,9 +376,20 @@ const HLJS = function(hljs) { var match, processedCount, index = 0; try { + var continueScanAtSamePosition = false; + top.matcher.considerAll(); + while (true) { - top.terminators.lastIndex = index; - match = top.terminators.exec(codeToHighlight); + if (continueScanAtSamePosition) { + continueScanAtSamePosition = false; + // only regexes not matched previously will now be + // considered for a potential match + } else { + top.matcher.lastIndex = index; + top.matcher.considerAll(); + } + match = top.matcher.exec(codeToHighlight); + // console.log("match", match[0], match.rule && match.rule.begin) if (!match) break; let beforeMatch = codeToHighlight.substring(index, match.index); diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index d468022a28..10fd000483 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -15,66 +15,192 @@ export function compileLanguage(language) { ); } - function buildModeRegex(mode) { + /** + Stores multiple regular expressions and allows you to quickly search for + them all in a string simultaneously - returning the first match. It does + this by creating a huge (a|b|c) regex - each individual item wrapped with () + and joined by `|` - using match groups to track position. When a match is + found checking which position in the array has content allows us to figure + out which of the original regexes / match groups triggered the match. + + The match object itself (the result of `Regex.exec`) is returned but also + enhanced by merging in any meta-data that was registered with the regex. + This is how we keep track of which mode matched, and what type of rule + (`illegal`, `begin`, end, etc). + */ + class MultiRegex { + constructor() { + this.matchIndexes = {}; + this.regexes = []; + this.matchAt = 1; + this.position = 0; + } - var matchIndexes = {}; - var matcherRe; - var regexes = []; - var matcher = {}; - var matchAt = 1; + addRule(re, opts) { + opts.position = this.position++; + this.matchIndexes[this.matchAt] = opts; + this.regexes.push([opts, re]); + this.matchAt += regex.countMatchGroups(re) + 1; + } - function addRule(rule, re) { - matchIndexes[matchAt] = rule; - regexes.push([rule, re]); - matchAt += regex.countMatchGroups(re) + 1; + compile() { + if (this.regexes.length === 0) { + // avoids the need to check length every time exec is called + this.exec = () => null; + } + let terminators = this.regexes.map(el => el[1]); + this.matcherRe = langRe(regex.join(terminators, '|'), true); + this.lastIndex = 0; } - mode.contains.forEach(term => addRule(term, term.begin)) + exec(s) { + this.matcherRe.lastIndex = this.lastIndex; + let match = this.matcherRe.exec(s); + if (!match) { return null; } - if (mode.terminator_end) - addRule("end", mode.terminator_end); - if (mode.illegal) - addRule("illegal", mode.illegal); + let i = match.findIndex((el, i) => i>0 && el!=undefined); + let matchData = this.matchIndexes[i]; - var terminators = regexes.map(el => el[1]); - matcherRe = langRe(regex.join(terminators, '|'), true); + return Object.assign(match, matchData); + } + } - matcher.lastIndex = 0; - matcher.exec = function(s) { - var rule; + /* + Created to solve the key deficiently with MultiRegex - there is no way to + test for multiple matches at a single location. Why would we need to do + that? In the future a more dynamic engine will allow certain matches to be + ignored. An example: if we matched say the 3rd regex in a large group but + decided to ignore it - we'd need to started testing again at the 4th + regex... but MultiRegex itself gives us no real way to do that. - if( regexes.length === 0) return null; + So what this class creates MultiRegexs on the fly for whatever search + position they are needed. - matcherRe.lastIndex = matcher.lastIndex; - var match = matcherRe.exec(s); - if (!match) { return null; } + NOTE: These additional MultiRegex objects are created dynamically. For most + grammars most of the time we will never actually need anything more than the + first MultiRegex - so this shouldn't have too much overhead. - for(var i = 0; i matcher.addRule(re,opts)) + matcher.compile(); + this.multiRegexes[index] = matcher; + return matcher; + } + + considerAll() { + this.regexIndex = 0; + } + + addRule(re, opts) { + this.rules.push([re, opts]); + if (opts.type==="begin") this.count++; + } - // illegal or end match - if (typeof rule === "string") { - match.type = rule; - match.extra = [mode.illegal, mode.terminator_end]; - } else { - match.type = "begin"; - match.rule = rule; + exec(s) { + let m = this.getMatcher(this.regexIndex); + m.lastIndex = this.lastIndex; + let result = m.exec(s); + if (result) { + this.regexIndex += result.position + 1; + if (this.regexIndex === this.count) // wrap-around + this.regexIndex = 0; } - return match; - }; - return matcher; + // this.regexIndex = 0; + return result; + } + } + + function buildModeRegex(mode) { + + let mm = new ResumableMultiRegex(); + + mode.contains.forEach(term => mm.addRule(term.begin, {rule: term, type: "begin" })) + + if (mode.terminator_end) + mm.addRule(mode.terminator_end, {type: "end"} ); + if (mode.illegal) + mm.addRule(mode.illegal, {type: "illegal"} ); + + return mm; } + // TODO: We need negative look-behind support to do this properly + function skipIfhasPrecedingOrTrailingDot(match) { + let before = match.input[match.index-1]; + let after = match.input[match.index + match[0].length]; + if (before === "." || after === ".") { + return {ignoreMatch: true }; + } + } + + /** skip vs abort vs ignore + * + * @skip - The mode is still entered and exited normally (and contains rules apply), + * but all content is held and added to the parent buffer rather than being + * output when the mode ends. Mostly used with `sublanguage` to build up + * a single large buffer than can be parsed by sublanguage. + * + * - The mode begin ands ends normally. + * - Content matched is added to the parent mode buffer. + * - The parser cursor is moved forward normally. + * + * @abort - A hack placeholder until we have ignore. Aborts the mode (as if it + * never matched) but DOES NOT continue to match subsequent `contains` + * modes. Abort is bad/suboptimal because it can result in modes + * farther down not getting applied because an earlier rule eats the + * content but then aborts. + * + * - The mode does not begin. + * - Content matched by `begin` is added to the mode buffer. + * - The parser cursor is moved forward accordingly. + * + * @ignore - Ignores the mode (as if it never matched) and continues to match any + * subsequent `contains` modes. Ignore isn't technically possible with + * the current parser implementation. + * + * - The mode does not begin. + * - Content matched by `begin` is ignored. + * - The parser cursor is not moved forward. + */ + function compileMode(mode, parent) { if (mode.compiled) return; mode.compiled = true; + // __onBegin is considered private API, internal use only + mode.__onBegin = null; + mode.keywords = mode.keywords || mode.beginKeywords; if (mode.keywords) mode.keywords = compileKeywords(mode.keywords, language.case_insensitive); @@ -89,6 +215,7 @@ export function compileLanguage(language) { // doesn't allow spaces in keywords anyways and we still check for the boundary // first mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?=\\b|\\s)'; + mode.__onBegin = skipIfhasPrecedingOrTrailingDot; } if (!mode.begin) mode.begin = /\B|\b/; @@ -119,7 +246,7 @@ export function compileLanguage(language) { compileMode(mode.starts, parent); } - mode.terminators = buildModeRegex(mode); + mode.matcher = buildModeRegex(mode); } // self is not valid at the top-level diff --git a/test/api/beginKeywords.js b/test/api/beginKeywords.js new file mode 100644 index 0000000000..53bf85b796 --- /dev/null +++ b/test/api/beginKeywords.js @@ -0,0 +1,51 @@ +'use strict'; + +const hljs = require('../../build'); + +let grammar = function() { + return { + contains: [ + { beginKeywords: "class" } + ] + } +} + +let grammarWithFollowupRule = function() { + return { + contains: [ + { beginKeywords: "class" }, + { begin: "class", className: "found" } + ] + } +} + +describe('beginKeywords', () => { + before( () => { + hljs.registerLanguage("test", grammar); + hljs.registerLanguage("has-followup", grammarWithFollowupRule); + }); + + it("should allow subsequence matches to still succeed", () => { + let content = "A.class = self"; + let res = hljs.highlight("has-followup", content); + res.value.should.equal('A.class = self'); + }); + + it("should ignore a preceeding .", () => { + let content = "A.class = self"; + let res = hljs.highlight("test", content); + res.value.should.equal('A.class = self'); + }); + + it("should ignore a trailing .", () => { + let content = "class.config = true"; + let res = hljs.highlight("test", content); + res.value.should.equal('class.config = true'); + }); + + it('should detect keywords', () => { + let content = "I have a class yes I do."; + let res = hljs.highlight("test", content); + res.value.should.equal('I have a class yes I do.'); + }); +}); From ed4b46fb06a73791c929459a428bb998d70e2816 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 5 Mar 2020 04:17:40 -0500 Subject: [PATCH 036/816] (chore) Update issue templates --- .../incorrect-syntax-highlighting.md | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/incorrect-syntax-highlighting.md b/.github/ISSUE_TEMPLATE/incorrect-syntax-highlighting.md index c1de92e6ab..f9fa81ebf1 100644 --- a/.github/ISSUE_TEMPLATE/incorrect-syntax-highlighting.md +++ b/.github/ISSUE_TEMPLATE/incorrect-syntax-highlighting.md @@ -1,26 +1,39 @@ --- name: Incorrect syntax highlighting about: Report incorrect syntax highlighting... -title: "([language name]) Short description of issue..." -labels: language, bug, help welcome +title: "(language name) Short description of issue..." +labels: bug, help welcome, language assignees: '' --- **Describe the issue** -A clear and concise description of what the issue seems to be. + **Which language seems to have the issue?** + + +**Are you using `highlight` or `highlightAuto`?** + +... **Sample Code to Reproduce** -Please include text examples of the code that fails to highlight properly or can reproduce the bug. You can attach a screenshot if you'd like, but the code is necessary because we may need to copy/paste it to help resolve the issue - or add it to a test. + + **Expected behavior** + **Additional context** + From 315bf597b319299d4f4504816660768a48b47c9d Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 13:49:40 +0000 Subject: [PATCH 037/816] chore(package): update rollup to version 2.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8de5f55004..cb8a136608 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "jsdom": "^16.0.1", "lodash": "^4.17.15", "mocha": "^7.0.1", - "rollup": "^1.27.8", + "rollup": "^2.0.0", "rollup-plugin-commonjs": "^10.1.0", "should": "^13.2.3", "terser": "^4.3.9", From 1ad2e0764ab812ed5767275da96cf9750dc18f7b Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 13:49:46 +0000 Subject: [PATCH 038/816] chore(package): update lockfile package-lock.json --- package-lock.json | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03b1916605..255cb5e6c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,12 +30,6 @@ "fastq": "^1.6.0" } }, - "@types/estree": { - "version": "0.0.40", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.40.tgz", - "integrity": "sha512-p3KZgMto/JyxosKGmnLDJ/dG5wf+qTRMUjHJcspC2oQKa4jP7mz+tv0ND56lLBu3ojHlhzY33Ol+khLyNmilkA==", - "dev": true - }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -1798,22 +1792,12 @@ } }, "rollup": { - "version": "1.27.8", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.8.tgz", - "integrity": "sha512-EVoEV5rAWl+5clnGznt1KY8PeVkzVQh/R0d2s3gHEkN7gfoyC4JmvIVuCtPbYE8NM5Ep/g+nAmvKXBjzaqTsHA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.0.0.tgz", + "integrity": "sha512-tbvWownITR+0ebaX6iRr7IcLkziTCJacRpmWz03NIj3CZDmGlergYSwdG8wPx68LT0ms1YzqmbjUQHb6ut8pdw==", "dev": true, "requires": { - "@types/estree": "*", - "@types/node": "*", - "acorn": "^7.1.0" - }, - "dependencies": { - "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", - "dev": true - } + "fsevents": "~2.1.2" } }, "rollup-plugin-commonjs": { From b862fc1e1e2e0d3e46749b7554626588179622f0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 8 Mar 2020 01:17:05 -0500 Subject: [PATCH 039/816] (chore) Update README to mention version 10 - Try and see if we can stop people from submitting "fixes" to our newer docs --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c5896afbbb..41d68fd0fa 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +**This documentation reflects version 10, which is not released yet. For the stable README, see .** + # Highlight.js [![Build Status](https://travis-ci.org/highlightjs/highlight.js.svg?branch=master)](https://travis-ci.org/highlightjs/highlight.js) [![Greenkeeper badge](https://badges.greenkeeper.io/highlightjs/highlight.js.svg)](https://greenkeeper.io/) [![install size](https://packagephobia.now.sh/badge?p=highlight.js)](https://packagephobia.now.sh/result?p=highlight.js) From 94faa802a06f671fab113b9c79e9f03ca6671289 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 9 Mar 2020 22:32:51 -0400 Subject: [PATCH 040/816] (chores) minor cleanups and chores for v10 release/beta (#2447) * update docs * readme links to upgrade docs * build the version # into the distributable * clean up linter warnings * mention v10 upgrade doc --- .gitignore | 3 + README.md | 8 +++ ...AKING.md => VERSION_10_BREAKING_CHANGES.md | 0 VERSION_10_UPGRADE.md | 58 +++++++++++++++++++ package-lock.json | 9 +++ package.json | 1 + src/highlight.js | 28 +++++---- tools/build_browser.js | 2 +- tools/build_config.js | 9 ++- tools/build_node.js | 2 +- 10 files changed, 105 insertions(+), 15 deletions(-) rename VERSION_10_BREAKING.md => VERSION_10_BREAKING_CHANGES.md (100%) create mode 100644 VERSION_10_UPGRADE.md diff --git a/.gitignore b/.gitignore index 01c7f25df1..52ed616381 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ extra/ .idea/ .vscode/ .Rproj.user + +# misc +/work diff --git a/README.md b/README.md index 41d68fd0fa..06dcf60cf2 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,14 @@ the browser as well as on the server. It works with pretty much any markup, doesn’t depend on any framework, and has automatic language detection. +## Upgrading from Version 9 + +Version 10 is one of the biggest releases in quite some time. If you're +upgrading from version 9, there are some breaking changes and things you may +want to double check first. + +Please read [VERSION_10_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md) for high-level summary of breaking changes and any actions you may need to take. See [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_BREAKING_CHANGES.md) for a more detailed list and [CHANGES.md](https://github.com/highlightjs/highlight.js/blob/master/CHANGES.md) to learn what else is new. + ## Getting Started The bare minimum for using highlight.js on a web page is linking to the diff --git a/VERSION_10_BREAKING.md b/VERSION_10_BREAKING_CHANGES.md similarity index 100% rename from VERSION_10_BREAKING.md rename to VERSION_10_BREAKING_CHANGES.md diff --git a/VERSION_10_UPGRADE.md b/VERSION_10_UPGRADE.md new file mode 100644 index 0000000000..5bb42cf996 --- /dev/null +++ b/VERSION_10_UPGRADE.md @@ -0,0 +1,58 @@ +# Upgrading to Version 10.0 + +Welcome to version 10.0. This a major release and therefore will contain breaking changes. + +## Breaking Changes + +Our normal minor releases try to never break anything, holding all breaking changes for major releases. +We tried to squeeze in as many as we could this time so that after 10.0 ships we'll be back to quiet sailing for a while before we need to push version 11. That said, we're very conservative about what we consider a breaking change. + +*IE, if there it could possibly break things for anyone, it's typically a breaking change.* The fact is a vast majority of users should upgrade and probably not notice any changes at all. + +See [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_BREAKING_CHANGES.md) for a comprehensive list of breaking changes, but here is a summary... if you use: + +### Core highlight.js lib on the client (with no extra CDN languages) + +Just keep doing that. + +- If you're using `darkula.css`, you'll need to change that to `darcula.css` +- The minified distributable has changed from `.pack.js` to `.min.js`, update your name when you update your URL. +- If your users have very old browsers, they may no longer be supported (no more IE11, etc.). (We're using ES2015 code now.) +- `nohighlight` or `no-highlight` are the only two CSS classes that will SKIP highlighting completely. `*text*` and `*plain*` no longer will do this. + +### Core highlight.js lib on the client (plus additional CDN languages) + +Quite a few grammars have been renamed. Ex: `nimrod.js` is now `nim.js`. + +- Check the renamed grammars to see if you might need to update your links. +- Be aware that you can't use version 9 CDN JS files anymore, they aren't compatible. +- Plus read the above list of items. + +### highlight.js on the server (via NPM) and only use the public API + +If you're just pulling in the FULL library (`require('./highlight.js')`) just keep doing that. You might not need to change anything. + +- If you're manually loading a smaller set of languages and using `registerLanguage` make sure you check out all the renamed grammars and dependency changes. +- Read the client-side lists above also. + +### highlight.js on the server (via NPM) with a custom integration + +Read the complete breaking changes list carefully. + +- Read the client-side lists above also. + +### highlight.js lib on the client, with source directly from our GitHub repo + +That will no longer work. The source needs to be built to work properly and cannot be used "raw" unless you've also setup your own build pipeline (rollup, etc.). Fetch a static build from the CDN, the [cdn-release repo](https://github.com/highlightjs/cdn-release) or use the new [`highlightjs-dist`]() NPM package. + +### highlight.js source code directly from our GitHub repo with a custom integration + +All bets are off, since we only try to guarantee stability of our NPM and CDN builds and the public API. Read all the breaking changes and perhaps skim the commit history. + +- We're using ES6 modules now. +- We're using an entirely new build system. +- The source will likely become more and more modular during the 10.0 timeline. + +## Enjoy and good luck. + +As always if you have any questions or issues, jump on the [Github Issues](https://github.com/highlightjs/highlight.js/issues). diff --git a/package-lock.json b/package-lock.json index 255cb5e6c7..74c1ef7dc8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1824,6 +1824,15 @@ } } }, + "rollup-plugin-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-json/-/rollup-plugin-json-4.0.0.tgz", + "integrity": "sha512-hgb8N7Cgfw5SZAkb3jf0QXii6QX/FOkiIq2M7BAQIEydjHvTyxXHQiIzZaTFgx1GK0cRCHOCBHIyEkkLdWKxow==", + "dev": true, + "requires": { + "rollup-pluginutils": "^2.5.0" + } + }, "rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", diff --git a/package.json b/package.json index cb8a136608..2e1c8b4187 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "mocha": "^7.0.1", "rollup": "^2.0.0", "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-json": "^4.0.0", "should": "^13.2.3", "terser": "^4.3.9", "tiny-worker": "^2.3.0" diff --git a/src/highlight.js b/src/highlight.js index 24fb7d3395..9ce4bd97c3 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -9,6 +9,7 @@ import * as regex from './lib/regex'; import * as utils from './lib/utils'; import * as MODES from './lib/modes'; import { compileLanguage } from './lib/mode_compiler'; +import * as packageJSON from '../package.json'; const escape = utils.escapeHTML; const inherit = utils.inherit; @@ -74,7 +75,7 @@ const HLJS = function(hljs) { return classes .split(/\s+/) - .find((_class) => shouldNotHighlight(_class) || getLanguage(_class)) + .find((_class) => shouldNotHighlight(_class) || getLanguage(_class)); } /** @@ -194,17 +195,20 @@ const HLJS = function(hljs) { if (explicit) { continuations[top.subLanguage] = result.top; } - emitter.addSublanguage(result.emitter, result.language) + emitter.addSublanguage(result.emitter, result.language); } function processBuffer() { - (top.subLanguage != null ? processSubLanguage() : processKeywords()); + if (top.subLanguage != null) + processSubLanguage(); + else + processKeywords(); mode_buffer = ''; } function startNewMode(mode) { if (mode.className) { - emitter.openNode(mode.className) + emitter.openNode(mode.className); } top = Object.create(mode, {parent: {value: top}}); } @@ -289,18 +293,19 @@ const HLJS = function(hljs) { } function processContinuations() { - var list = [] + var list = []; for(var current = top; current !== language; current = current.parent) { if (current.className) { - list.unshift(current.className) + list.unshift(current.className); } } - list.forEach(item => emitter.openNode(item)) + list.forEach(item => emitter.openNode(item)); } var lastMatch = {}; function processLexeme(text_before_match, match) { + var err; var lexeme = match && match[0]; // add non-matched text to the current mode buffer @@ -321,7 +326,7 @@ const HLJS = function(hljs) { // spit the "skipped" character that our regex choked on back into the output sequence mode_buffer += codeToHighlight.slice(match.index, match.index + 1); if (!SAFE_MODE) { - var err = new Error('0 width match regex'); + err = new Error('0 width match regex'); err.languageName = languageName; err.badRule = lastMatch.rule; throw(err); @@ -334,7 +339,7 @@ const HLJS = function(hljs) { return doBeginMatch(match); } else if (match.type==="illegal" && !ignore_illegals) { // illegal match, we do not continue processing - var err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); + err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); err.mode = top; throw err; } else if (match.type==="end") { @@ -670,8 +675,9 @@ const HLJS = function(hljs) { addPlugin }); - hljs.debugMode = function() { SAFE_MODE = false; } - hljs.safeMode = function() { SAFE_MODE = true; } + hljs.debugMode = function() { SAFE_MODE = false; }; + hljs.safeMode = function() { SAFE_MODE = true; }; + hljs.versionString = packageJSON.version; for (const key in MODES) { if (typeof MODES[key] === "object") diff --git a/tools/build_browser.js b/tools/build_browser.js index 45f1bbe1fa..94fa029e40 100644 --- a/tools/build_browser.js +++ b/tools/build_browser.js @@ -106,7 +106,7 @@ async function buildBrowserHighlightJS(languages, {minify}) { var outFile = `${process.env.BUILD_DIR}/highlight.js`; var minifiedFile = outFile.replace(/js$/,"min.js"); - const input = { input: `src/highlight.js` } + const input = { ...config.rollup.browser_core.input, input: `src/highlight.js` } const output = { ...config.rollup.browser_core.output, file: outFile }; var librarySrc = await rollupCode(input, output); diff --git a/tools/build_config.js b/tools/build_config.js index fb78222416..6ce035be96 100644 --- a/tools/build_config.js +++ b/tools/build_config.js @@ -1,4 +1,5 @@ const cjsPlugin = require('rollup-plugin-commonjs'); +const jsonPlugin = require('rollup-plugin-json'); module.exports = { build_dir: "build", @@ -10,6 +11,7 @@ module.exports = { input : { plugins: [ cjsPlugin(), + jsonPlugin(), { transform: (x) => { if (/var module/.exec(x)) { @@ -22,7 +24,9 @@ module.exports = { }, }, browser_core: { - input: {}, + input: { + plugins: [jsonPlugin()] + }, output: { name: "hljs", format: "umd", @@ -32,7 +36,8 @@ module.exports = { browser: { input: { plugins: [ - cjsPlugin() + cjsPlugin(), + jsonPlugin() ] }, output: { diff --git a/tools/build_node.js b/tools/build_node.js index 14da56d6fc..2e258a1c9b 100644 --- a/tools/build_node.js +++ b/tools/build_node.js @@ -35,7 +35,7 @@ async function buildNodeIndex(languages) { } async function buildNodeHighlightJS() { - const input = { input: `src/highlight.js` } + const input = { ...config.rollup.node.input, input: `src/highlight.js` } const output = { ...config.rollup.node.output, file: `${process.env.BUILD_DIR}/lib/core.js` } await rollupWrite(input, output) } From 7c355bf5062c761bad5dd3024e3bdc0b7716cd4d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 19 Mar 2020 15:13:53 -0400 Subject: [PATCH 041/816] (chore) Getting started tweaks (#2457) --- README.md | 127 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 94 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 06dcf60cf2..1e80348f45 100644 --- a/README.md +++ b/README.md @@ -130,21 +130,48 @@ For more info about the returned object refer to the api docs https://highlightj ```js -// require the highlight.js library including all languages +// require the highlight.js library, including all languages const hljs = require('./highlight.js'); const highlightedCode = hljs.highlightAuto('Hello World!').value ``` +Or for a smaller footprint... load just the languages you need. + ```js -// require the highlight.js library without languages -const hljs = require("highlight.js/lib/core"); +const hljs = require("highlight.js/lib/core"); // require only the core library // separately require languages hljs.registerLanguage('html', require('highlight.js/lib/languages/html')); -hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql')); -// highlight with providing the language + const highlightedCode = hljs.highlight('html', 'Hello World!').value ``` + +## ES6 Modules + +First, you'll likely install via `npm` or `yarn` -- see [Getting the Library](#getting-the-library) below. + +In your application: + +```js +import hljs from 'highlight.js'; +``` + +The default import imports all languages. Therefore it is likely to be more efficient to import only the library and the languages you need: + +```js +import hljs from 'highlight.js/lib/core'; +import javascript from 'highlight.js/lib/languages/javascript'; +hljs.registerLanguage('javascript', javascript); +``` + +To set the syntax highlighting style, if your build tool processes CSS from your JavaScript entry point, you can also import the stylesheet directly as modules: + +```js +import hljs from 'highlight.js/lib/core'; +import 'highlight.js/styles/github.css'; +``` + + ## Getting the Library You can get highlight.js as a hosted, or custom-build, browser script or @@ -153,22 +180,12 @@ both AMD and CommonJS, so if you wish you can use RequireJS or Browserify without having to build from source. The server module also works perfectly fine with Browserify, but there is the option to use a build specific to browsers rather than something meant for a server. -Head over to the [download page][5] for all the options. -**Don't link to GitHub directly.** The library is not supposed to work straight + +**Do not link to GitHub directly.** The library is not supposed to work straight from the source, it requires building. If none of the pre-packaged options work for you refer to the [building documentation][6]. -**The CDN-hosted package doesn't have all the languages.** Otherwise it'd be -too big. If you don't see the language you need in the ["Common" section][5], -it can be added manually: - -```html - -``` - **On Almond.** You need to use the optimizer to give the module a name. For example: @@ -176,41 +193,84 @@ example: r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js ``` +### CDN Hosted -### CommonJS +A prebuilt version of highlight.js bundled with many common languages is hosted by the following CDNs: -You can import Highlight.js as a CommonJS-module: +**cdnjs** ([link](https://cdnjs.com/libraries/highlight.js)) -```bash -npm install highlight.js --save +```html + + + + ``` -In your application: +**jsdelivr** ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) -```js -import hljs from 'highlight.js'; +```html + + ``` -The default import imports all languages! Therefore it is likely to be more efficient to import only the library and the languages you need: +**Note:** *The CDN-hosted `highlight.min.js` package doesn't bundle every language.* It would be +very large. You can find our list "common" languages that we bundle by default on our [download page][5]. -```js -import hljs from 'highlight.js/lib/core'; -import javascript from 'highlight.js/lib/languages/javascript'; -hljs.registerLanguage('javascript', javascript); +### Self Hosting + +The [download page][5] can quickly generate a custom bundle including only the languages you need. + +Alternatively, you can build a browser package from [source](#source): + +``` +node tools/build.js -t browser :common ``` -To set the syntax highlighting style, if your build tool processes CSS from your JavaScript entry point, you can import the stylesheet directly into your CommonJS-module: +See our [building documentation][6] for more information. -```js -import hljs from 'highlight.js/lib/core'; -import 'highlight.js/styles/github.css'; +**Note:** Building from source should always result in the smallest size builds. Thw website download page is optimized for speed, not size. + + +#### Prebuilt CDN assets + +You can also download and self-host the same assets we serve up via our own CDNs. We publish those builds to the [cdn-release](https://github.com/highlightjs/cdn-release) GitHub repository. You can easily pull individual files off the CDN endpoints with `curl`, etc; if say you only needed `highlight.min.js` and a single CSS file. + +There is also an npm package [@highlightjs/cdn-assets](https://www.npmjs.com/package/@highlightjs/cdn-assets) if pulling the assets in via `npm` or `yarn` would be easier for your build process. + + +### NPM / Node.js server module + +Highlight.js can also be used on the server. The package with all supported languages can be installed from NPM or Yarn: + +```bash +npm install highlight.js +# or +yarn add highlight.js +``` + +Alternatively, you can build it from [source](#source): + +```bash +node tools/build.js -t node ``` +See our [building documentation][6] for more information. + + +### Source + +[Current source][10] is always available on GitHub. + + ## License Highlight.js is released under the BSD License. See [LICENSE][7] file for details. + ## Links The official site for the library is at . @@ -229,3 +289,4 @@ Authors and contributors are listed in the [AUTHORS.txt][8] file. [7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE [8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.txt [9]: https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md +[10]: https://github.com/highlightjs/ From 0e91095b6606b4f58e4996fa0e91fb0330b9f79a Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2020 15:14:29 -0400 Subject: [PATCH 042/816] =?UTF-8?q?(chore)=20update=20commander=20to=20the?= =?UTF-8?q?=20latest=20version=20=F0=9F=9A=80=20(#2458)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update commander to version 5.0.0 * chore(package): update lockfile package-lock.json Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 74c1ef7dc8..0801edc119 100644 --- a/package-lock.json +++ b/package-lock.json @@ -414,9 +414,9 @@ } }, "commander": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.0.0.tgz", - "integrity": "sha512-SEa2abMBTZuEjLVYpNrAFoRgxPwG4rXP3+SGY6CM/HZGeDzIA7Pzp+7H3AHDukKEpyy2SoSGGPShKqqfH9T9AQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.0.0.tgz", + "integrity": "sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ==", "dev": true }, "concat-map": { diff --git a/package.json b/package.json index 2e1c8b4187..993a5ea16b 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "clean-css": "^4.2.1", "cli-table": "^0.3.1", "colors": "^1.1.2", - "commander": "^4.0.0", + "commander": "^5.0.0", "del": "^5.1.0", "dependency-resolver": "^2.0.1", "glob": "^7.1.4", From 33a6718ddff1359a691fb9cf58c7d70edafc24e2 Mon Sep 17 00:00:00 2001 From: Bryan Gin-ge Chen Date: Sat, 21 Mar 2020 15:00:45 -0400 Subject: [PATCH 043/816] (docs) add Lean language to list of supported languages (#2464) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 8cfa294f8e..afd7943406 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -93,6 +93,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Kotlin | kotlin, kt | | | LaTeX | tex | | | Leaf | leaf | | +| Lean | lean | [highlightjs-lean](https://github.com/leanprover-community/highlightjs-lean) | | Lasso | lasso, ls, lassoscript | | | Less | less | | | LDIF | ldif | | From 166aa0afb7259c010e7cd05acda8a5d85a81c4db Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 23 Mar 2020 10:17:55 -0400 Subject: [PATCH 044/816] (chore) Fix README to use a valid language in the example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e80348f45..aba96f8ba5 100644 --- a/README.md +++ b/README.md @@ -140,9 +140,9 @@ Or for a smaller footprint... load just the languages you need. ```js const hljs = require("highlight.js/lib/core"); // require only the core library // separately require languages -hljs.registerLanguage('html', require('highlight.js/lib/languages/html')); +hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml')); -const highlightedCode = hljs.highlight('html', 'Hello World!').value +const highlightedCode = hljs.highlight('xml', 'Hello World!').value ``` From 0b40e1cd15578a1bb6128da4db19f22aea61793c Mon Sep 17 00:00:00 2001 From: Adnan Yaqoob Date: Wed, 25 Mar 2020 13:54:45 +0800 Subject: [PATCH 045/816] enh(nim) adds func keyword for (#2468) * adds `func` keyword for nim language --- CHANGES.md | 2 ++ src/languages/nim.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a1bf0402fa..23bc646929 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ Parser Engine Changes: Language Improvements: +- enh(nim) adds `func` keyword (#2468) [Adnan Yaqoob][] - enh(xml) deprecate ActionScript inside script tags (#2444) [Josh Goebel][] - fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][] - bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][] @@ -64,6 +65,7 @@ Developer Tools: [Taufik Nurrohman]: https://github.com/taufik-nurrohman [Josh Goebel]: https://github.com/yyyc514 [Sean Williams]: https://github.com/hmmwhatsthisdo +[Adnan Yaqoob]: https://github.com/adnanyaqoobvirk ## Version 9.18.1 diff --git a/src/languages/nim.js b/src/languages/nim.js index a294294e06..1caaa67a16 100644 --- a/src/languages/nim.js +++ b/src/languages/nim.js @@ -13,7 +13,7 @@ export default function(hljs) { 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 ' + + 'for from func 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', From 67d21e9011de9a9715e7a2d89f76ec4ba21ec42e Mon Sep 17 00:00:00 2001 From: Marat K Date: Wed, 25 Mar 2020 13:08:26 +0100 Subject: [PATCH 046/816] (chore) Fix windows absolute paths. (#2469) * Fix windows absolute paths. Build no like `C:/` :-) --- tools/lib/language.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/language.js b/tools/lib/language.js index 5b237c101a..38897ebe2c 100644 --- a/tools/lib/language.js +++ b/tools/lib/language.js @@ -63,7 +63,7 @@ class Language { } static fromFile(filename) { - if (filename.startsWith("/") || filename.startsWith(".")) + if (path.isAbsolute(filename) || filename.startsWith(".")) { var file = filename } else { From c5b1ae6dc9247d944bdea02cf3117027b2d4839b Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Thu, 26 Mar 2020 13:51:13 +0100 Subject: [PATCH 047/816] (docs) Mention Python-REPL in supported languages (#2470) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index afd7943406..0e926a493b 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -139,6 +139,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Puppet | puppet, pp | | | Python | python, py, gyp | | | Python profiler results | profile | | +| Python REPL | python-repl, pycon | | | Q | k, kdb | | | QML | qml | | | R | r | | From 772dc1fd872028262c7b18bcd9bb2ac3dbfc6300 Mon Sep 17 00:00:00 2001 From: cherryblossom000 <31467609+cherryblossom000@users.noreply.github.com> Date: Sat, 28 Mar 2020 03:19:19 +1100 Subject: [PATCH 048/816] (docs) fix typo (#2471) --- docs/reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference.rst b/docs/reference.rst index 8d5b0b80e6..d2e4cb1c88 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -190,7 +190,7 @@ endSameAsBegin Acts as ``end`` matching exactly the same string that was found by the corresponding ``begin`` regexp. -For example, in PostgreSQL string constants can uee "dollar quotes", +For example, in PostgreSQL string constants can use "dollar quotes", consisting of a dollar sign, an optional tag of zero or more characters, and another dollar sign. String constant must be ended with the same construct using the same tag. It is possible to nest dollar-quoted string From 6a50f692f5bdad8b5c0078e381e76dd8fd65f125 Mon Sep 17 00:00:00 2001 From: Mudassar Ali Date: Sat, 28 Mar 2020 17:58:36 +0500 Subject: [PATCH 049/816] (chore) fix documentation typos (#2472) --- README.md | 2 +- docs/language-requests.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aba96f8ba5..e1503f8ff0 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ node tools/build.js -t browser :common See our [building documentation][6] for more information. -**Note:** Building from source should always result in the smallest size builds. Thw website download page is optimized for speed, not size. +**Note:** Building from source should always result in the smallest size builds. The website download page is optimized for speed, not size. #### Prebuilt CDN assets diff --git a/docs/language-requests.rst b/docs/language-requests.rst index cccf990b23..c8f33d9d02 100644 --- a/docs/language-requests.rst +++ b/docs/language-requests.rst @@ -5,7 +5,7 @@ This is a general answer to requests for adding new languages that appear from time to time in the highlight.js issue tracker and discussion group. Highlight.js doesn't have a fundamental plan for implementing languages, - instead the project works by encouraging develoment of 3rd party language + instead the project works by encouraging development of 3rd party language grammars from contributors. We're also happy to host 3rd party language grammars at the ``highlightjs`` GitHub organization - no matter how obscure or weird. From 52bf8d0e3d0f3df3a0289bbfd45972c598007600 Mon Sep 17 00:00:00 2001 From: Omid Golparvar Date: Fri, 3 Apr 2020 16:51:08 +0430 Subject: [PATCH 050/816] enh(swift) add `compactMap` to `built_in` keywords (#2480) --- CHANGES.md | 2 ++ src/languages/swift.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 23bc646929..bb065e0abc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ Parser Engine Changes: Language Improvements: +- enh(swift) Add `compactMap` to keywords as built_in (#2478) [Omid Golparvar][] - enh(nim) adds `func` keyword (#2468) [Adnan Yaqoob][] - enh(xml) deprecate ActionScript inside script tags (#2444) [Josh Goebel][] - fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][] @@ -58,6 +59,7 @@ Developer Tools: - added Dockerfile for optionally developing with a container +[Omid Golparvar]: https://github.com/omidgolparvar [Alexandre Grison]: https://github.com/agrison [Josh Goebel]: https://github.com/yyyc514 [Sam Miller]: https://github.com/smillerc diff --git a/src/languages/swift.js b/src/languages/swift.js index ce1b6aa8ed..c5e5b0e8ac 100644 --- a/src/languages/swift.js +++ b/src/languages/swift.js @@ -23,7 +23,7 @@ export default function(hljs) { literal: 'true false nil', built_in: 'abs advance alignof alignofValue anyGenerator assert assertionFailure ' + 'bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC ' + - 'bridgeToObjectiveCUnconditional c contains count countElements countLeadingZeros ' + + 'bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros ' + 'debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords ' + 'enumerate equal fatalError filter find getBridgedObjectiveCType getVaList ' + 'indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC ' + From ca23180cff10702aa7b711df8d35bc6af4b4769f Mon Sep 17 00:00:00 2001 From: smaludzi Date: Sat, 4 Apr 2020 20:02:27 +0200 Subject: [PATCH 051/816] Never (#2481) * Never language added to the list of supported languages. --- CHANGES.md | 1 + SUPPORTED_LANGUAGES.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index bb065e0abc..2e682d2c7c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ New languages: - add(php-template) Explicit language to detect PHP templates (vs xml) [Josh Goebel][] - enh(python) Added `python-repl` for Python REPL sessions +- add(never) Added 3rd party Never language support New themes: diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 0e926a493b..157d92b7c5 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -115,6 +115,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Moonscript | moonscript, moon | | | N1QL | n1ql | | | NSIS | nsis | | +| Never | never | [highlightjs-never](https://github.com/never-lang/highlightjs-never) | | Nginx | nginx, nginxconf | | | Nim | nimrod | | | Nix | nix | | From 512ae5f5dcdc6dd24185e6e08737c3679073a9b6 Mon Sep 17 00:00:00 2001 From: Chen Bin Date: Fri, 10 Apr 2020 10:43:15 +1000 Subject: [PATCH 052/816] (themes) Add Srcery style (#2483) --- CHANGES.md | 3 +- src/styles/srcery.css | 78 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 src/styles/srcery.css diff --git a/CHANGES.md b/CHANGES.md index 2e682d2c7c..b6fdef3eff 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ New languages: New themes: -- none. +- *Srcery* by [Chen Bin][] Parser Engine Changes: @@ -63,6 +63,7 @@ Developer Tools: [Omid Golparvar]: https://github.com/omidgolparvar [Alexandre Grison]: https://github.com/agrison [Josh Goebel]: https://github.com/yyyc514 +[Chen Bin]: https://github.com/redguardtoo [Sam Miller]: https://github.com/smillerc [Robert Riebisch]: https://github.com/bttrx [Taufik Nurrohman]: https://github.com/taufik-nurrohman diff --git a/src/styles/srcery.css b/src/styles/srcery.css new file mode 100644 index 0000000000..9c68ff12ee --- /dev/null +++ b/src/styles/srcery.css @@ -0,0 +1,78 @@ +/* +Description: Srcery dark color scheme for highlight.js +Author: Chen Bin +Website: https://srcery-colors.github.io/ +Date: 2020-04-06 +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #1C1B19; + color: #FCE8C3; +} + +.hljs-strong, +.hljs-emphasis { + color: #918175; +} + +.hljs-bullet, +.hljs-quote, +.hljs-link, +.hljs-number, +.hljs-regexp, +.hljs-literal { + color: #FF5C8F; +} + +.hljs-code, +.hljs-selector-class { + color: #68A8E4 +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-section, +.hljs-attribute, +.hljs-variable { + color: #EF2F27; +} + +.hljs-name, +.hljs-title { + color: #FBB829; +} + +.hljs-type, +.hljs-params { + color: #0AAEB3; +} + +.hljs-string { + color: #98BC37; +} + +.hljs-subst, +.hljs-built_in, +.hljs-builtin-name, +.hljs-symbol, +.hljs-selector-id, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-template-tag, +.hljs-template-variable, +.hljs-addition { + color: #C07ABE; +} + +.hljs-comment, +.hljs-deletion, +.hljs-meta { + color: #918175; +} From 30deab18baead4c247263c3f8d1f29c027d93a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= Date: Sun, 12 Apr 2020 01:33:53 +0200 Subject: [PATCH 053/816] (python) don't include `(` `)` in functions `params` match (#2490) - Before: `(x,y,z)` - After: `(x,y,z)` Improves consistency with other grammars. --- CHANGES.md | 3 ++- src/languages/python.js | 10 ++++++++-- test/markup/python-repl/sample.expect.txt | 2 +- test/markup/python/function-header-comments.expect.txt | 10 +++++----- test/markup/python/function-header.expect.txt | 2 +- test/markup/python/matrix-multiplication.expect.txt | 2 +- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b6fdef3eff..5947bb45c1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,7 @@ Parser Engine Changes: Language Improvements: +- enh(python) Exclude parens from functions params (#2490) [Álvaro Mondéjar][] - enh(swift) Add `compactMap` to keywords as built_in (#2478) [Omid Golparvar][] - enh(nim) adds `func` keyword (#2468) [Adnan Yaqoob][] - enh(xml) deprecate ActionScript inside script tags (#2444) [Josh Goebel][] @@ -70,6 +71,7 @@ Developer Tools: [Josh Goebel]: https://github.com/yyyc514 [Sean Williams]: https://github.com/hmmwhatsthisdo [Adnan Yaqoob]: https://github.com/adnanyaqoobvirk +[Álvaro Mondéjar]: https://github.com/mondeja ## Version 9.18.1 @@ -2148,4 +2150,3 @@ your comments and question to [highlight.js forum][forum]. And don't be afraid if you find there some fancy Cyrillic letters -- it's for Russian users too :-) [forum]: http://softwaremaniacs.org/forum/viewforum.php?id=6 - diff --git a/src/languages/python.js b/src/languages/python.js index e7ae1bf222..86e5d32066 100644 --- a/src/languages/python.js +++ b/src/languages/python.js @@ -86,8 +86,14 @@ export default function(hljs) { }; var PARAMS = { className: 'params', - begin: /\(/, end: /\)/, - contains: ['self', PROMPT, NUMBER, STRING, hljs.HASH_COMMENT_MODE] + variants: [ + // Exclude params at functions without params + {begin: /\(\s*\)/, skip: true, className: null }, + { + begin: /\(/, end: /\)/, excludeBegin: true, excludeEnd: true, + contains: ['self', PROMPT, NUMBER, STRING, hljs.HASH_COMMENT_MODE], + }, + ], }; SUBST.contains = [STRING, NUMBER, PROMPT]; return { diff --git a/test/markup/python-repl/sample.expect.txt b/test/markup/python-repl/sample.expect.txt index d5695847b8..6693b43cf9 100644 --- a/test/markup/python-repl/sample.expect.txt +++ b/test/markup/python-repl/sample.expect.txt @@ -11,7 +11,7 @@ foo = 42" >>> """ ... abc ... """ ->>> def test(): +>>> def test(): ... pass >>> >>> diff --git a/test/markup/python/function-header-comments.expect.txt b/test/markup/python/function-header-comments.expect.txt index b8530371f2..4ebe4aaad6 100644 --- a/test/markup/python/function-header-comments.expect.txt +++ b/test/markup/python/function-header-comments.expect.txt @@ -1,10 +1,10 @@ -def foo( +def foo( bar, # commment -): +): pass -class Foo(collections.namedtuple('Test'), ( +class Foo(collections.namedtuple('Test'), ( 'name', # comment -)): - pass \ No newline at end of file +)): + pass diff --git a/test/markup/python/function-header.expect.txt b/test/markup/python/function-header.expect.txt index cf3c8e5ef9..eb249617df 100644 --- a/test/markup/python/function-header.expect.txt +++ b/test/markup/python/function-header.expect.txt @@ -1,2 +1,2 @@ -def f(x: int) -> None: +def f(x: int) -> None: pass diff --git a/test/markup/python/matrix-multiplication.expect.txt b/test/markup/python/matrix-multiplication.expect.txt index 97323a195b..256895b24e 100644 --- a/test/markup/python/matrix-multiplication.expect.txt +++ b/test/markup/python/matrix-multiplication.expect.txt @@ -2,6 +2,6 @@ class C: @decorator - def f(self, H, V, beta, r): + def f(self, H, V, beta, r): S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r) return S From 4389bf2d2d778b00ac99946aa90c57820b79e581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= Date: Sun, 12 Apr 2020 01:41:39 +0200 Subject: [PATCH 054/816] (dev) Developer tool should use un-minified library --- test/browser/worker.js | 2 +- tools/developer.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/browser/worker.js b/test/browser/worker.js index ecec3e321f..e86be43216 100644 --- a/test/browser/worker.js +++ b/test/browser/worker.js @@ -2,7 +2,7 @@ const Worker = require('tiny-worker'); -const {newTestCase, defaultCase, findLibrary } = require('./test_case') +const { defaultCase, findLibrary } = require('./test_case') describe('web worker', function() { before(async function() { diff --git a/tools/developer.html b/tools/developer.html index 79e334540d..cef5f50fdb 100644 --- a/tools/developer.html +++ b/tools/developer.html @@ -68,7 +68,7 @@

highlight.js developer

- + + ``` @@ -85,7 +85,7 @@ addEventListener('load', () => { ```js onmessage = (event) => { - importScripts('/highlight.pack.js'); + importScripts('/highlight.min.js'); const result = self.hljs.highlightAuto(event.data); postMessage(result.value); }; @@ -107,7 +107,8 @@ Highlight.js можно использовать в браузере прямо вручную: ```html - + ``` **Про Almond.** Нужно задать имя модуля в оптимизаторе, например: From 51906fbb3a5a4eb6bb744412ce95aa0169f82836 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 21 Apr 2020 16:50:17 -0400 Subject: [PATCH 063/816] (docs) there is a single AUTHORS file now --- README.ru.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ru.md b/README.ru.md index d95e84e1b9..a448e217ed 100644 --- a/README.ru.md +++ b/README.ru.md @@ -131,7 +131,7 @@ Highlight.js распространяется под лицензией BSD. П Более подробная документация по API и другим темам расположена на . -Авторы и контрибьюторы перечислены в файле [AUTHORS.ru.txt][8] file. +Авторы и контрибьюторы перечислены в файле [AUTHORS.txt][8] file. [1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload [2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html @@ -140,4 +140,4 @@ Highlight.js распространяется под лицензией BSD. П [5]: https://highlightjs.org/download/ [6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html [7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE -[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.ru.txt +[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.txt From 2d90a5c49737d7b5cd6310c84c2721b23ee675e2 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 21 Apr 2020 17:00:23 -0400 Subject: [PATCH 064/816] (chore) workflows do not seem suited to OSS pull request style workflows --- .github/workflows/greetings.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index e390b60c28..0000000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Greetings - -on: [pull_request, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} -# issue-message: 'Message that will be displayed on users'' first issue' - pr-message: > - Thank you so much for your first contribution! It's appreciated. - One of our maintainers will review it as soon as they can. - - If you didn't modify `CHANGES.md` already, please go and do that now and push a second - commit. The `CHANGES.md` file is where we keep a running summary of changes so users - know what to expect when we issue periodic releases. - - Again, thanks. - - --- - - If by some chance you're just chomping at the bit to make a second PR we do have a "beginner friendly" tag: - https://github.com/highlightjs/highlight.js/labels/beginner%20friendly From 3875088aaedb8107492961b854701f48c89260b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Mert=20Y=C4=B1ld=C4=B1ran?= Date: Sat, 25 Apr 2020 06:32:24 +0300 Subject: [PATCH 065/816] (docs) Add Chaos to supported languages (#2510) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 7ffa8f7a23..8327f1cef8 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -40,6 +40,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | CSP | csp | | | CSS | css | | | Cap’n Proto | capnproto, capnp | | +| Chaos | chaos, kaos | [highlightjs-chaos](https://github.com/chaos-lang/highlightjs-chaos) | | Clojure | clojure, clj | | | CoffeeScript | coffeescript, coffee, cson, iced | | | CpcdosC+ | cpc | [highlightjs-cpcdos](https://github.com/SPinti-Software/highlightjs-cpcdos) | From f6813ccab84833be3b00d1438b2f11c18a67188d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sat, 25 Apr 2020 22:57:46 -0400 Subject: [PATCH 066/816] fix(parser) fixes sublanguage with no rule matches (#2506) * fix(parser) fixes sublanguage with no rule matches Resolves #2504. --- CHANGES.md | 9 +++++++ src/highlight.js | 24 ++++++++++++++----- .../xml/sublanguage_no_relevancy.expect.txt | 3 +++ test/markup/xml/sublanguage_no_relevancy.txt | 3 +++ 4 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 test/markup/xml/sublanguage_no_relevancy.expect.txt create mode 100644 test/markup/xml/sublanguage_no_relevancy.txt diff --git a/CHANGES.md b/CHANGES.md index 4f9602069c..a36b69e06f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +## Version 10.0.1 + +Parser Engine Changes: + +- (bug) Fix sublanguage with no relevance score (#2506) [Josh Goebel][] + +[Josh Goebel]: https://github.com/yyyc514 + + ## Version 10.0.0 New languages: diff --git a/src/highlight.js b/src/highlight.js index 9ce4bd97c3..526b509a30 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -443,6 +443,22 @@ const HLJS = function(hljs) { } } + // returns a valid highlight result, without actually + // doing any actual work, auto highlight starts with + // this and it's possible for small snippets that + // auto-detection may not find a better match + function justTextHighlightResult(code) { + const result = { + relevance: 0, + emitter: new options.__emitter(options), + value: escape(code), + illegal: false, + top: PLAINTEXT_LANGUAGE + }; + result.emitter.addText(code) + return result; + } + /* Highlighting with language detection. Accepts a string with the code to highlight. Returns an object with the following properties: @@ -456,11 +472,7 @@ const HLJS = function(hljs) { */ function highlightAuto(code, languageSubset) { languageSubset = languageSubset || options.languages || Object.keys(languages); - var result = { - relevance: 0, - emitter: new options.__emitter(options), - value: escape(code) - }; + var result = justTextHighlightResult(code) var second_best = result; languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) { var current = _highlight(name, code, false); @@ -589,7 +601,7 @@ const HLJS = function(hljs) { window.addEventListener('DOMContentLoaded', initHighlighting, false); } - var PLAINTEXT_LANGUAGE = { disableAutodetect: true }; + const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text' }; function registerLanguage(name, language) { var lang; diff --git a/test/markup/xml/sublanguage_no_relevancy.expect.txt b/test/markup/xml/sublanguage_no_relevancy.expect.txt new file mode 100644 index 0000000000..07a82d554a --- /dev/null +++ b/test/markup/xml/sublanguage_no_relevancy.expect.txt @@ -0,0 +1,3 @@ +<script>foo();</script> +<script>booger</script> +<script>hjk</script> diff --git a/test/markup/xml/sublanguage_no_relevancy.txt b/test/markup/xml/sublanguage_no_relevancy.txt new file mode 100644 index 0000000000..8bfae43974 --- /dev/null +++ b/test/markup/xml/sublanguage_no_relevancy.txt @@ -0,0 +1,3 @@ + + + From 705f49b8c371ef0317dcd58278a212185c44045b Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 26 Apr 2020 13:56:44 -0400 Subject: [PATCH 067/816] (chore) Add ESLint config and clean up the major stuff (#2503) * (chore) eslint:recommended * (chore): eslint_standard * relax eslint rules for language grammars (to discourage rewriting them in one fell swoop; I'd rather have the blame history intact) * remove extra escaping * clean up variables * more camelcase --- .eslintrc.js | 56 ++ .jshintrc | 4 +- package-lock.json | 1641 ++++++++++++++++++++++++++++++++++- package.json | 6 + src/highlight.js | 198 ++--- src/languages/ada.js | 2 +- src/languages/bnf.js | 2 +- src/languages/brainfuck.js | 2 +- src/languages/powershell.js | 2 +- src/lib/html_renderer.js | 14 +- src/lib/mode_compiler.js | 100 ++- src/lib/modes.js | 23 +- src/lib/regex.js | 6 +- src/lib/token_tree.js | 28 +- src/lib/utils.js | 16 +- 15 files changed, 1902 insertions(+), 198 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..b73d0a97db --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,56 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [ + "eslint:recommended", + "standard" + ], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + }, + "rules": { + "array-callback-return": "error", + "block-scoped-var": "error", + // we like our semi-colons + "semi": ["error","always"], + // our codebase doesn't do this at all, so disabled for now + "space-before-function-paren": ["error","never"], + // for now ignore diff between types of quoting + "quotes": "off", + // this is the style we are already using + "operator-linebreak": ["error","after", { "overrides": { "?": "after", ":": "after" } }], + // sometimes we declare variables with extra spacing + "indent": ["error", 2, {"VariableDeclarator":2}], + // seems like a good idea not to use explicit undefined + "no-undefined": "error", + + // TODO maybe + "camelcase": "off", // TODO: turn on later + "init-declarations": ["error","always"] + }, + "overrides": [ + { + "files": ["src/languages/*.js"], + "rules": { + "no-unused-expressions": "off", + // languages are all over the map and we don't want to + // do a mass edit so turn off the most egregious rule violations + "indent": "off", + "comma-dangle": "off", + "array-bracket-spacing": "off", + "object-curly-spacing": "off", + "key-spacing": "off", + "object-curly-newline": "off", + "object-property-newline": "off" + } + } + ] +}; diff --git a/.jshintrc b/.jshintrc index 05e63ed4e0..573812f43d 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,5 +1,7 @@ // whole codebase isn't ES8/9 yet, but our tests and some things are { "esversion": 9, - "node": true + "node": true, + // eslint warns us about semicolons + "-W033": false } diff --git a/package-lock.json b/package-lock.json index 97ff5ecb65..09fe06c654 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,32 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, "@nodelib/fs.scandir": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.1.tgz", @@ -30,6 +56,12 @@ "fastq": "^1.6.0" } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -95,6 +127,12 @@ } } }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, "acorn-walk": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", @@ -129,6 +167,23 @@ "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", "dev": true }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", @@ -163,18 +218,151 @@ "sprintf-js": "~1.0.2" } }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + } + } + }, "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + } + } + }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -251,6 +439,12 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -285,6 +479,12 @@ } } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "chokidar": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", @@ -327,6 +527,15 @@ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, "cli-table": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz", @@ -344,6 +553,12 @@ } } }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -435,12 +650,31 @@ "proto-list": "~1.2.1" } }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, "cssom": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", @@ -492,6 +726,15 @@ "whatwg-url": "^8.0.0" } }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -570,6 +813,15 @@ "path-type": "^4.0.0" } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "domexception": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", @@ -615,6 +867,15 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, + "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.13.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", @@ -659,18 +920,357 @@ "source-map": "~0.6.1" } }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "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 + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "eslint-config-standard": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz", + "integrity": "sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz", + "integrity": "sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "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" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.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" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "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" + }, + "dependencies": { + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + } + } + }, + "eslint-plugin-import": { + "version": "2.20.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz", + "integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==", + "dev": true, + "requires": { + "array-includes": "^3.0.3", + "array.prototype.flat": "^1.2.1", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.1", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.0", + "read-pkg-up": "^2.0.0", + "resolve": "^1.12.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": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "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", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "dev": true, + "requires": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "eslint-plugin-promise": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", + "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==", + "dev": true + }, + "eslint-plugin-standard": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.1.tgz", + "integrity": "sha512-v/KBnfyaOMPmZc/dmc6ozOdWqekGp7bBGq4jLAecEfPGmfKiWS4sA8sC0LqiV9w5qmXAtXVn4M3p1jSyhY85SQ==", + "dev": true + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, "esm": { "version": "3.2.25", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", "dev": true }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true + } + } + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", @@ -695,8 +1295,19 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "extsprintf": { - "version": "1.3.0", + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extsprintf": { + "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true @@ -787,6 +1398,24 @@ "reusify": "^1.0.0" } }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -822,6 +1451,34 @@ } } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -858,6 +1515,12 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -913,6 +1576,15 @@ "@types/glob": "*" } }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, "globby": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", @@ -929,6 +1601,12 @@ "slash": "^3.0.0" } }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -990,6 +1668,12 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "html-encoding-sniffer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.0.tgz", @@ -1025,6 +1709,22 @@ "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", "dev": true }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", @@ -1053,12 +1753,129 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "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 + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "ip-regex": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", "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 + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1119,6 +1936,12 @@ "integrity": "sha512-CKstxrctq1kUesU6WhtZDbYKzzYBuRH0UYInAVrkc/EYdB9ltbfE0gOoayG9nhohG6447sOOVGhHqsdmBvkbNg==", "dev": true }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, "is-reference": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", @@ -1145,6 +1968,12 @@ "has": "^1.0.1" } }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-symbol": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", @@ -1160,6 +1989,12 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1185,6 +2020,12 @@ "nopt": "~4.0.1" } }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -1259,6 +2100,12 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -1295,6 +2142,18 @@ "type-check": "~0.3.2" } }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -1366,6 +2225,12 @@ "mime-db": "~1.38.0" } }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -1461,12 +2326,30 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "neo-async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "node-environment-flags": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", @@ -1487,6 +2370,18 @@ "osenv": "^0.1.4" } }, + "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" + } + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1505,6 +2400,12 @@ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -1533,6 +2434,71 @@ "es-abstract": "^1.5.1" } }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + } + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1542,6 +2508,15 @@ "wrappy": "1" } }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -1629,6 +2604,24 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, "parse5": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", @@ -1647,6 +2640,12 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -1671,12 +2670,78 @@ "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", "dev": true }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "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", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", @@ -1707,6 +2772,83 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "dependencies": { + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + } + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.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.2.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", @@ -1716,6 +2858,12 @@ "picomatch": "^2.0.4" } }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", @@ -1776,6 +2924,31 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, + "resolve": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.16.1.tgz", + "integrity": "sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -1842,12 +3015,30 @@ "estree-walker": "^0.6.1" } }, + "run-async": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, "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 }, + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -1881,6 +3072,21 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, "should": { "version": "13.2.3", "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", @@ -1941,12 +3147,29 @@ "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", "dev": true }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1969,6 +3192,38 @@ "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", "dev": true }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "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.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -2025,6 +3280,260 @@ "strip-ansi": "^4.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + } + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + } + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + } + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + } + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -2034,6 +3543,18 @@ "ansi-regex": "^3.0.0" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", @@ -2049,6 +3570,64 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "terser": { "version": "4.3.9", "resolved": "https://registry.npmjs.org/terser/-/terser-4.3.9.tgz", @@ -2068,6 +3647,18 @@ } } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, "tiny-worker": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/tiny-worker/-/tiny-worker-2.3.0.tgz", @@ -2077,6 +3668,15 @@ "esm": "^3.2.25" } }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2113,6 +3713,12 @@ "punycode": "^2.1.1" } }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -2137,6 +3743,12 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "uglify-js": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.2.tgz", @@ -2172,6 +3784,22 @@ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "dev": true }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "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" + } + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -2322,6 +3950,15 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "ws": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz", diff --git a/package.json b/package.json index 8a0869a2ac..7fbded91ac 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,12 @@ "commander": "^5.0.0", "del": "^5.1.0", "dependency-resolver": "^2.0.1", + "eslint": "^6.8.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "glob": "^7.1.4", "glob-promise": "^3.4.0", "handlebars": "^4.5.3", diff --git a/src/highlight.js b/src/highlight.js index 526b509a30..f5a93a88de 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -15,24 +15,23 @@ const escape = utils.escapeHTML; const inherit = utils.inherit; const { nodeStream, mergeStreams } = utils; - +const NO_MATCH = Symbol("nomatch"); const HLJS = function(hljs) { - // Convenience variables for build-in objects var ArrayProto = []; // Global internal variables used within the highlight.js library. - var languages = {}, - aliases = {}, - plugins = []; + var languages = {}; + var aliases = {}; + var plugins = []; // safe/production mode - swallows more errors, tries to keep running // even if a single syntax or parse hits a fatal error var SAFE_MODE = true; // Regular expressions used throughout the highlight.js library. - var fixMarkupRe = /((^(<[^>]+>|\t|)+|(?:\n)))/gm; + var fixMarkupRe = /((^(<[^>]+>|\t|)+|(?:\n)))/gm; var LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?"; @@ -44,7 +43,7 @@ const HLJS = function(hljs) { classPrefix: 'hljs-', tabReplace: null, useBR: false, - languages: undefined, + languages: null, // beta configuration options, subject to change, welcome to discuss // https://github.com/highlightjs/highlight.js/issues/1086 __emitter: TokenTreeEmitter @@ -57,13 +56,12 @@ const HLJS = function(hljs) { } function blockLanguage(block) { - var match; var classes = block.className + ' '; classes += block.parentNode ? block.parentNode.className : ''; // language-* takes precedence over non-prefixed class names. - match = options.languageDetectRe.exec(classes); + const match = options.languageDetectRe.exec(classes); if (match) { var language = getLanguage(match[1]); if (!language) { @@ -83,7 +81,7 @@ const HLJS = function(hljs) { * * @param {string} languageName - the language to use for highlighting * @param {string} code - the code to highlight - * @param {boolean} ignore_illegals - whether to ignore illegal matches, default is to bail + * @param {boolean} ignoreIllegals - whether to ignore illegal matches, default is to bail * @param {array} continuation - array of continuation modes * * @returns an object that represents the result @@ -94,7 +92,7 @@ const HLJS = function(hljs) { * @property {mode} top - top of the current mode stack * @property {boolean} illegal - indicates whether any illegal matches were found */ - function highlight(languageName, code, ignore_illegals, continuation) { + function highlight(languageName, code, ignoreIllegals, continuation) { var context = { code, language: languageName @@ -107,7 +105,7 @@ const HLJS = function(hljs) { // in which case we don't even need to call highlight var result = context.result ? context.result : - _highlight(context.language, context.code, ignore_illegals, continuation); + _highlight(context.language, context.code, ignoreIllegals, continuation); result.code = context.code; // the plugin can change anything in result to suite it @@ -117,7 +115,7 @@ const HLJS = function(hljs) { } // private highlight that's used internally and does not fire callbacks - function _highlight(languageName, code, ignore_illegals, continuation) { + function _highlight(languageName, code, ignoreIllegals, continuation) { var codeToHighlight = code; function endOfMode(mode, lexeme) { @@ -132,34 +130,31 @@ const HLJS = function(hljs) { } } - function keywordMatch(mode, match) { - var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0]; - return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str]; + function keywordData(mode, match) { + var matchText = language.case_insensitive ? match[0].toLowerCase() : match[0]; + return Object.prototype.hasOwnProperty.call(mode.keywords, matchText) && mode.keywords[matchText]; } function processKeywords() { - var keyword_match, last_index, match, result, buf; - if (!top.keywords) { emitter.addText(mode_buffer); return; } - last_index = 0; + let last_index = 0; top.lexemesRe.lastIndex = 0; - match = top.lexemesRe.exec(mode_buffer); - buf = ""; + let match = top.lexemesRe.exec(mode_buffer); + let buf = ""; while (match) { buf += mode_buffer.substring(last_index, match.index); - keyword_match = keywordMatch(top, match); - var kind = null; - if (keyword_match) { + const data = keywordData(top, match); + if (data) { + const [kind, keywordRelevance] = data; emitter.addText(buf); buf = ""; - relevance += keyword_match[1]; - kind = keyword_match[0]; + relevance += keywordRelevance; emitter.addKeyword(match[0], kind); } else { buf += match[0]; @@ -182,8 +177,8 @@ const HLJS = function(hljs) { } var result = explicit ? - _highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : - highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); + _highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : + highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : null); // Counting embedded language score towards the host language may be disabled // with zeroing the containing mode relevance. Use case in point is Markdown that @@ -199,10 +194,11 @@ const HLJS = function(hljs) { } function processBuffer() { - if (top.subLanguage != null) + if (top.subLanguage != null) { processSubLanguage(); - else + } else { processKeywords(); + } mode_buffer = ''; } @@ -210,7 +206,7 @@ const HLJS = function(hljs) { if (mode.className) { emitter.openNode(mode.className); } - top = Object.create(mode, {parent: {value: top}}); + top = Object.create(mode, { parent: { value: top } }); } function doIgnore(lexeme) { @@ -232,13 +228,14 @@ const HLJS = function(hljs) { var new_mode = match.rule; if (new_mode.__onBegin) { - let res = new_mode.__onBegin(match) || {}; - if (res.ignoreMatch) + const res = new_mode.__onBegin(match) || {}; + if (res.ignoreMatch) { return doIgnore(lexeme); + } } if (new_mode && new_mode.endSameAsBegin) { - new_mode.endRe = regex.escape( lexeme ); + new_mode.endRe = regex.escape(lexeme); } if (new_mode.skip) { @@ -260,7 +257,7 @@ const HLJS = function(hljs) { var lexeme = match[0]; var matchPlusRemainder = codeToHighlight.substr(match.index); var end_mode = endOfMode(top, matchPlusRemainder); - if (!end_mode) { return; } + if (!end_mode) { return NO_MATCH; } var origin = top; if (origin.skip) { @@ -294,7 +291,7 @@ const HLJS = function(hljs) { function processContinuations() { var list = []; - for(var current = top; current !== language; current = current.parent) { + for (var current = top; current !== language; current = current.parent) { if (current.className) { list.unshift(current.className); } @@ -303,49 +300,46 @@ const HLJS = function(hljs) { } var lastMatch = {}; - function processLexeme(text_before_match, match) { - - var err; + function processLexeme(textBeforeMatch, match) { var lexeme = match && match[0]; // add non-matched text to the current mode buffer - mode_buffer += text_before_match; + mode_buffer += textBeforeMatch; if (lexeme == null) { processBuffer(); return 0; } - - // we've found a 0 width match and we're stuck, so we need to advance // this happens when we have badly behaved rules that have optional matchers to the degree that // sometimes they can end up matching nothing at all // Ref: https://github.com/highlightjs/highlight.js/issues/2140 - if (lastMatch.type=="begin" && match.type=="end" && lastMatch.index == match.index && lexeme === "") { + if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") { // spit the "skipped" character that our regex choked on back into the output sequence mode_buffer += codeToHighlight.slice(match.index, match.index + 1); if (!SAFE_MODE) { - err = new Error('0 width match regex'); + const err = new Error('0 width match regex'); err.languageName = languageName; err.badRule = lastMatch.rule; - throw(err); + throw err; } return 1; } lastMatch = match; - if (match.type==="begin") { + if (match.type === "begin") { return doBeginMatch(match); - } else if (match.type==="illegal" && !ignore_illegals) { + } else if (match.type === "illegal" && !ignoreIllegals) { // illegal match, we do not continue processing - err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); + const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); err.mode = top; throw err; - } else if (match.type==="end") { + } else if (match.type === "end") { var processed = doEndMatch(match); - if (processed != undefined) + if (processed !== NO_MATCH) { return processed; + } } /* @@ -371,20 +365,20 @@ const HLJS = function(hljs) { } compileLanguage(language); + var result = ''; var top = continuation || language; var continuations = {}; // keep continuations for sub-languages - var result; var emitter = new options.__emitter(options); processContinuations(); var mode_buffer = ''; var relevance = 0; - var match, processedCount, index = 0; + var index = 0; + var continueScanAtSamePosition = false; try { - var continueScanAtSamePosition = false; top.matcher.considerAll(); - while (true) { + for (;;) { if (continueScanAtSamePosition) { continueScanAtSamePosition = false; // only regexes not matched previously will now be @@ -393,12 +387,12 @@ const HLJS = function(hljs) { top.matcher.lastIndex = index; top.matcher.considerAll(); } - match = top.matcher.exec(codeToHighlight); + const match = top.matcher.exec(codeToHighlight); // console.log("match", match[0], match.rule && match.rule.begin) - if (!match) - break; - let beforeMatch = codeToHighlight.substring(index, match.index); - processedCount = processLexeme(beforeMatch, match); + if (!match) break; + + const beforeMatch = codeToHighlight.substring(index, match.index); + const processedCount = processLexeme(beforeMatch, match); index = match.index + processedCount; } processLexeme(codeToHighlight.substr(index)); @@ -420,13 +414,13 @@ const HLJS = function(hljs) { illegal: true, illegalBy: { msg: err.message, - context: codeToHighlight.slice(index-100,index+100), + context: codeToHighlight.slice(index - 100, index + 100), mode: err.mode }, sofar: result, relevance: 0, value: escape(codeToHighlight), - emitter: emitter, + emitter: emitter }; } else if (SAFE_MODE) { return { @@ -473,20 +467,21 @@ const HLJS = function(hljs) { function highlightAuto(code, languageSubset) { languageSubset = languageSubset || options.languages || Object.keys(languages); var result = justTextHighlightResult(code) - var second_best = result; + var secondBest = result; languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) { var current = _highlight(name, code, false); current.language = name; - if (current.relevance > second_best.relevance) { - second_best = current; + if (current.relevance > secondBest.relevance) { + secondBest = current; } if (current.relevance > result.relevance) { - second_best = result; + secondBest = result; result = current; } }); - if (second_best.language) { - result.second_best = second_best; + if (secondBest.language) { + // second_best (with underscore) is the expected API + result.second_best = secondBest; } return result; } @@ -504,18 +499,18 @@ const HLJS = function(hljs) { } return value.replace(fixMarkupRe, function(match, p1) { - if (options.useBR && match === '\n') { - return '
'; - } else if (options.tabReplace) { - return p1.replace(/\t/g, options.tabReplace); - } - return ''; + if (options.useBR && match === '\n') { + return '
'; + } else if (options.tabReplace) { + return p1.replace(/\t/g, options.tabReplace); + } + return ''; }); } function buildClassName(prevClassName, currentLang, resultLang) { - var language = currentLang ? aliases[currentLang] : resultLang, - result = [prevClassName.trim()]; + var language = currentLang ? aliases[currentLang] : resultLang; + var result = [prevClassName.trim()]; if (!prevClassName.match(/\bhljs\b/)) { result.push('hljs'); @@ -533,33 +528,32 @@ const HLJS = function(hljs) { two optional parameters for fixMarkup. */ function highlightBlock(block) { - var node, originalStream, result, resultNode, text; - var language = blockLanguage(block); + let node = null; + const language = blockLanguage(block); - if (shouldNotHighlight(language)) - return; + if (shouldNotHighlight(language)) return; fire("before:highlightBlock", - { block: block, language: language}); + { block: block, language: language }); if (options.useBR) { node = document.createElement('div'); - node.innerHTML = block.innerHTML.replace(/\n/g, '').replace(//g, '\n'); + node.innerHTML = block.innerHTML.replace(/\n/g, '').replace(//g, '\n'); } else { node = block; } - text = node.textContent; - result = language ? highlight(language, text, true) : highlightAuto(text); + const text = node.textContent; + const result = language ? highlight(language, text, true) : highlightAuto(text); - originalStream = nodeStream(node); + const originalStream = nodeStream(node); if (originalStream.length) { - resultNode = document.createElement('div'); + const resultNode = document.createElement('div'); resultNode.innerHTML = result.value; result.value = mergeStreams(originalStream, nodeStream(resultNode), text); } result.value = fixMarkup(result.value); - fire("after:highlightBlock", { block: block, result: result}); + fire("after:highlightBlock", { block: block, result: result }); block.innerHTML = result.value; block.className = buildClassName(block.className, language, result.language); @@ -578,16 +572,15 @@ const HLJS = function(hljs) { /* Updates highlight.js global options with values passed in the form of an object. */ - function configure(user_options) { - options = inherit(options, user_options); + function configure(userOptions) { + options = inherit(options, userOptions); } /* Applies highlighting to all
..
blocks on a page. */ function initHighlighting() { - if (initHighlighting.called) - return; + if (initHighlighting.called) return; initHighlighting.called = true; var blocks = document.querySelectorAll('pre code'); @@ -604,9 +597,10 @@ const HLJS = function(hljs) { const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text' }; function registerLanguage(name, language) { - var lang; - try { lang = language(hljs); } - catch (error) { + var lang = null; + try { + lang = language(hljs); + } catch (error) { console.error("Language definition for '{}' could not be registered.".replace("{}", name)); // hard or soft error if (!SAFE_MODE) { throw error; } else { console.error(error); } @@ -617,13 +611,12 @@ const HLJS = function(hljs) { lang = PLAINTEXT_LANGUAGE; } // give it a temporary name if it doesn't have one in the meta-data - if (!lang.name) - lang.name = name; + if (!lang.name) lang.name = name; languages[name] = lang; - lang.rawDefinition = language.bind(null,hljs); + lang.rawDefinition = language.bind(null, hljs); if (lang.aliases) { - lang.aliases.forEach(function(alias) {aliases[alias] = name;}); + lang.aliases.forEach(function(alias) { aliases[alias] = name; }); } } @@ -641,7 +634,7 @@ const HLJS = function(hljs) { var lang = getLanguage(name); if (lang) { return lang; } - var err = new Error('The \'{}\' language is required, but not loaded.'.replace('{}',name)); + var err = new Error('The \'{}\' language is required, but not loaded.'.replace('{}', name)); throw err; } @@ -655,13 +648,13 @@ const HLJS = function(hljs) { return lang && !lang.disableAutodetect; } - function addPlugin(plugin, options) { + function addPlugin(plugin) { plugins.push(plugin); } function fire(event, args) { var cb = event; - plugins.forEach(function (plugin) { + plugins.forEach(function(plugin) { if (plugin[cb]) { plugin[cb](args); } @@ -670,7 +663,7 @@ const HLJS = function(hljs) { /* Interface definition */ - Object.assign(hljs,{ + Object.assign(hljs, { highlight, highlightAuto, fixMarkup, @@ -692,8 +685,9 @@ const HLJS = function(hljs) { hljs.versionString = packageJSON.version; for (const key in MODES) { - if (typeof MODES[key] === "object") + if (typeof MODES[key] === "object") { deepFreeze(MODES[key]); + } } // merge all the modes/regexs into our main object diff --git a/src/languages/ada.js b/src/languages/ada.js index f7757c47c5..64a96f6176 100644 --- a/src/languages/ada.js +++ b/src/languages/ada.js @@ -36,7 +36,7 @@ export default function(hljs) { var ID_REGEX = '[A-Za-z](_?[A-Za-z0-9.])*'; // bad chars, only allowed in literals - var BAD_CHARS = '[]{}%#\'\"' + var BAD_CHARS = `[]{}%#'"`; // Ada doesn't have block comments, only line comments var COMMENTS = hljs.COMMENT('--', '$'); diff --git a/src/languages/bnf.js b/src/languages/bnf.js index 2f9fca8660..6c83904089 100644 --- a/src/languages/bnf.js +++ b/src/languages/bnf.js @@ -4,7 +4,7 @@ Website: https://en.wikipedia.org/wiki/Backus–Naur_form Author: Oleg Efimov */ -export default function(hljs){ +export default function(hljs) { return { name: 'Backus–Naur Form', contains: [ diff --git a/src/languages/brainfuck.js b/src/languages/brainfuck.js index 2a9bb07b6d..e5d813142b 100644 --- a/src/languages/brainfuck.js +++ b/src/languages/brainfuck.js @@ -4,7 +4,7 @@ Author: Evgeny Stepanischev Website: https://esolangs.org/wiki/Brainfuck */ -export default function(hljs){ +export default function(hljs) { var LITERAL = { className: 'literal', begin: '[\\+\\-]', diff --git a/src/languages/powershell.js b/src/languages/powershell.js index d0ffa2cace..0a56e1adcf 100644 --- a/src/languages/powershell.js +++ b/src/languages/powershell.js @@ -6,7 +6,7 @@ Contributors: Nicholas Blumhardt , Victor Zhou { return !!node.kind; -} +}; export default class HTMLRenderer { constructor(tree, options) { @@ -16,15 +15,16 @@ export default class HTMLRenderer { // renderer API addText(text) { - this.buffer += escapeHTML(text) + this.buffer += escapeHTML(text); } openNode(node) { if (!emitsWrappingTags(node)) return; let className = node.kind; - if (!node.sublanguage) + if (!node.sublanguage) { className = `${this.classPrefix}${className}`; + } this.span(className); } @@ -37,7 +37,7 @@ export default class HTMLRenderer { // helpers span(className) { - this.buffer += `` + this.buffer += ``; } value() { diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index 10fd000483..9faf220258 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -48,18 +48,19 @@ export function compileLanguage(language) { // avoids the need to check length every time exec is called this.exec = () => null; } - let terminators = this.regexes.map(el => el[1]); + const terminators = this.regexes.map(el => el[1]); this.matcherRe = langRe(regex.join(terminators, '|'), true); this.lastIndex = 0; } exec(s) { this.matcherRe.lastIndex = this.lastIndex; - let match = this.matcherRe.exec(s); + const match = this.matcherRe.exec(s); if (!match) { return null; } - let i = match.findIndex((el, i) => i>0 && el!=undefined); - let matchData = this.matchIndexes[i]; + // eslint-disable-next-line no-undefined + const i = match.findIndex((el, i) => i > 0 && el !== undefined); + const matchData = this.matchIndexes[i]; return Object.assign(match, matchData); } @@ -109,8 +110,8 @@ export function compileLanguage(language) { getMatcher(index) { if (this.multiRegexes[index]) return this.multiRegexes[index]; - let matcher = new MultiRegex(); - this.rules.slice(index).forEach(([re, opts])=> matcher.addRule(re,opts)) + const matcher = new MultiRegex(); + this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts)); matcher.compile(); this.multiRegexes[index] = matcher; return matcher; @@ -122,17 +123,18 @@ export function compileLanguage(language) { addRule(re, opts) { this.rules.push([re, opts]); - if (opts.type==="begin") this.count++; + if (opts.type === "begin") this.count++; } exec(s) { - let m = this.getMatcher(this.regexIndex); + const m = this.getMatcher(this.regexIndex); m.lastIndex = this.lastIndex; - let result = m.exec(s); + const result = m.exec(s); if (result) { this.regexIndex += result.position + 1; - if (this.regexIndex === this.count) // wrap-around + if (this.regexIndex === this.count) { // wrap-around this.regexIndex = 0; + } } // this.regexIndex = 0; @@ -141,25 +143,26 @@ export function compileLanguage(language) { } function buildModeRegex(mode) { + const mm = new ResumableMultiRegex(); - let mm = new ResumableMultiRegex(); + mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: "begin" })); - mode.contains.forEach(term => mm.addRule(term.begin, {rule: term, type: "begin" })) - - if (mode.terminator_end) - mm.addRule(mode.terminator_end, {type: "end"} ); - if (mode.illegal) - mm.addRule(mode.illegal, {type: "illegal"} ); + if (mode.terminator_end) { + mm.addRule(mode.terminator_end, { type: "end" }); + } + if (mode.illegal) { + mm.addRule(mode.illegal, { type: "illegal" }); + } return mm; } // TODO: We need negative look-behind support to do this properly function skipIfhasPrecedingOrTrailingDot(match) { - let before = match.input[match.index-1]; - let after = match.input[match.index + match[0].length]; + const before = match.input[match.index - 1]; + const after = match.input[match.index + match[0].length]; if (before === "." || after === ".") { - return {ignoreMatch: true }; + return { ignoreMatch: true }; } } @@ -194,16 +197,16 @@ export function compileLanguage(language) { */ function compileMode(mode, parent) { - if (mode.compiled) - return; + if (mode.compiled) return; mode.compiled = true; // __onBegin is considered private API, internal use only mode.__onBegin = null; mode.keywords = mode.keywords || mode.beginKeywords; - if (mode.keywords) + if (mode.keywords) { mode.keywords = compileKeywords(mode.keywords, language.case_insensitive); + } mode.lexemesRe = langRe(mode.lexemes || /\w+/, true); @@ -240,7 +243,7 @@ export function compileLanguage(language) { mode.contains = [].concat(...mode.contains.map(function(c) { return expand_or_clone_mode(c === 'self' ? mode : c); })); - mode.contains.forEach(function(c) {compileMode(c, mode);}); + mode.contains.forEach(function(c) { compileMode(c, mode); }); if (mode.starts) { compileMode(mode.starts, parent); @@ -251,7 +254,7 @@ export function compileLanguage(language) { // self is not valid at the top-level if (language.contains && language.contains.includes('self')) { - throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") + throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation."); } compileMode(language); } @@ -265,31 +268,33 @@ function dependencyOnParent(mode) { function expand_or_clone_mode(mode) { if (mode.variants && !mode.cached_variants) { mode.cached_variants = mode.variants.map(function(variant) { - return inherit(mode, {variants: null}, variant); + return inherit(mode, { variants: null }, variant); }); } // EXPAND // if we have variants then essentially "replace" the mode with the variants // this happens in compileMode, where this function is called from - if (mode.cached_variants) + if (mode.cached_variants) { return mode.cached_variants; + } // CLONE // if we have dependencies on parents then we need a unique // instance of ourselves, so we can be reused with many // different parents without issue - if (dependencyOnParent(mode)) + if (dependencyOnParent(mode)) { return inherit(mode, { starts: mode.starts ? inherit(mode.starts) : null }); + } - if (Object.isFrozen(mode)) + if (Object.isFrozen(mode)) { return inherit(mode); + } // no special dependency issues, just return ourselves return mode; } - // keywords function compileKeywords(rawKeywords, case_insensitive) { @@ -298,34 +303,35 @@ function compileKeywords(rawKeywords, case_insensitive) { if (typeof rawKeywords === 'string') { // string splitAndCompile('keyword', rawKeywords); } else { - Object.keys(rawKeywords).forEach(function (className) { + Object.keys(rawKeywords).forEach(function(className) { splitAndCompile(className, rawKeywords[className]); }); } -return compiled_keywords; + return compiled_keywords; -// --- + // --- -function splitAndCompile(className, str) { - if (case_insensitive) { - str = str.toLowerCase(); + function splitAndCompile(className, str) { + if (case_insensitive) { + str = str.toLowerCase(); + } + str.split(' ').forEach(function(keyword) { + var pair = keyword.split('|'); + compiled_keywords[pair[0]] = [className, scoreForKeyword(pair[0], pair[1])]; + }); } - str.split(' ').forEach(function(keyword) { - var pair = keyword.split('|'); - compiled_keywords[pair[0]] = [className, scoreForKeyword(pair[0], pair[1])]; - }); -} } function scoreForKeyword(keyword, providedScore) { -// manual scores always win over common keywords -// so you can force a score of 1 if you really insist -if (providedScore) - return Number(providedScore); + // manual scores always win over common keywords + // so you can force a score of 1 if you really insist + if (providedScore) { + return Number(providedScore); + } -return commonKeyword(keyword) ? 0 : 1; + return commonKeyword(keyword) ? 0 : 1; } function commonKeyword(word) { -return COMMON_KEYWORDS.includes(word.toLowerCase()); + return COMMON_KEYWORDS.includes(word.toLowerCase()); } diff --git a/src/lib/modes.js b/src/lib/modes.js index 4e153791d1..f91811ee17 100644 --- a/src/lib/modes.js +++ b/src/lib/modes.js @@ -1,4 +1,4 @@ -import {inherit} from './utils'; +import { inherit } from './utils'; // Common regexps export const IDENT_RE = '[a-zA-Z]\\w*'; @@ -14,24 +14,27 @@ export const BACKSLASH_ESCAPE = { }; export const APOS_STRING_MODE = { className: 'string', - begin: '\'', end: '\'', + begin: '\'', + end: '\'', illegal: '\\n', contains: [BACKSLASH_ESCAPE] }; export const QUOTE_STRING_MODE = { className: 'string', - begin: '"', end: '"', + begin: '"', + end: '"', illegal: '\\n', contains: [BACKSLASH_ESCAPE] }; export const PHRASAL_WORDS_MODE = { 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|they|like|more)\b/ }; -export const COMMENT = function (begin, end, inherits) { +export const COMMENT = function(begin, end, inherits) { var mode = inherit( { className: 'comment', - begin: begin, end: end, + begin: begin, + end: end, contains: [] }, inherits || {} @@ -65,7 +68,7 @@ export const BINARY_NUMBER_MODE = { export const CSS_NUMBER_MODE = { className: 'number', begin: NUMBER_RE + '(' + - '%|em|ex|ch|rem' + + '%|em|ex|ch|rem' + '|vw|vh|vmin|vmax' + '|cm|mm|in|pt|pc|px' + '|deg|grad|rad|turn' + @@ -82,15 +85,17 @@ export const REGEXP_MODE = { // 3 / something // // (which will then blow up when regex's `illegal` sees the newline) - begin: /(?=\/[^\/\n]*\/)/, + begin: /(?=\/[^/\n]*\/)/, contains: [{ className: 'regexp', - begin: /\//, end: /\/[gimuy]*/, + begin: /\//, + end: /\/[gimuy]*/, illegal: /\n/, contains: [ BACKSLASH_ESCAPE, { - begin: /\[/, end: /\]/, + begin: /\[/, + end: /\]/, relevance: 0, contains: [BACKSLASH_ESCAPE] } diff --git a/src/lib/regex.js b/src/lib/regex.js index a0e156de39..c349485eaf 100644 --- a/src/lib/regex.js +++ b/src/lib/regex.js @@ -1,5 +1,5 @@ export function escape(value) { - return new RegExp(value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm'); + return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm'); } export function source(re) { @@ -49,12 +49,12 @@ export function join(regexps, separator) { } ret += re.substring(0, match.index); re = re.substring(match.index + match[0].length); - if (match[0][0] == '\\' && match[1]) { + if (match[0][0] === '\\' && match[1]) { // Adjust the backreference. ret += '\\' + String(Number(match[1]) + offset); } else { ret += match[0]; - if (match[0] == '(') { + if (match[0] === '(') { numCaptures++; } } diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js index 8e5df9c313..f3f851f29e 100644 --- a/src/lib/token_tree.js +++ b/src/lib/token_tree.js @@ -3,28 +3,29 @@ import HTMLRenderer from './html_renderer'; class TokenTree { constructor() { this.rootNode = { children: [] }; - this.stack = [ this.rootNode ]; + this.stack = [this.rootNode]; } get top() { return this.stack[this.stack.length - 1]; } - get root() { return this.rootNode }; + get root() { return this.rootNode; } add(node) { this.top.children.push(node); } openNode(kind) { - let node = { kind, children: [] }; + const node = { kind, children: [] }; this.add(node); this.stack.push(node); } closeNode() { - if (this.stack.length > 1) + if (this.stack.length > 1) { return this.stack.pop(); + } } closeAllNodes() { @@ -44,7 +45,7 @@ class TokenTree { builder.addText(node); } else if (node.children) { builder.openNode(node); - node.children.forEach((child) => this._walk(builder, child)) + node.children.forEach((child) => this._walk(builder, child)); builder.closeNode(node); } return builder; @@ -55,13 +56,13 @@ class TokenTree { return; } if (node.children.every(el => typeof el === "string")) { - node.text = node.children.join("") - delete node["children"] + node.text = node.children.join(""); + delete node.children; } else { node.children.forEach((child) => { if (typeof child === "string") return; - TokenTree._collapse(child) - }) + TokenTree._collapse(child); + }); } } } @@ -74,7 +75,7 @@ class TokenTree { - addKeyword(text, kind) - addText(text) - - addSublanguage(emitter, subLangaugeName) + - addSublanguage(emitter, subLanguageName) - finalize() - openNode(kind) - closeNode() @@ -103,19 +104,18 @@ export default class TokenTreeEmitter extends TokenTree { } addSublanguage(emitter, name) { - let node = emitter.root; + const node = emitter.root; node.kind = name; node.sublanguage = true; this.add(node); } toHTML() { - let renderer = new HTMLRenderer(this, this.options); + const renderer = new HTMLRenderer(this, this.options); return renderer.value(); } finalize() { - return; + return true; } - } diff --git a/src/lib/utils.js b/src/lib/utils.js index aa0813660b..c07128de10 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -2,42 +2,40 @@ export function escapeHTML(value) { return value.replace(/&/g, '&').replace(//g, '>'); } - /** * performs a shallow merge of multiple objects into one * * @arguments list of objects with properties to merge * @returns a single new object */ -export function inherit(parent) { // inherit(parent, override_obj, override_obj, ...) - var key; +export function inherit(parent) { // inherit(parent, override_obj, override_obj, ...) var result = {}; var objects = Array.prototype.slice.call(arguments, 1); - for (key in parent) + for (const key in parent) { result[key] = parent[key]; + } objects.forEach(function(obj) { - for (key in obj) + for (const key in obj) { result[key] = obj[key]; + } }); return result; } /* Stream merging */ - function tag(node) { return node.nodeName.toLowerCase(); } - export function nodeStream(node) { var result = []; (function _nodeStream(node, offset) { for (var child = node.firstChild; child; child = child.nextSibling) { - if (child.nodeType === 3) + if (child.nodeType === 3) { offset += child.nodeValue.length; - else if (child.nodeType === 1) { + } else if (child.nodeType === 1) { result.push({ event: 'start', offset: offset, From f86d6a9d41171dfa518de30c902f6931ff9100e5 Mon Sep 17 00:00:00 2001 From: Hugo Leblanc Date: Mon, 27 Apr 2020 01:13:40 -0400 Subject: [PATCH 068/816] (docs) Add Visual Basic for Applications (VBA) to supported languages (#2512) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 8327f1cef8..ed91834344 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -183,6 +183,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Twig | twig, craftcms | | | TypeScript | typescript, ts | | | VB.Net | vbnet, vb | | +| VBA | vba | [highlightjs-vba](https://github.com/dullin/highlightjs-vba) | | VBScript | vbscript, vbs | | | VHDL | vhdl | | | Vala | vala | | From 7502e420ac2edbef746dd8cac0052eb7f0f984ae Mon Sep 17 00:00:00 2001 From: Peter Massey-Plantinga Date: Mon, 27 Apr 2020 01:20:22 -0400 Subject: [PATCH 069/816] (yaml) improve tag support; add verbatim tags (#2487) * YAML parse non-word characters as part of tags * adds support for verbatim tags Co-authored-by: Josh Goebel --- CHANGES.md | 9 +++++++++ src/languages/yaml.js | 20 ++++++++++++++++---- test/markup/yaml/tag.expect.txt | 8 ++++++++ test/markup/yaml/tag.txt | 8 ++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a36b69e06f..f77c7baadb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +## Version 10.1.0 (in progress) + +Language improvements: + +- fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][] + +[Peter Plantinga]: https://github.com/pplantinga + + ## Version 10.0.1 Parser Engine Changes: diff --git a/src/languages/yaml.js b/src/languages/yaml.js index d7586eb1f3..4fc4ba0a28 100644 --- a/src/languages/yaml.js +++ b/src/languages/yaml.js @@ -10,6 +10,9 @@ Category: common, config export default function(hljs) { var LITERALS = 'true false yes no null'; + // YAML spec allows non-reserved URI characters in tags. + var URI_CHARACTERS = '[\\w#;/?:@&=+$,.~*\\\'()[\\]]+' + // Define keys as starting with a word character // ...containing word chars, spaces, colons, forward-slashes, hyphens and periods // ...and ending with a colon followed immediately by a space, tab or newline. @@ -79,13 +82,22 @@ export default function(hljs) { excludeEnd: true, relevance: 0 }, - { // local tags + { // named tags + className: 'type', + begin: '!\\w+!' + URI_CHARACTERS, + }, + // https://yaml.org/spec/1.2/spec.html#id2784064 + { // verbatim tags + className: 'type', + begin: '!<' + URI_CHARACTERS + ">", + }, + { // primary tags className: 'type', - begin: '!' + hljs.UNDERSCORE_IDENT_RE, + begin: '!' + URI_CHARACTERS, }, - { // data type + { // secondary tags className: 'type', - begin: '!!' + hljs.UNDERSCORE_IDENT_RE, + begin: '!!' + URI_CHARACTERS, }, { // fragment id &ref className: 'meta', diff --git a/test/markup/yaml/tag.expect.txt b/test/markup/yaml/tag.expect.txt index dbc5645dcd..87168452e3 100644 --- a/test/markup/yaml/tag.expect.txt +++ b/test/markup/yaml/tag.expect.txt @@ -2,3 +2,11 @@ key: !localtagname test key: "!notatag" key: '!!notatageither' +key: !!python/dict test +key: !!python/name:module.name test +key: !foo2.bar test +key: !(foo.bar?):tag test +key: !named!tag test + +--- !<tag:clarkevans.com,2002:invoice> +invoice: 34843 diff --git a/test/markup/yaml/tag.txt b/test/markup/yaml/tag.txt index 35f361543d..20ee84a731 100644 --- a/test/markup/yaml/tag.txt +++ b/test/markup/yaml/tag.txt @@ -2,3 +2,11 @@ key: !!builtintagname test key: !localtagname test key: "!notatag" key: '!!notatageither' +key: !!python/dict test +key: !!python/name:module.name test +key: !foo2.bar test +key: !(foo.bar?):tag test +key: !named!tag test + +--- ! +invoice: 34843 From 0afd0d3f914a7d548afcc0b3696a4cad9a0a9166 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 27 Apr 2020 01:31:53 -0400 Subject: [PATCH 070/816] fix(javascript/typescript): lambda with parens in parameters fails (#2502) * fix(javascript/typescript): lambda with parens in parameters fails - Fixes both JavaScript and TypeScript grammars Fixes samples like: const bad = ((a, b) => [...a, b]); sides.every((length,width=(3+2+(4/5))) => length > 0 ); This is done by counting parens in the regex that finds arrows functions. Currently we can only handle 2 levels of nesting as shown in the second example above. * allow much richer highlighting inside params * improve highlighting inside arguments on typescript --- CHANGES.md | 5 +- src/languages/javascript.js | 18 ++++- src/languages/typescript.js | 77 ++++++++++--------- .../javascript/arrow-function.expect.txt | 11 ++- test/markup/javascript/arrow-function.txt | 10 +++ test/markup/javascript/jsx.expect.txt | 4 +- test/markup/typescript/functions.expect.txt | 10 +++ test/markup/typescript/functions.txt | 11 +++ 8 files changed, 102 insertions(+), 44 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f77c7baadb..9c7eda553b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,9 +1,12 @@ ## Version 10.1.0 (in progress) -Language improvements: +Language Improvements: +- fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] +- fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] - fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][] +[Josh Goebel]: https://github.com/yyyc514 [Peter Plantinga]: https://github.com/pplantinga diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 9636f508da..0ad9b3f18f 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -90,6 +90,10 @@ export default function(hljs) { hljs.REGEXP_MODE ]; var PARAMS_CONTAINS = SUBST.contains.concat([ + // eat recursive parens in sub expressions + { begin: /\(/, end: /\)/, + contains: ["self"].concat(SUBST.contains, [hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE]) + }, hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE ]); @@ -175,17 +179,27 @@ export default function(hljs) { hljs.REGEXP_MODE, { className: 'function', - begin: '(\\(.*?\\)|' + IDENT_RE + ')\\s*=>', returnBegin: true, + // we have to count the parens to make sure we actually have the + // correct bounding ( ) before the =>. There could be any number of + // sub-expressions inside also surrounded by parens. + begin: '(\\([^(]*' + + '(\\([^(]*' + + '(\\([^(]*' + + '\\))?' + + '\\))?' + + '\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\s*=>', returnBegin: true, end: '\\s*=>', contains: [ { className: 'params', variants: [ { - begin: IDENT_RE + begin: hljs.UNDERSCORE_IDENT_RE }, { + className: null, begin: /\(\s*\)/, + skip: true }, { begin: /\(/, end: /\)/, diff --git a/src/languages/typescript.js b/src/languages/typescript.js index 23d3fb34a4..9266b55e6b 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -27,38 +27,10 @@ export default function(hljs) { 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' + 'module console window document any number boolean string void Promise' }; - var DECORATOR = { className: 'meta', begin: '@' + JS_IDENT_RE, }; - - var ARGS = - { - begin: '\\(', - end: /\)/, - keywords: KEYWORDS, - contains: [ - 'self', - hljs.QUOTE_STRING_MODE, - hljs.APOS_STRING_MODE, - hljs.NUMBER_MODE - ] - }; - - var PARAMS = { - className: 'params', - begin: /\(/, end: /\)/, - excludeBegin: true, - excludeEnd: true, - keywords: KEYWORDS, - contains: [ - hljs.C_LINE_COMMENT_MODE, - hljs.C_BLOCK_COMMENT_MODE, - DECORATOR, - ARGS - ] - }; var NUMBER = { className: 'number', variants: [ @@ -113,8 +85,31 @@ export default function(hljs) { NUMBER, hljs.REGEXP_MODE ]; - - + var ARGUMENTS = + { + begin: '\\(', + end: /\)/, + keywords: KEYWORDS, + contains: [ + 'self', + hljs.QUOTE_STRING_MODE, + hljs.APOS_STRING_MODE, + hljs.NUMBER_MODE + ] + }; + var PARAMS = { + className: 'params', + begin: /\(/, end: /\)/, + excludeBegin: true, + excludeEnd: true, + keywords: KEYWORDS, + contains: [ + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE, + DECORATOR, + ARGUMENTS + ] + }; return { name: 'TypeScript', @@ -142,27 +137,33 @@ export default function(hljs) { hljs.REGEXP_MODE, { className: 'function', - begin: '(\\(.*?\\)|' + hljs.IDENT_RE + ')\\s*=>', returnBegin: true, + // we have to count the parens to make sure we actually have the + // correct bounding ( ) before the =>. There could be any number of + // sub-expressions inside also surrounded by parens. + begin: '(\\([^(]*' + + '(\\([^(]*' + + '(\\([^(]*' + + '\\))?' + + '\\))?' + + '\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\s*=>', returnBegin: true, end: '\\s*=>', contains: [ { className: 'params', variants: [ { - begin: hljs.IDENT_RE + begin: hljs.UNDERSCORE_IDENT_RE }, { + className: null, begin: /\(\s*\)/, + skip: true }, { begin: /\(/, end: /\)/, excludeBegin: true, excludeEnd: true, keywords: KEYWORDS, - contains: [ - 'self', - hljs.C_LINE_COMMENT_MODE, - hljs.C_BLOCK_COMMENT_MODE - ] + contains: ARGUMENTS.contains } ] } @@ -209,7 +210,7 @@ export default function(hljs) { begin: '\\.' + hljs.IDENT_RE, relevance: 0 // hack: prevents detection of keywords after dots }, DECORATOR, - ARGS + ARGUMENTS ] }; } diff --git a/test/markup/javascript/arrow-function.expect.txt b/test/markup/javascript/arrow-function.expect.txt index c7b648e5bc..9683eb3982 100644 --- a/test/markup/javascript/arrow-function.expect.txt +++ b/test/markup/javascript/arrow-function.expect.txt @@ -1,4 +1,13 @@ var f = x => x; f(x => x + (y=2, z=undefined, ...rest) => y); -() => null; +() => null; const FC = props => <p>functional component</p>; + +const good = () => 0; +const good = (x) => 0; +const bad = (a => [...a, b]); +const bad = (_ => doSomething()); +const bad = (() => 0); +const bad = ((a, b) => [...a, b]); +const array = [1, 2, 3].reduce((acc, next) => [...acc, next], []); +sides.every((length,width=(3+2+(4/5))) => length > 0 ); diff --git a/test/markup/javascript/arrow-function.txt b/test/markup/javascript/arrow-function.txt index 4e49e3405f..607c18eb51 100644 --- a/test/markup/javascript/arrow-function.txt +++ b/test/markup/javascript/arrow-function.txt @@ -2,3 +2,13 @@ var f = x => x; f(x => x + (y=2, z=undefined, ...rest) => y); () => null; const FC = props =>

functional component

; + +const good = () => 0; +const good = (x) => 0; +const bad = (a => [...a, b]); +const bad = (_ => doSomething()); +const bad = (() => 0); +const bad = ((a, b) => [...a, b]); +const array = [1, 2, 3].reduce((acc, next) => [...acc, next], []); +sides.every((length,width=(3+2+(4/5))) => length > 0 ); + diff --git a/test/markup/javascript/jsx.expect.txt b/test/markup/javascript/jsx.expect.txt index a000fe75a7..0f17aa4dd0 100644 --- a/test/markup/javascript/jsx.expect.txt +++ b/test/markup/javascript/jsx.expect.txt @@ -8,8 +8,8 @@ return (<node attr="value"></node>); -const n = () => <X /> -const m = () => <X x="" /> +const n = () => <X /> +const m = () => <X x="" /> class App extends Component { render() { diff --git a/test/markup/typescript/functions.expect.txt b/test/markup/typescript/functions.expect.txt index 3addcb3036..d805a30c87 100644 --- a/test/markup/typescript/functions.expect.txt +++ b/test/markup/typescript/functions.expect.txt @@ -13,3 +13,13 @@ type Foo = { functionInFoo(): void; }; + +const good = () => 0; +const good = (x) => 0; +const bad = (a => [...a, b]); +const bad = (_ => doSomething()); +const bad = (() => 0); +const bad = ((a, b) => [...a, b]); +const array = [1, 2, 3].reduce<number[]>((acc, next) => [...acc, next], []); +const bad = ((a=2, b=5) => [...a, b]); +sides.every((length,width=(3+2+(4/5))) => length > 0 ); diff --git a/test/markup/typescript/functions.txt b/test/markup/typescript/functions.txt index 4985bdbfb9..22d72f54ab 100644 --- a/test/markup/typescript/functions.txt +++ b/test/markup/typescript/functions.txt @@ -13,3 +13,14 @@ function getArray(): number[] { type Foo = { functionInFoo(): void; }; + +const good = () => 0; +const good = (x) => 0; +const bad = (a => [...a, b]); +const bad = (_ => doSomething()); +const bad = (() => 0); +const bad = ((a, b) => [...a, b]); +const array = [1, 2, 3].reduce((acc, next) => [...acc, next], []); +const bad = ((a=2, b=5) => [...a, b]); +sides.every((length,width=(3+2+(4/5))) => length > 0 ); + From 58d911325a2157f6f31c741cd9b24630bf9275c9 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 8 Nov 2019 18:20:45 -0500 Subject: [PATCH 071/816] enh(cpp): Improve highlighting of unterminated raw strings PR #1897 switched C++ raw strings to use backreferences, however this breaks souce files where raw strings are truncated. Like comments, it would be preferable to highlight them. - Add `on:begin` and `on:end` to allow more granular matching when then end match is dynamic and based on a part of the begin match - This deprecates the `endSameAsBegin` attribute. That attribute was a very specific way to solve this problem, but now we have a much more general solution in these added callbacks. Also related: #2259. Co-authored-by: Josh Goebel --- docs/reference.rst | 1 + src/highlight.js | 65 +++++++++++++------ src/languages/c-like.js | 7 +- src/lib/mode_compiler.js | 11 ++-- src/lib/response.js | 11 ++++ .../cpp/truncated-block-comment.expect.txt | 3 + test/markup/cpp/truncated-block-comment.txt | 2 + .../cpp/truncated-raw-string.expect.txt | 5 ++ test/markup/cpp/truncated-raw-string.txt | 4 ++ 9 files changed, 82 insertions(+), 27 deletions(-) create mode 100644 src/lib/response.js create mode 100644 test/markup/cpp/truncated-block-comment.expect.txt create mode 100644 test/markup/cpp/truncated-block-comment.txt create mode 100644 test/markup/cpp/truncated-raw-string.expect.txt create mode 100644 test/markup/cpp/truncated-raw-string.txt diff --git a/docs/reference.rst b/docs/reference.rst index d2e4cb1c88..c823b48fca 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -208,6 +208,7 @@ In this case you can't simply specify the same regexp for ``begin`` and ``end`` (say, ``"\\$[a-z]\\$"``), but you can use ``begin: "\\$[a-z]\\$"`` and ``endSameAsBegin: true``. + .. _lexemes: lexemes diff --git a/src/highlight.js b/src/highlight.js index f5a93a88de..ca3a3d8b6a 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -4,6 +4,7 @@ https://highlightjs.org/ */ import deepFreeze from './vendor/deep_freeze'; +import Response from './lib/response'; import TokenTreeEmitter from './lib/token_tree'; import * as regex from './lib/regex'; import * as utils from './lib/utils'; @@ -118,18 +119,6 @@ const HLJS = function(hljs) { function _highlight(languageName, code, ignoreIllegals, continuation) { var codeToHighlight = code; - function endOfMode(mode, lexeme) { - if (regex.startsWith(mode.endRe, lexeme)) { - while (mode.endsParent && mode.parent) { - mode = mode.parent; - } - return mode; - } - if (mode.endsWithParent) { - return endOfMode(mode.parent, lexeme); - } - } - function keywordData(mode, match) { var matchText = language.case_insensitive ? match[0].toLowerCase() : match[0]; return Object.prototype.hasOwnProperty.call(mode.keywords, matchText) && mode.keywords[matchText]; @@ -206,7 +195,33 @@ const HLJS = function(hljs) { if (mode.className) { emitter.openNode(mode.className); } - top = Object.create(mode, { parent: { value: top } }); + top = Object.create(mode, {parent: {value: top}}); + return top; + } + + function endOfMode(mode, match, matchPlusRemainder) { + let matched = regex.startsWith(mode.endRe, matchPlusRemainder); + + if (matched) { + if (mode["before:end"]) { + let resp = new Response(mode); + mode["before:end"](match, resp); + if (resp.ignore) + matched = false; + } + + if (matched) { + while (mode.endsParent && mode.parent) { + mode = mode.parent; + } + return mode; + } + } + // even if before:end fires an `ignore` it's still possible + // that we might trigger the end node because of a parent mode + if (mode.endsWithParent) { + return endOfMode(mode.parent, match, matchPlusRemainder); + } } function doIgnore(lexeme) { @@ -226,12 +241,15 @@ const HLJS = function(hljs) { function doBeginMatch(match) { var lexeme = match[0]; var new_mode = match.rule; - - if (new_mode.__onBegin) { - const res = new_mode.__onBegin(match) || {}; - if (res.ignoreMatch) { - return doIgnore(lexeme); - } + var mode; + + let resp = new Response(new_mode); + // first internal before callbacks, then the public ones + let beforeCallbacks = [new_mode.__beforeBegin, new_mode["before:begin"]]; + for (let cb of beforeCallbacks) { + if (!cb) continue; + cb(match, resp); + if (resp.ignore) return doIgnore(lexeme); } if (new_mode && new_mode.endSameAsBegin) { @@ -249,14 +267,19 @@ const HLJS = function(hljs) { mode_buffer = lexeme; } } - startNewMode(new_mode); + mode = startNewMode(new_mode); + if (mode["after:begin"]) { + let resp = new Response(mode); + mode["after:begin"](match, resp); + } return new_mode.returnBegin ? 0 : lexeme.length; } function doEndMatch(match) { var lexeme = match[0]; var matchPlusRemainder = codeToHighlight.substr(match.index); - var end_mode = endOfMode(top, matchPlusRemainder); + + var end_mode = endOfMode(top, match, matchPlusRemainder); if (!end_mode) { return NO_MATCH; } var origin = top; diff --git a/src/languages/c-like.js b/src/languages/c-like.js index 90e23073ee..ca75094589 100644 --- a/src/languages/c-like.js +++ b/src/languages/c-like.js @@ -44,7 +44,12 @@ export default function(hljs) { begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + "|.)", end: '\'', illegal: '.' }, - { begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\((?:.|\n)*?\)\1"/ } + { + begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/, + end: /\)([^()\\ ]{0,16})"/, + 'after:begin': (m, resp) => { resp.data.heredoc = m[1]; }, + 'before:end': function(m, resp) { if (resp.data.heredoc !== m[1]) resp.ignoreMatch(); } + } ] }; diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index 9faf220258..16dc0adbaf 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -61,6 +61,7 @@ export function compileLanguage(language) { // eslint-disable-next-line no-undefined const i = match.findIndex((el, i) => i > 0 && el !== undefined); const matchData = this.matchIndexes[i]; + match.splice(0, i); // // trim off the extra matches return Object.assign(match, matchData); } @@ -158,11 +159,11 @@ export function compileLanguage(language) { } // TODO: We need negative look-behind support to do this properly - function skipIfhasPrecedingOrTrailingDot(match) { + function skipIfhasPrecedingOrTrailingDot(match, resp) { const before = match.input[match.index - 1]; const after = match.input[match.index + match[0].length]; if (before === "." || after === ".") { - return { ignoreMatch: true }; + resp.ignoreMatch(); } } @@ -200,8 +201,8 @@ export function compileLanguage(language) { if (mode.compiled) return; mode.compiled = true; - // __onBegin is considered private API, internal use only - mode.__onBegin = null; + // __beforeBegin is considered private API, internal use only + mode.__beforeBegin = null; mode.keywords = mode.keywords || mode.beginKeywords; if (mode.keywords) { @@ -218,7 +219,7 @@ export function compileLanguage(language) { // doesn't allow spaces in keywords anyways and we still check for the boundary // first mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?=\\b|\\s)'; - mode.__onBegin = skipIfhasPrecedingOrTrailingDot; + mode.__beforeBegin = skipIfhasPrecedingOrTrailingDot; } if (!mode.begin) mode.begin = /\B|\b/; diff --git a/src/lib/response.js b/src/lib/response.js new file mode 100644 index 0000000000..9c5bcfa95c --- /dev/null +++ b/src/lib/response.js @@ -0,0 +1,11 @@ +export default class Response { + constructor(mode) { + if (mode.data === undefined) + mode.data = {}; + this.data = mode.data; + } + + ignoreMatch() { + this.ignore = true; + } +} diff --git a/test/markup/cpp/truncated-block-comment.expect.txt b/test/markup/cpp/truncated-block-comment.expect.txt new file mode 100644 index 0000000000..a2f5ce048a --- /dev/null +++ b/test/markup/cpp/truncated-block-comment.expect.txt @@ -0,0 +1,3 @@ +/* +Truncated block comment + diff --git a/test/markup/cpp/truncated-block-comment.txt b/test/markup/cpp/truncated-block-comment.txt new file mode 100644 index 0000000000..b266bf0806 --- /dev/null +++ b/test/markup/cpp/truncated-block-comment.txt @@ -0,0 +1,2 @@ +/* +Truncated block comment diff --git a/test/markup/cpp/truncated-raw-string.expect.txt b/test/markup/cpp/truncated-raw-string.expect.txt new file mode 100644 index 0000000000..8d133e8bae --- /dev/null +++ b/test/markup/cpp/truncated-raw-string.expect.txt @@ -0,0 +1,5 @@ +R"foo( +Truncated raw string +)nope" +Still not completed. + diff --git a/test/markup/cpp/truncated-raw-string.txt b/test/markup/cpp/truncated-raw-string.txt new file mode 100644 index 0000000000..b012c82bfe --- /dev/null +++ b/test/markup/cpp/truncated-raw-string.txt @@ -0,0 +1,4 @@ +R"foo( +Truncated raw string +)nope" +Still not completed. From 1998ddf510119f23bb76c4c74c8ea88c46394d87 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 2 Mar 2020 19:23:45 -0500 Subject: [PATCH 072/816] (chore) C-like uses the new END_SAME_AS_BEGIN mode --- src/languages/c-like.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/languages/c-like.js b/src/languages/c-like.js index ca75094589..90062b9404 100644 --- a/src/languages/c-like.js +++ b/src/languages/c-like.js @@ -32,6 +32,10 @@ export default function(hljs) { // https://en.cppreference.com/w/cpp/language/escape // \\ \x \xFF \u2837 \u00323747 \374 var CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)' + var END_GROUP_SAME_AS_BEGIN = { + 'after:begin': (m, resp) => { resp.data.heredoc = m[1]; }, + 'before:end': (m, resp) => { if (resp.data.heredoc !== m[1]) resp.ignoreMatch(); } + }; var STRINGS = { className: 'string', variants: [ @@ -44,12 +48,10 @@ export default function(hljs) { begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + "|.)", end: '\'', illegal: '.' }, - { + Object.assign({ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/, end: /\)([^()\\ ]{0,16})"/, - 'after:begin': (m, resp) => { resp.data.heredoc = m[1]; }, - 'before:end': function(m, resp) { if (resp.data.heredoc !== m[1]) resp.ignoreMatch(); } - } + }, END_GROUP_SAME_AS_BEGIN) ] }; From 95abfe0b2c136ef17a57c5e0cdc813af5d401a4f Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 2 Mar 2020 19:45:01 -0500 Subject: [PATCH 073/816] (chore) Ruby uses END_SAME_AS_BEGIN mode/rule --- src/languages/c-like.js | 6 +----- src/languages/ruby.js | 6 +++--- src/lib/modes.js | 5 +++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/languages/c-like.js b/src/languages/c-like.js index 90062b9404..b77a349842 100644 --- a/src/languages/c-like.js +++ b/src/languages/c-like.js @@ -32,10 +32,6 @@ export default function(hljs) { // https://en.cppreference.com/w/cpp/language/escape // \\ \x \xFF \u2837 \u00323747 \374 var CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)' - var END_GROUP_SAME_AS_BEGIN = { - 'after:begin': (m, resp) => { resp.data.heredoc = m[1]; }, - 'before:end': (m, resp) => { if (resp.data.heredoc !== m[1]) resp.ignoreMatch(); } - }; var STRINGS = { className: 'string', variants: [ @@ -51,7 +47,7 @@ export default function(hljs) { Object.assign({ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/, end: /\)([^()\\ ]{0,16})"/, - }, END_GROUP_SAME_AS_BEGIN) + }, hljs.END_FIRST_MATCH_SAME_AS_BEGIN) ] }; diff --git a/src/languages/ruby.js b/src/languages/ruby.js index 59f2b048f8..d702f617cd 100644 --- a/src/languages/ruby.js +++ b/src/languages/ruby.js @@ -72,10 +72,10 @@ export default function(hljs) { returnBegin: true, contains: [ { begin: /<<[-~]?'?/ }, - { begin: /\w+/, - endSameAsBegin: true, + Object.assign({ + begin: /(\w+)/, end: /(\w+)/, contains: [hljs.BACKSLASH_ESCAPE, SUBST], - } + }, hljs.END_FIRST_MATCH_SAME_AS_BEGIN) ] } ] diff --git a/src/lib/modes.js b/src/lib/modes.js index f91811ee17..7be59611aa 100644 --- a/src/lib/modes.js +++ b/src/lib/modes.js @@ -117,3 +117,8 @@ export const METHOD_GUARD = { begin: '\\.\\s*' + UNDERSCORE_IDENT_RE, relevance: 0 }; + +export const END_FIRST_MATCH_SAME_AS_BEGIN = { + 'after:begin': (m, resp) => { resp.data.heredoc = m[1]; }, + 'before:end': (m, resp) => { if (resp.data.heredoc !== m[1]) resp.ignoreMatch(); } +}; From 07450a69f44c4040d0bf9c7df9da54f34e0897f2 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 12 Mar 2020 03:02:27 -0400 Subject: [PATCH 074/816] (parser) make END_SAME_AS_BEGIN a function helper Adds a mode helper to replace the deprecated `endSameAsBegin` attribute. The first match group from the begin regex will be compared to the first match group from the end regex and the end regex will only match if both strings are identical. Note this is more advanced functionality than before since now you can match a larger selection of text yet only use a small portion of it for the actual "end must match begin" portion. --- src/languages/c-like.js | 4 ++-- src/languages/ruby.js | 4 ++-- src/lib/modes.js | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/languages/c-like.js b/src/languages/c-like.js index b77a349842..fb3a70c2af 100644 --- a/src/languages/c-like.js +++ b/src/languages/c-like.js @@ -44,10 +44,10 @@ export default function(hljs) { begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + "|.)", end: '\'', illegal: '.' }, - Object.assign({ + hljs.END_SAME_AS_BEGIN({ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/, end: /\)([^()\\ ]{0,16})"/, - }, hljs.END_FIRST_MATCH_SAME_AS_BEGIN) + }) ] }; diff --git a/src/languages/ruby.js b/src/languages/ruby.js index d702f617cd..bce2aaf841 100644 --- a/src/languages/ruby.js +++ b/src/languages/ruby.js @@ -72,10 +72,10 @@ export default function(hljs) { returnBegin: true, contains: [ { begin: /<<[-~]?'?/ }, - Object.assign({ + hljs.END_SAME_AS_BEGIN({ begin: /(\w+)/, end: /(\w+)/, contains: [hljs.BACKSLASH_ESCAPE, SUBST], - }, hljs.END_FIRST_MATCH_SAME_AS_BEGIN) + }) ] } ] diff --git a/src/lib/modes.js b/src/lib/modes.js index 7be59611aa..55eabb8e67 100644 --- a/src/lib/modes.js +++ b/src/lib/modes.js @@ -118,7 +118,10 @@ export const METHOD_GUARD = { relevance: 0 }; -export const END_FIRST_MATCH_SAME_AS_BEGIN = { - 'after:begin': (m, resp) => { resp.data.heredoc = m[1]; }, - 'before:end': (m, resp) => { if (resp.data.heredoc !== m[1]) resp.ignoreMatch(); } +export const END_SAME_AS_BEGIN = function(mode) { + return Object.assign(mode, + { + 'after:begin': (m, resp) => { resp.data._beginMatch = m[1]; }, + 'before:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch() } + }); }; From 629de193db04b892cc5aaaf37cd216b825513b99 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 12 Mar 2020 13:18:09 -0400 Subject: [PATCH 075/816] (pgsql) add test for $$ quoting existing behavior - even if that existing behavior is questionable - the ending span should really close before the $$, not after Fixing this would involve delving into the sublanguage behavior and I'm not sure we have time to tackle that right this moment. --- test/markup/pgsql/dollar_strings.expect.txt | 9 +++++++++ test/markup/pgsql/dollar_strings.txt | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/markup/pgsql/dollar_strings.expect.txt create mode 100644 test/markup/pgsql/dollar_strings.txt diff --git a/test/markup/pgsql/dollar_strings.expect.txt b/test/markup/pgsql/dollar_strings.expect.txt new file mode 100644 index 0000000000..841d2cff6f --- /dev/null +++ b/test/markup/pgsql/dollar_strings.expect.txt @@ -0,0 +1,9 @@ +CREATE OR REPLACE FUNCTION hello_world(param_your_name text) +RETURNS text AS +$$ +SELECT 'Hello world. My name is ' || param_your_name || '.'; +$$ +language sql STRICT; + +SELECT sql_expression($sql$SELECT hello_world($phrase$Regina's elephant's dog$phrase$) + || $phrase$ I made a cat's meow today.$phrase$ $sql$); diff --git a/test/markup/pgsql/dollar_strings.txt b/test/markup/pgsql/dollar_strings.txt new file mode 100644 index 0000000000..cfc03f4732 --- /dev/null +++ b/test/markup/pgsql/dollar_strings.txt @@ -0,0 +1,9 @@ +CREATE OR REPLACE FUNCTION hello_world(param_your_name text) +RETURNS text AS +$$ +SELECT 'Hello world. My name is ' || param_your_name || '.'; +$$ +language sql STRICT; + +SELECT sql_expression($sql$SELECT hello_world($phrase$Regina's elephant's dog$phrase$) + || $phrase$ I made a cat's meow today.$phrase$ $sql$); From a4f1f2092e02955392836f8f0657864e3ad2a12d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 12 Mar 2020 13:29:38 -0400 Subject: [PATCH 076/816] (chore) pgsql uses END_SAME_AS_BEGIN mode/rule now also --- src/languages/pgsql.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languages/pgsql.js b/src/languages/pgsql.js index 55d855a521..589a8ba145 100644 --- a/src/languages/pgsql.js +++ b/src/languages/pgsql.js @@ -463,9 +463,9 @@ export default function(hljs) { contains: [{begin: '\\\\.'}], relevance: 10 }, - { + hljs.END_SAME_AS_BEGIN({ begin: DOLLAR_STRING, - endSameAsBegin: true, + end: DOLLAR_STRING, contains: [ { // actually we want them all except SQL; listed are those with known implementations @@ -474,7 +474,7 @@ export default function(hljs) { endsWithParent: true } ] - }, + }), // identifiers in quotes { begin: '"', end: '"', From d4b047b4d89bcc302f50f079ba189b0ad0ccb91b Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 12 Mar 2020 13:58:01 -0400 Subject: [PATCH 077/816] (docs) rename to `mode_reference`; docs for callbacks - I can never find this file because it's name didn't fully match. - rename callbacks to `on:begin` and `on:end` --- CHANGES.md | 13 +++++++++ docs/index.rst | 2 +- docs/language-guide.rst | 2 +- docs/{reference.rst => mode-reference.rst} | 34 ++++++++++++++++++++-- src/highlight.js | 16 +++++----- src/lib/mode_compiler.js | 4 ++- src/lib/modes.js | 4 +-- 7 files changed, 60 insertions(+), 15 deletions(-) rename docs/{reference.rst => mode-reference.rst} (86%) diff --git a/CHANGES.md b/CHANGES.md index 9c7eda553b..b5f7f6b497 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,13 +1,26 @@ ## Version 10.1.0 (in progress) +Parser Engine: + +- (enh) Added `on:begin` callback for modes (#2261) [Josh Goebel][] +- (enh) Added `on:end` callback for modes (#2261) [Josh Goebel][] +- (enh) Added ability to programatically ignore begin and end matches (#2261) [Josh Goebel][] +- (enh) Added `END_SAME_AS_BEGIN` mode to replace `endSameAsBegin` parser attribute (#2261) [Josh Goebel][] + +Deprecations: + +- (deprecation) `endSameAsBegin` is now deprecated. (#2261) [Josh Goebel][] + Language Improvements: +- fix(cpp) Fix highlighting of unterminated raw strings (#2261) [David Benjamin][] - fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] - fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] - fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][] [Josh Goebel]: https://github.com/yyyc514 [Peter Plantinga]: https://github.com/pplantinga +[David Benjamin]: https://github.com/davidben ## Version 10.0.1 diff --git a/docs/index.rst b/docs/index.rst index 3792e16245..7ae5b1953f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,7 +13,7 @@ Contents: api language-guide - reference + mode-reference css-classes-reference style-guide plugin-api diff --git a/docs/language-guide.rst b/docs/language-guide.rst index 0971524e52..4ed26d2d96 100644 --- a/docs/language-guide.rst +++ b/docs/language-guide.rst @@ -186,7 +186,7 @@ For such modes ``className`` attribute should be omitted so they won't generate Mode attributes --------------- -Other useful attributes are defined in the :doc:`mode reference `. +Other useful attributes are defined in the :doc:`mode reference `. .. _relevance: diff --git a/docs/reference.rst b/docs/mode-reference.rst similarity index 86% rename from docs/reference.rst rename to docs/mode-reference.rst index c823b48fca..a60400d536 100644 --- a/docs/reference.rst +++ b/docs/mode-reference.rst @@ -62,6 +62,19 @@ Regular expression starting a mode. For example a single quote for strings or tw If absent, ``begin`` defaults to a regexp that matches anything, so the mode starts immediately. +on:begin +^^^^^^^^^^^ + +**type**: callback (matchData, response) + +This callback is triggered the moment a begin match is detected. ``matchData`` includes the typical regex match data; the full match, match groups, etc. The ``response`` object is used to tell the parser how it should handle the match. It can be also used to temporarily store data. + +- ``response.data`` - a simple object data store. Can be used for building more complex rules where the end rule is dependent on the content of begin, etc. +- ``response.ignoreMatch()`` - pretend as if this match never happened. The mode is not entered. Continues trying subsequent modes in the current mode's ``contains`` list + +For an example of usage see ``END_SAME_AS_BEGIN`` in ``modes.js``. + + end ^^^ @@ -79,6 +92,19 @@ Sometimes a mode can end not by itself but implicitly with its containing (paren This is achieved with :ref:`endsWithParent ` attribute. +on:end +^^^^^^^^^^^ + +**type**: callback (matchData, response) + +This callback is triggered the moment an end match is detected. ``matchData`` includes the typical regex match data; the full match, match groups, etc. The ``response`` object is used to tell the parser how it should handle the match. It can also be used to retrieve data stored from a `begin` callback. + +- ``response.data`` - a simple object data store. Can be used for building more complex rules where the end rule is dependent on the content of begin, etc. +- ``response.ignoreMatch()`` - pretend as if this match never happened. The mode is not entered. Continues trying subsequent modes in the current mode's ``contains`` list + +For an example of usage see ``END_SAME_AS_BEGIN`` in ``modes.js``. + + beginKeywords ^^^^^^^^^^^^^^^^ @@ -182,8 +208,12 @@ tell it to end the function definition after itself: .. _endSameAsBegin: -endSameAsBegin -^^^^^^^^^^^^^^ +endSameAsBegin (deprecated as of 10.1) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**Deprecated:** *This attribute has been deprecated.* You should instead use the +``END_SAME_AS_BEGIN`` mode or use the ``on:begin`` and ``on:end`` attributes to +build more complex paired matchers. **type**: boolean diff --git a/src/highlight.js b/src/highlight.js index ca3a3d8b6a..d60330fba5 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -203,9 +203,9 @@ const HLJS = function(hljs) { let matched = regex.startsWith(mode.endRe, matchPlusRemainder); if (matched) { - if (mode["before:end"]) { + if (mode["on:end"]) { let resp = new Response(mode); - mode["before:end"](match, resp); + mode["on:end"](match, resp); if (resp.ignore) matched = false; } @@ -217,7 +217,7 @@ const HLJS = function(hljs) { return mode; } } - // even if before:end fires an `ignore` it's still possible + // even if on:end fires an `ignore` it's still possible // that we might trigger the end node because of a parent mode if (mode.endsWithParent) { return endOfMode(mode.parent, match, matchPlusRemainder); @@ -245,7 +245,7 @@ const HLJS = function(hljs) { let resp = new Response(new_mode); // first internal before callbacks, then the public ones - let beforeCallbacks = [new_mode.__beforeBegin, new_mode["before:begin"]]; + let beforeCallbacks = [new_mode.__beforeBegin, new_mode["on:begin"]]; for (let cb of beforeCallbacks) { if (!cb) continue; cb(match, resp); @@ -268,10 +268,10 @@ const HLJS = function(hljs) { } } mode = startNewMode(new_mode); - if (mode["after:begin"]) { - let resp = new Response(mode); - mode["after:begin"](match, resp); - } + // if (mode["after:begin"]) { + // let resp = new Response(mode); + // mode["after:begin"](match, resp); + // } return new_mode.returnBegin ? 0 : lexeme.length; } diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index 16dc0adbaf..e853cf2c3b 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -61,7 +61,9 @@ export function compileLanguage(language) { // eslint-disable-next-line no-undefined const i = match.findIndex((el, i) => i > 0 && el !== undefined); const matchData = this.matchIndexes[i]; - match.splice(0, i); // // trim off the extra matches + // trim off any earlier non-relevant match groups (ie, the other regex + // match groups that make up the multi-matcher) + match.splice(0, i); return Object.assign(match, matchData); } diff --git a/src/lib/modes.js b/src/lib/modes.js index 55eabb8e67..8acb8f0e51 100644 --- a/src/lib/modes.js +++ b/src/lib/modes.js @@ -121,7 +121,7 @@ export const METHOD_GUARD = { export const END_SAME_AS_BEGIN = function(mode) { return Object.assign(mode, { - 'after:begin': (m, resp) => { resp.data._beginMatch = m[1]; }, - 'before:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch() } + 'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; }, + 'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch() } }); }; From ba2e65e43f047bd14becc12735d9acbab7c63d4e Mon Sep 17 00:00:00 2001 From: Vania Kucher Date: Tue, 28 Apr 2020 19:03:36 +0300 Subject: [PATCH 078/816] prevented setter keyword conflicting with setTimeout|setInterval and highlighted them (#2514) (#2515) * fix(javascript) prevent setter keyword 'set' conflicting with setTimeout|setInterval (#2514) * enh(javascript) setTimeout|setInterval now highlighted (#2514) * enh (javascript) clearInterval and clearTimeout now highlighted * add keywords to TypeScript also --- CHANGES.md | 4 ++++ src/languages/javascript.js | 4 ++-- src/languages/typescript.js | 3 ++- .../javascript/keyword-as-part-of-method-name.expect.txt | 2 ++ test/markup/javascript/keyword-as-part-of-method-name.txt | 2 ++ 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 test/markup/javascript/keyword-as-part-of-method-name.expect.txt create mode 100644 test/markup/javascript/keyword-as-part-of-method-name.txt diff --git a/CHANGES.md b/CHANGES.md index b5f7f6b497..d8cbfee4b4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,9 @@ Deprecations: Language Improvements: +- enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][] +- enh(javascript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Vania Kucher][] +- fix(javascript) prevent `set` keyword conflicting with setTimeout, etc. (#2514) [Vania Kucher][] - fix(cpp) Fix highlighting of unterminated raw strings (#2261) [David Benjamin][] - fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] - fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] @@ -21,6 +24,7 @@ Language Improvements: [Josh Goebel]: https://github.com/yyyc514 [Peter Plantinga]: https://github.com/pplantinga [David Benjamin]: https://github.com/davidben +[Vania Kucher]: https://github.com/qWici ## Version 10.0.1 diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 0ad9b3f18f..eb0d62adc0 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -33,7 +33,7 @@ export default function(hljs) { 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' + 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' + 'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' + - 'Promise' + 'Promise setInterval setTimeout clearInterval clearTimeout' }; var NUMBER = { className: 'number', @@ -263,7 +263,7 @@ export default function(hljs) { beginKeywords: 'constructor', end: /\{/, excludeEnd: true }, { - begin:'(get|set)\\s*(?=' + IDENT_RE+ '\\()', + begin: '(get|set)\\s+(?=' + IDENT_RE + '\\()', end: /{/, keywords: "get set", contains: [ diff --git a/src/languages/typescript.js b/src/languages/typescript.js index 9266b55e6b..fd7f59ad7f 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -25,7 +25,8 @@ export default function(hljs) { 'TypeError URIError Number Math Date String RegExp Array Float32Array ' + 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' + 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' + - 'module console window document any number boolean string void Promise' + 'module console window document any number boolean string void Promise ' + + 'setInterval setTimeout clearInterval clearTimeout' }; var DECORATOR = { className: 'meta', diff --git a/test/markup/javascript/keyword-as-part-of-method-name.expect.txt b/test/markup/javascript/keyword-as-part-of-method-name.expect.txt new file mode 100644 index 0000000000..5a004f4fa0 --- /dev/null +++ b/test/markup/javascript/keyword-as-part-of-method-name.expect.txt @@ -0,0 +1,2 @@ +setTimeout(); +setInterval(); \ No newline at end of file diff --git a/test/markup/javascript/keyword-as-part-of-method-name.txt b/test/markup/javascript/keyword-as-part-of-method-name.txt new file mode 100644 index 0000000000..30d71a2e36 --- /dev/null +++ b/test/markup/javascript/keyword-as-part-of-method-name.txt @@ -0,0 +1,2 @@ +setTimeout(); +setInterval(); \ No newline at end of file From e63d5d7badecf510ea60985c5bea61feb4967391 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 28 Apr 2020 17:57:23 -0400 Subject: [PATCH 079/816] (docs) add TLDR instructions for building and testing --- docs/building-testing.rst | 30 ++++++++++++++++++++++++------ package.json | 8 ++++++++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/docs/building-testing.rst b/docs/building-testing.rst index 38303e9146..72c91ca022 100644 --- a/docs/building-testing.rst +++ b/docs/building-testing.rst @@ -1,9 +1,27 @@ -Building and testing +Building and Testing ==================== -To actually run highlight.js it is necessary to build it for the environment -where you're going to run it: a browser, the node.js server, etc. +To use Highlight.js it is first necessary to build it for the environment +where you plan to execute it: the browser, the Node.js server, etc. +TLDR +---- + +Often when contributing a pull-request it's sufficient to build and test only +the Node.js build. Our CI process will guarantee the browser build tests are all +still green if you don't run them during development. + +:: + + npm run build + npm run test + +The browser library must be built and tested separately: + +:: + + npm run build-browser + npm run test-browser Building -------- @@ -99,7 +117,7 @@ finish with your changes you can build the container from the root of the reposi docker build -t highlight-js . -And then run the container. You will need to expose port 80 on the host for the +And then run the container. You will need to expose port 80 on the host for the web interface, and note that we are running it in detached (-d) mode. :: @@ -140,14 +158,14 @@ for preview. When you are done, clean up your container. docker stop highlight-js -If you want a more advanced testing setup, you can bind the source folder when you +If you want a more advanced testing setup, you can bind the source folder when you run the container. :: docker run -d --name highlight-js --volume $PWD/src:/var/www/html/src --rm -p 80:80 highlight-js -Then if you want to make changes, you can do so locally (the folder is bound as a volume), +Then if you want to make changes, you can do so locally (the folder is bound as a volume), and execute a command to the container to trigger a rebuild: :: diff --git a/package.json b/package.json index 7fbded91ac..f442149c96 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,15 @@ "main": "./lib/index.js", "scripts": { "mocha": "mocha", + + "build_and_test": "npm run build && npm run test", + "build": "node ./tools/build.js -t node", + "build-cdn": "node ./tools/build.js -t cdn", + "build-browser": "node ./tools/build.js -t browser :common", + "test": "mocha --globals document test", + "test-markup": "mocha --globals document test/markup", + "test-detect": "mocha --globals document test/detect", "test-browser": "mocha --globals document test/browser" }, "engines": { From 5f1fbf12ca33a1d0a8ed210c46a83671b87615f0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 29 Apr 2020 13:11:37 -0400 Subject: [PATCH 080/816] (dev) improve developer tool UI --- tools/developer.html | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/tools/developer.html b/tools/developer.html index cef5f50fdb..0c32d11a87 100644 --- a/tools/developer.html +++ b/tools/developer.html @@ -7,14 +7,22 @@ -

highlight.js developer

-
+

Code

@@ -59,11 +69,11 @@

highlight.js developer

-

Rendered in ... ms [...]

+

Rendered in ... ms [...]

...
-

Markup +

Markup

...
@@ -88,7 +98,10 @@

highlight.js developer

var result = hljs.getLanguage(language) ? hljs.highlight(language, source, true) : hljs.highlightAuto(source); var rendering_time = +new Date() - start_time; editor.find('.hljs').html(result.value); - var rendering_stats = result.language + ': ' + (result.relevance || result.r); + $(".hljs span").each((_,el) => { + $(el).attr("data-klass", el.className.replace("hljs-","")) + }) + var rendering_stats = result.language + ': relevance ' + (result.relevance ); if (result.second_best) { rendering_stats += ', ' + result.second_best.language + ': ' + (result.second_best.relevance || result.second_best.r); } From b984c7baac05df21a44356e38b3a896970b53a5e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 28 Apr 2020 12:44:15 -0400 Subject: [PATCH 081/816] (parser) Build common EMCAscript foundation Builds a common keyword foundation for any grammar that is building on top of JavaScript: - LiveScript - CoffeeScript - TypeScript Also uses this common foundation for JS itself. --- .eslintrc.js | 3 +- CHANGES.md | 1 + src/languages/coffeescript.js | 50 +++++-- src/languages/javascript.js | 23 +--- src/languages/lib/ecmascript.js | 138 +++++++++++++++++++ src/languages/livescript.js | 64 +++++++-- src/languages/typescript.js | 44 +++--- test/detect/index.js | 52 ++++--- test/markup/coffeescript/function.expect.txt | 4 +- test/markup/javascript/class.expect.txt | 6 +- test/markup/typescript/class.expect.txt | 8 +- 11 files changed, 292 insertions(+), 101 deletions(-) create mode 100644 src/languages/lib/ecmascript.js diff --git a/.eslintrc.js b/.eslintrc.js index b73d0a97db..930b631331 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,8 @@ module.exports = { "env": { "browser": true, "es6": true, - "node": true + "node": true, + "mocha": true }, "extends": [ "eslint:recommended", diff --git a/CHANGES.md b/CHANGES.md index d8cbfee4b4..b693cb9a4d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Deprecations: Language Improvements: +- enh(typescript/javascript/coffeescript/livescript) derive ECMAscript keywords from a common foudation (#2518) [Josh Goebel][] - enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][] - enh(javascript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Vania Kucher][] - fix(javascript) prevent `set` keyword conflicting with setTimeout, etc. (#2514) [Vania Kucher][] diff --git a/src/languages/coffeescript.js b/src/languages/coffeescript.js index 0defcd5adb..60c8bb5a4a 100644 --- a/src/languages/coffeescript.js +++ b/src/languages/coffeescript.js @@ -7,21 +7,45 @@ Category: common, scripting Website: https://coffeescript.org */ +import * as ECMAScript from "./lib/ecmascript"; + export default function(hljs) { + var COFFEE_BUILT_INS = [ + 'npm', + 'print' + ]; + var COFFEE_LITERALS = [ + 'yes', + 'no', + 'on', + 'off' + ]; + var COFFEE_KEYWORDS = [ + 'then', + 'unless', + 'until', + 'loop', + 'by', + 'when', + 'and', + 'or', + 'is', + 'isnt', + 'not' + ]; + var NOT_VALID_KEYWORDS = [ + "var", + "const", + "let", + "function", + "static" + ]; + var excluding = (list) => + (kw) => !list.includes(kw); var KEYWORDS = { - keyword: - // JS keywords - 'in if for while finally new do return else break catch instanceof throw try this ' + - 'switch continue typeof delete debugger super yield import export from as default await ' + - // Coffee keywords - 'then unless until loop of by when and or is isnt not', - literal: - // JS literals - 'true false null undefined ' + - // Coffee literals - 'yes no on off', - built_in: - 'npm require console print module global window document' + keyword: ECMAScript.KEYWORDS.concat(COFFEE_KEYWORDS).filter(excluding(NOT_VALID_KEYWORDS)).join(" "), + literal: ECMAScript.LITERALS.concat(COFFEE_LITERALS).join(" "), + built_in: ECMAScript.BUILT_INS.concat(COFFEE_BUILT_INS).join(" ") }; var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; var SUBST = { diff --git a/src/languages/javascript.js b/src/languages/javascript.js index eb0d62adc0..432863359e 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -5,6 +5,8 @@ Category: common, scripting Website: https://developer.mozilla.org/en-US/docs/Web/JavaScript */ +import * as ECMAScript from "./lib/ecmascript"; + export default function(hljs) { var FRAGMENT = { begin: '<>', @@ -16,24 +18,9 @@ export default function(hljs) { }; var IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; var KEYWORDS = { - keyword: - 'in of if for while finally var new function do return void else break catch ' + - 'instanceof with throw case default try this switch continue typeof delete ' + - 'let yield const export super debugger as async await static ' + - // ECMAScript 6 modules import - 'import from as' - , - literal: - 'true false null undefined NaN Infinity', - built_in: - 'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' + - 'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' + - 'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' + - 'TypeError URIError Number Math Date String RegExp Array Float32Array ' + - 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' + - 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' + - 'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' + - 'Promise setInterval setTimeout clearInterval clearTimeout' + keyword: ECMAScript.KEYWORDS.join(" "), + literal: ECMAScript.LITERALS.join(" "), + built_in: ECMAScript.BUILT_INS.join(" ") }; var NUMBER = { className: 'number', diff --git a/src/languages/lib/ecmascript.js b/src/languages/lib/ecmascript.js new file mode 100644 index 0000000000..0e80f2c40c --- /dev/null +++ b/src/languages/lib/ecmascript.js @@ -0,0 +1,138 @@ +const KEYWORDS = [ + "as", // for exports + "in", + "of", + "if", + "for", + "while", + "finally", + "var", + "new", + "function", + "do", + "return", + "void", + "else", + "break", + "catch", + "instanceof", + "with", + "throw", + "case", + "default", + "try", + "switch", + "continue", + "typeof", + "delete", + "let", + "yield", + "const", + "class", + // JS handles these with a special rule + // "get", + // "set", + "debugger", + "async", + "await", + "static", + "import", + "from", + "export", + "extends" +]; +const LITERALS = [ + "true", + "false", + "null", + "undefined", + "NaN", + "Infinity" +]; + +const TYPES = [ + "Intl", + "DataView", + "Number", + "Math", + "Date", + "String", + "RegExp", + "Object", + "Function", + "Boolean", + "Error", + "Symbol", + "Set", + "Map", + "WeakSet", + "WeakMap", + "Proxy", + "Reflect", + "JSON", + "Promise", + "Float64Array", + "Int16Array", + "Int32Array", + "Int8Array", + "Uint16Array", + "Uint32Array", + "Float32Array", + "Array", + "Uint8Array", + "Uint8ClampedArray", + "ArrayBuffer" +]; + +const ERROR_TYPES = [ + "EvalError", + "InternalError", + "RangeError", + "ReferenceError", + "SyntaxError", + "TypeError", + "URIError" +]; + +const BUILT_IN_GLOBALS = [ + "setInterval", + "setTimeout", + "clearInterval", + "clearTimeout", + + "require", + "exports", + + "eval", + "isFinite", + "isNaN", + "parseFloat", + "parseInt", + "decodeURI", + "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + "escape", + "unescape" +]; + +const BUILT_IN_VARIABLES = [ + "arguments", + "this", + "super", + "console", + "window", + "document", + "localStorage", + "module", + "global" // Node.js +]; + +const BUILT_INS = [].concat( + BUILT_IN_GLOBALS, + BUILT_IN_VARIABLES, + TYPES, + ERROR_TYPES +); + +export { LITERALS, BUILT_INS, KEYWORDS }; diff --git a/src/languages/livescript.js b/src/languages/livescript.js index 17e6ab057d..4f1f072a90 100644 --- a/src/languages/livescript.js +++ b/src/languages/livescript.js @@ -8,23 +8,57 @@ Website: https://livescript.net Category: scripting */ +import * as ECMAScript from "./lib/ecmascript"; + export default function(hljs) { + var LIVESCRIPT_BUILT_INS = [ + 'npm', + 'print' + ]; + var LIVESCRIPT_LITERALS = [ + 'yes', + 'no', + 'on', + 'off', + 'it', + 'that', + 'void' + ]; + var LIVESCRIPT_KEYWORDS = [ + 'then', + 'unless', + 'until', + 'loop', + 'of', + 'by', + 'when', + 'and', + 'or', + 'is', + 'isnt', + 'not', + 'it', + 'that', + 'otherwise', + 'from', + 'to', + 'til', + 'fallthrough', + 'case', + 'enum', + 'native', + 'list', + 'map', + '__hasProp', + '__extends', + '__slice', + '__bind', + '__indexOf' + ]; var KEYWORDS = { - keyword: - // JS keywords - 'in if for while finally new do return else break catch instanceof throw try this ' + - 'switch continue typeof delete debugger case default function var with ' + - // LiveScript keywords - 'then unless until loop of by when and or is isnt not it that otherwise from to til fallthrough super ' + - 'case default function var void const let enum export import native list map ' + - '__hasProp __extends __slice __bind __indexOf', - literal: - // JS literals - 'true false null undefined ' + - // LiveScript literals - 'yes no on off it that void', - built_in: - 'npm require console print module global window document' + keyword: ECMAScript.KEYWORDS.concat(LIVESCRIPT_KEYWORDS).join(" "), + literal: ECMAScript.LITERALS.concat(LIVESCRIPT_LITERALS).join(" "), + built_in: ECMAScript.BUILT_INS.concat(LIVESCRIPT_BUILT_INS).join(" ") }; var JS_IDENT_RE = '[A-Za-z$_](?:\-[0-9A-Za-z$_]|[0-9A-Za-z$_])*'; var TITLE = hljs.inherit(hljs.TITLE_MODE, {begin: JS_IDENT_RE}); diff --git a/src/languages/typescript.js b/src/languages/typescript.js index fd7f59ad7f..adfed257d3 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -7,26 +7,36 @@ Website: https://www.typescriptlang.org Category: common, scripting */ +import * as ECMAScript from "./lib/ecmascript"; + export default function(hljs) { var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; + var TYPES = [ + "any", + "void", + "number", + "boolean", + "string", + "object", + "never", + "enum" + ]; + var TS_SPECIFIC_KEYWORDS = [ + "type", + "namespace", + "typedef", + "interface", + "public", + "private", + "protected", + "implements", + "declare", + "abstract" + ]; var KEYWORDS = { - keyword: - 'in if for while finally var new function do return void else break catch ' + - 'instanceof with throw case default try this switch continue typeof delete ' + - 'let yield const class public private protected get set super ' + - 'static implements enum export import declare type namespace abstract ' + - 'as from extends async await', - literal: - 'true false null undefined NaN Infinity', - built_in: - 'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' + - 'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' + - 'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' + - 'TypeError URIError Number Math Date String RegExp Array Float32Array ' + - 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' + - 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' + - 'module console window document any number boolean string void Promise ' + - 'setInterval setTimeout clearInterval clearTimeout' + keyword: ECMAScript.KEYWORDS.concat(TS_SPECIFIC_KEYWORDS).join(" "), + literal: ECMAScript.LITERALS.join(" "), + built_in: ECMAScript.BUILT_INS.concat(TYPES).join(" ") }; var DECORATOR = { className: 'meta', diff --git a/test/detect/index.js b/test/detect/index.js index fec7bb3276..b6daf0f31e 100644 --- a/test/detect/index.js +++ b/test/detect/index.js @@ -1,46 +1,44 @@ 'use strict'; -delete require.cache[require.resolve('../../build')] -delete require.cache[require.resolve('../../build/lib/core')] +delete require.cache[require.resolve('../../build')]; +delete require.cache[require.resolve('../../build/lib/core')]; -const fs = require('fs').promises; -const hljs = require('../../build'); +const fs = require('fs').promises; +const hljs = require('../../build'); hljs.debugMode(); // tests run in debug mode so errors are raised -const path = require('path'); -const utility = require('../utility'); -const { getThirdPartyPackages } = require('../../tools/lib/external_language') +const path = require('path'); +const utility = require('../utility'); +const { getThirdPartyPackages } = require('../../tools/lib/external_language'); -function testAutoDetection(language, {detectPath}) { +function testAutoDetection(language, { detectPath }) { const languagePath = detectPath || utility.buildPath('detect', language); - it(`should be detected as ${language}`, async () => { + it(`should be detected as ${language}`, async() => { const dir = await fs.stat(languagePath); - dir.isDirectory().should.be.true; + dir.isDirectory().should.be.true(); - const filenames = await fs.readdir(languagePath) - const filesContent = await Promise.all(filenames - .map(function(example) { + const filenames = await fs.readdir(languagePath); + await Promise.all(filenames + .map(async function(example) { const filename = path.join(languagePath, example); - return fs.readFile(filename, 'utf-8'); - })) - filesContent.forEach(function(content) { - const expected = language, - actual = hljs.highlightAuto(content).language; + const content = await fs.readFile(filename, 'utf-8'); + const detectedLanguage = hljs.highlightAuto(content).language; - actual.should.equal(expected); - }); + detectedLanguage.should.equal(language, + `${path.basename(filename)} should be detected as ${language}, but was ${detectedLanguage}`); + })); }); } describe('hljs.highlightAuto()', () => { - before( async function() { - let thirdPartyPackages = await getThirdPartyPackages(); + before(async function() { + const thirdPartyPackages = await getThirdPartyPackages(); - let languages = hljs.listLanguages(); + const languages = hljs.listLanguages(); describe(`hljs.highlightAuto()`, function() { languages.filter(hljs.autoDetection).forEach((language) => { - let detectPath = detectTestDir(language); + const detectPath = detectTestDir(language); testAutoDetection(language, { detectPath }); }); }); @@ -50,13 +48,11 @@ describe('hljs.highlightAuto()', () => { for (let i = 0; i < thirdPartyPackages.length; ++i) { const pkg = thirdPartyPackages[i]; const idx = pkg.names.indexOf(name); - if (idx !== -1) - return pkg.detectTestPaths[idx] + if (idx !== -1) return pkg.detectTestPaths[idx]; } return null; // test not found } }); - it("adding dynamic tests...", async function() {} ); // this is required to work + it("adding dynamic tests...", async function() {}); // this is required to work }); - diff --git a/test/markup/coffeescript/function.expect.txt b/test/markup/coffeescript/function.expect.txt index 0c4f8af86f..4d43e641b3 100644 --- a/test/markup/coffeescript/function.expect.txt +++ b/test/markup/coffeescript/function.expect.txt @@ -3,12 +3,12 @@ square = (x) -> x * x npmWishlist.sha256 = (str) -> - throw new Error() + throw new Error() str.split(" ").map((m) -> m.charCodeAt(0)) fs.readFile("package.json", "utf-8", (err, content) -> - data = JSON.parse(content) + data = JSON.parse(content) data.version ) diff --git a/test/markup/javascript/class.expect.txt b/test/markup/javascript/class.expect.txt index 31a8507e4c..c631c8f819 100644 --- a/test/markup/javascript/class.expect.txt +++ b/test/markup/javascript/class.expect.txt @@ -1,11 +1,11 @@ class Car extends Vehicle { constructor(speed, cost) { - super(speed); + super(speed); var c = Symbol('cost'); - this[c] = cost; + this[c] = cost; - this.intro = `This is a car runs at + this.intro = `This is a car runs at ${speed}.`; } } diff --git a/test/markup/typescript/class.expect.txt b/test/markup/typescript/class.expect.txt index ff99191bf4..41894432d7 100644 --- a/test/markup/typescript/class.expect.txt +++ b/test/markup/typescript/class.expect.txt @@ -1,11 +1,11 @@ class Car extends Vehicle { constructor(speed, cost) { - super(speed); + super(speed); - var c = Symbol('cost'); - this[c] = cost; + var c = Symbol('cost'); + this[c] = cost; - this.intro = `This is a car runs at + this.intro = `This is a car runs at ${speed}.`; } } From a23f19e16b9a1b1d4ff6d0bf86890ee03729212d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 28 Apr 2020 17:17:13 -0400 Subject: [PATCH 082/816] (parser) Adds SHEBANG mode --- CHANGES.md | 1 + src/languages/bash.js | 21 ++++++++++++++++----- src/languages/hy.js | 7 +------ src/languages/javascript.js | 8 ++++---- src/languages/lisp.js | 6 +----- src/languages/scheme.js | 8 +------- src/languages/typescript.js | 1 + src/lib/modes.js | 21 +++++++++++++++++++++ src/lib/regex.js | 5 +++++ 9 files changed, 51 insertions(+), 27 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b693cb9a4d..e1aa893c8f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Parser Engine: +- (parser) Adds SHEBANG utility mode [Josh Goebel][] - (enh) Added `on:begin` callback for modes (#2261) [Josh Goebel][] - (enh) Added `on:end` callback for modes (#2261) [Josh Goebel][] - (enh) Added ability to programatically ignore begin and end matches (#2261) [Josh Goebel][] diff --git a/src/languages/bash.js b/src/languages/bash.js index be9c8c92fc..e96a46dfd8 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -55,11 +55,21 @@ export default function(hljs) { VAR ] }; - const SHEBANG = { - className: 'meta', - begin: /^#![^\n]+sh\s*$/, + const SH_LIKE_SHELLS = [ + "fish", + "bash", + "zsh", + "sh", + "csh", + "ksh", + "tcsh", + "dash", + "scsh", + ]; + const KNOWN_SHEBANG = hljs.SHEBANG({ + binary: `(${SH_LIKE_SHELLS.join("|")})`, relevance: 10 - }; + }); const FUNCTION = { className: 'function', begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/, @@ -98,7 +108,8 @@ export default function(hljs) { '-ne -eq -lt -gt -f -d -e -s -l -a' // relevance booster }, contains: [ - SHEBANG, + KNOWN_SHEBANG, // to catch known shells and boost relevancy + hljs.SHEBANG(), // to catch unknown shells but still highlight the shebang FUNCTION, ARITHMETIC, hljs.HASH_COMMENT_MODE, diff --git a/src/languages/hy.js b/src/languages/hy.js index 4faa8780f8..027502a6c6 100644 --- a/src/languages/hy.js +++ b/src/languages/hy.js @@ -45,11 +45,6 @@ export default function(hljs) { var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*'; var SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?'; - var SHEBANG = { - className: 'meta', - begin: '^#!', end: '$' - }; - var SYMBOL = { begin: SYMBOL_RE, relevance: 0 @@ -105,6 +100,6 @@ export default function(hljs) { name: 'Hy', aliases: ['hylang'], illegal: /\S/, - contains: [SHEBANG, LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL] + contains: [hljs.SHEBANG(), LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL] } } diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 432863359e..9f900569c2 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -97,15 +97,15 @@ export default function(hljs) { aliases: ['js', 'jsx', 'mjs', 'cjs'], keywords: KEYWORDS, contains: [ + hljs.SHEBANG({ + binary: "node", + relevance: 5 + }), { className: 'meta', relevance: 10, begin: /^\s*['"]use (strict|asm)['"]/ }, - { - className: 'meta', - begin: /^#!/, end: /$/ - }, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, HTML_TEMPLATE, diff --git a/src/languages/lisp.js b/src/languages/lisp.js index c8305f6bea..5b505cd1a5 100644 --- a/src/languages/lisp.js +++ b/src/languages/lisp.js @@ -9,10 +9,6 @@ export default function(hljs) { var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*'; var MEC_RE = '\\|[^]*?\\|'; var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|\\-)?\\d+)?'; - var SHEBANG = { - className: 'meta', - begin: '^#!', end: '$' - }; var LITERAL = { className: 'literal', begin: '\\b(t{1}|nil)\\b' @@ -97,7 +93,7 @@ export default function(hljs) { illegal: /\S/, contains: [ NUMBER, - SHEBANG, + hljs.SHEBANG(), LITERAL, STRING, COMMENT, diff --git a/src/languages/scheme.js b/src/languages/scheme.js index 335c8e14d0..df26b7cf73 100644 --- a/src/languages/scheme.js +++ b/src/languages/scheme.js @@ -50,12 +50,6 @@ export default function(hljs) { 'with-input-from-file with-output-to-file write write-char zero?' }; - var SHEBANG = { - className: 'meta', - begin: '^#!', - end: '$' - }; - var LITERAL = { className: 'literal', begin: '(#t|#f|#\\\\' + SCHEME_IDENT_RE + '|#\\\\.)' @@ -150,6 +144,6 @@ export default function(hljs) { return { name: 'Scheme', illegal: /\S/, - contains: [SHEBANG, NUMBER, STRING, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES) + contains: [hljs.SHEBANG(), NUMBER, STRING, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES) }; } diff --git a/src/languages/typescript.js b/src/languages/typescript.js index adfed257d3..f830428477 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -127,6 +127,7 @@ export default function(hljs) { aliases: ['ts'], keywords: KEYWORDS, contains: [ + hljs.SHEBANG(), { className: 'meta', begin: /^\s*['"]use strict['"]/ diff --git a/src/lib/modes.js b/src/lib/modes.js index 8acb8f0e51..602141e78a 100644 --- a/src/lib/modes.js +++ b/src/lib/modes.js @@ -1,4 +1,5 @@ import { inherit } from './utils'; +import * as regex from './regex'; // Common regexps export const IDENT_RE = '[a-zA-Z]\\w*'; @@ -8,6 +9,26 @@ export const C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+ export const BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b... export const RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~'; +export const SHEBANG = (opts = {}) => { + const beginShebang = /^#![ ]*\//; + if (opts.binary) { + opts.begin = regex.concat( + beginShebang, + /.*\b/, + opts.binary, + /\b.*/); + } + return inherit({ + className: 'meta', + begin: beginShebang, + end: /$/, + relevance: 0, + "on:begin": (m, resp) => { + if (m.index !== 0) resp.ignoreMatch(); + } + }, opts); +}; + // Common modes export const BACKSLASH_ESCAPE = { begin: '\\\\[\\s\\S]', relevance: 0 diff --git a/src/lib/regex.js b/src/lib/regex.js index c349485eaf..003dc9cbca 100644 --- a/src/lib/regex.js +++ b/src/lib/regex.js @@ -8,6 +8,11 @@ export function source(re) { return (re && re.source) || re; } +export function concat(...args) { + const joined = args.map((x) => source(x)).join(""); + return joined; +} + export function countMatchGroups(re) { return (new RegExp(re.toString() + '|')).exec('').length - 1; } From d98cd4fdce027dd0ad00badb590dc0c63a0b89ce Mon Sep 17 00:00:00 2001 From: Peter Massey-Plantinga Date: Thu, 30 Apr 2020 11:05:19 -0400 Subject: [PATCH 083/816] (yaml) Add support for inline sequences and mappings (#2513) * Use containers to match inline sequences and mappings * Add string type for inside inline elements * Handle nested inline sequences and mappings * Disallow all braces brackets and commas from strings inside inline mappings or sequences * clean up implementation * feed the linter Co-authored-by: Josh Goebel --- src/languages/yaml.js | 197 ++++++++++++++++++----------- test/markup/yaml/inline.expect.txt | 3 + test/markup/yaml/inline.txt | 3 + 3 files changed, 126 insertions(+), 77 deletions(-) create mode 100644 test/markup/yaml/inline.expect.txt create mode 100644 test/markup/yaml/inline.txt diff --git a/src/languages/yaml.js b/src/languages/yaml.js index 4fc4ba0a28..02a1d9cee2 100644 --- a/src/languages/yaml.js +++ b/src/languages/yaml.js @@ -11,7 +11,7 @@ export default function(hljs) { var LITERALS = 'true false yes no null'; // YAML spec allows non-reserved URI characters in tags. - var URI_CHARACTERS = '[\\w#;/?:@&=+$,.~*\\\'()[\\]]+' + var URI_CHARACTERS = '[\\w#;/?:@&=+$,.~*\\\'()[\\]]+'; // Define keys as starting with a word character // ...containing word chars, spaces, colons, forward-slashes, hyphens and periods @@ -21,25 +21,25 @@ export default function(hljs) { className: 'attr', variants: [ { begin: '\\w[\\w :\\/.-]*:(?=[ \t]|$)' }, - { begin: '"\\w[\\w :\\/.-]*":(?=[ \t]|$)' }, //double quoted keys - { begin: '\'\\w[\\w :\\/.-]*\':(?=[ \t]|$)' } //single quoted keys + { begin: '"\\w[\\w :\\/.-]*":(?=[ \t]|$)' }, // double quoted keys + { begin: '\'\\w[\\w :\\/.-]*\':(?=[ \t]|$)' } // single quoted keys ] }; var TEMPLATE_VARIABLES = { className: 'template-variable', variants: [ - { begin: '\{\{', end: '\}\}' }, // jinja templates Ansible - { begin: '%\{', end: '\}' } // Ruby i18n + { begin: '{{', end: '}}' }, // jinja templates Ansible + { begin: '%{', end: '}' } // Ruby i18n ] }; var STRING = { className: 'string', relevance: 0, variants: [ - {begin: /'/, end: /'/}, - {begin: /"/, end: /"/}, - {begin: /\S+/} + { begin: /'/, end: /'/ }, + { begin: /"/, end: /"/ }, + { begin: /\S+/ } ], contains: [ hljs.BACKSLASH_ESCAPE, @@ -47,85 +47,128 @@ export default function(hljs) { ] }; + // Strings inside of value containers (objects) can't contain braces, + // brackets, or commas + var CONTAINER_STRING = hljs.inherit(STRING, { + variants: [ + { begin: /'/, end: /'/ }, + { begin: /"/, end: /"/ }, + { begin: /[^\s,{}[\]]+/ } + ] + }); + var DATE_RE = '[0-9]{4}(-[0-9][0-9]){0,2}'; var TIME_RE = '([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?'; var FRACTION_RE = '(\\.[0-9]*)?'; var ZONE_RE = '([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?'; var TIMESTAMP = { className: 'number', - begin: '\\b' + DATE_RE + TIME_RE + FRACTION_RE + ZONE_RE + '\\b', - } + begin: '\\b' + DATE_RE + TIME_RE + FRACTION_RE + ZONE_RE + '\\b' + }; + + var VALUE_CONTAINER = { + end: ',', + endsWithParent: true, + excludeEnd: true, + contains: [], + keywords: LITERALS, + relevance: 0 + }; + var OBJECT = { + begin: '{', + end: '}', + contains: [VALUE_CONTAINER], + illegal: '\\n', + relevance: 0 + }; + var ARRAY = { + begin: '\\[', + end: '\\]', + contains: [VALUE_CONTAINER], + illegal: '\\n', + relevance: 0 + }; + + var MODES = [ + KEY, + { + className: 'meta', + begin: '^---\s*$', + relevance: 10 + }, + { // multi line string + // Blocks start with a | or > followed by a newline + // + // Indentation of subsequent lines must be the same to + // be considered part of the block + className: 'string', + begin: '[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*' + }, + { // Ruby/Rails erb + begin: '<%[%=-]?', + end: '[%-]?%>', + subLanguage: 'ruby', + excludeBegin: true, + excludeEnd: true, + relevance: 0 + }, + { // named tags + className: 'type', + begin: '!\\w+!' + URI_CHARACTERS + }, + // https://yaml.org/spec/1.2/spec.html#id2784064 + { // verbatim tags + className: 'type', + begin: '!<' + URI_CHARACTERS + ">" + }, + { // primary tags + className: 'type', + begin: '!' + URI_CHARACTERS + }, + { // secondary tags + className: 'type', + begin: '!!' + URI_CHARACTERS + }, + { // fragment id &ref + className: 'meta', + begin: '&' + hljs.UNDERSCORE_IDENT_RE + '$' + }, + { // fragment reference *ref + className: 'meta', + begin: '\\*' + hljs.UNDERSCORE_IDENT_RE + '$' + }, + { // array listing + className: 'bullet', + // TODO: remove |$ hack when we have proper look-ahead support + begin: '\\-(?=[ ]|$)', + relevance: 0 + }, + hljs.HASH_COMMENT_MODE, + { + beginKeywords: LITERALS, + keywords: { literal: LITERALS } + }, + TIMESTAMP, + // numbers are any valid C-style number that + // sit isolated from other words + { + className: 'number', + begin: hljs.C_NUMBER_RE + '\\b' + }, + OBJECT, + ARRAY, + STRING + ]; + + var VALUE_MODES = [...MODES]; + VALUE_MODES.pop(); + VALUE_MODES.push(CONTAINER_STRING); + VALUE_CONTAINER.contains = VALUE_MODES; return { name: 'YAML', case_insensitive: true, aliases: ['yml', 'YAML'], - contains: [ - KEY, - { - className: 'meta', - begin: '^---\s*$', - relevance: 10 - }, - { // multi line string - // Blocks start with a | or > followed by a newline - // - // Indentation of subsequent lines must be the same to - // be considered part of the block - className: 'string', - begin: '[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*', - }, - { // Ruby/Rails erb - begin: '<%[%=-]?', end: '[%-]?%>', - subLanguage: 'ruby', - excludeBegin: true, - excludeEnd: true, - relevance: 0 - }, - { // named tags - className: 'type', - begin: '!\\w+!' + URI_CHARACTERS, - }, - // https://yaml.org/spec/1.2/spec.html#id2784064 - { // verbatim tags - className: 'type', - begin: '!<' + URI_CHARACTERS + ">", - }, - { // primary tags - className: 'type', - begin: '!' + URI_CHARACTERS, - }, - { // secondary tags - className: 'type', - begin: '!!' + URI_CHARACTERS, - }, - { // fragment id &ref - className: 'meta', - begin: '&' + hljs.UNDERSCORE_IDENT_RE + '$', - }, - { // fragment reference *ref - className: 'meta', - begin: '\\*' + hljs.UNDERSCORE_IDENT_RE + '$' - }, - { // array listing - className: 'bullet', - // TODO: remove |$ hack when we have proper look-ahead support - begin: '\\-(?=[ ]|$)', - relevance: 0 - }, - hljs.HASH_COMMENT_MODE, - { - beginKeywords: LITERALS, - keywords: {literal: LITERALS} - }, - TIMESTAMP, - // numbers are any valid C-style number that - // sit isolated from other words - { - className: 'number', - begin: hljs.C_NUMBER_RE + '\\b' - }, - STRING - ] + contains: MODES }; } diff --git a/test/markup/yaml/inline.expect.txt b/test/markup/yaml/inline.expect.txt new file mode 100644 index 0000000000..d12626f0ae --- /dev/null +++ b/test/markup/yaml/inline.expect.txt @@ -0,0 +1,3 @@ +foo: [bar, bar2, [1, 2], 3] +foo: {bar: [1, 2], baz: {inside: 3}} +foo: ba{}r,ba[]z diff --git a/test/markup/yaml/inline.txt b/test/markup/yaml/inline.txt new file mode 100644 index 0000000000..8dfa15b2ea --- /dev/null +++ b/test/markup/yaml/inline.txt @@ -0,0 +1,3 @@ +foo: [bar, bar2, [1, 2], 3] +foo: {bar: [1, 2], baz: {inside: 3}} +foo: ba{}r,ba[]z From e8624ccb65cfd859a0273b58ec3897afd16a5498 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 30 Apr 2020 17:22:30 -0400 Subject: [PATCH 084/816] [enh] Add `OPTIMIZE:` and `HACK:` to comment doctags --- CHANGES.md | 1 + src/lib/modes.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e1aa893c8f..711f466e41 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Deprecations: Language Improvements: +- [enh] Add `OPTIMIZE:` and `HACK:` to the labels highlighted inside comments [Josh Goebel][] - enh(typescript/javascript/coffeescript/livescript) derive ECMAscript keywords from a common foudation (#2518) [Josh Goebel][] - enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][] - enh(javascript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Vania Kucher][] diff --git a/src/lib/modes.js b/src/lib/modes.js index 602141e78a..669968d58f 100644 --- a/src/lib/modes.js +++ b/src/lib/modes.js @@ -63,7 +63,7 @@ export const COMMENT = function(begin, end, inherits) { mode.contains.push(PHRASAL_WORDS_MODE); mode.contains.push({ className: 'doctag', - begin: '(?:TODO|FIXME|NOTE|BUG|XXX):', + begin: '(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):', relevance: 0 }); return mode; From 8f5290ee2d43e4c9c713b361fe9690b5b07c04e6 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 3 May 2020 13:56:48 -0400 Subject: [PATCH 085/816] (build) browser build is CommonJS and IIFE, no more AMD (#2511) * (build) browser build is CommonJS and IIFE (global) now * (build) dropping support for AMD, which we never truly supported properly in the first place * (build) add test to make sure browser build works as commonJS module Resolves #2505 --- .travis.yml | 2 ++ CHANGES.md | 16 ++++++++++++++++ test/builds/browser_build_as_commonjs.js | 6 ++++++ tools/build_config.js | 3 ++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/builds/browser_build_as_commonjs.js diff --git a/.travis.yml b/.travis.yml index fa61a6a0e9..67fd1364cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,5 +29,7 @@ script: npm run test else npm run test-browser + # 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/CHANGES.md b/CHANGES.md index 711f466e41..8d9201c218 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -30,6 +30,22 @@ Language Improvements: [Vania Kucher]: https://github.com/qWici +## Version 10.0.2 (pending) + +Brower build: + +- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (bug) Fix: Version 10 fails to load as CommonJS module. (#2511) [Josh Goebel][] +- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (removal) AMD module loading support has been removed. (#2511) [Josh Goebel][] + + +Parser Engine Changes: + +- ... + + +[Josh Goebel]: https://github.com/yyyc514 + + ## Version 10.0.1 Parser Engine Changes: diff --git a/test/builds/browser_build_as_commonjs.js b/test/builds/browser_build_as_commonjs.js new file mode 100644 index 0000000000..4315df2ff0 --- /dev/null +++ b/test/builds/browser_build_as_commonjs.js @@ -0,0 +1,6 @@ +const hljs = require("../../build/highlight"); + +let major = parseInt(majorVersion=hljs.versionString.split(".")) +if (major != 10) { + process.exit(1) +} diff --git a/tools/build_config.js b/tools/build_config.js index 6ce035be96..c32efe993c 100644 --- a/tools/build_config.js +++ b/tools/build_config.js @@ -29,7 +29,8 @@ module.exports = { }, output: { name: "hljs", - format: "umd", + format: "iife", + footer: "if (typeof exports === 'object' && typeof module !== 'undefined') { module.exports = hljs; }", interop: false, } }, From acbbac8876c190e738a146efc503af69c07232dd Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 3 May 2020 14:06:00 -0400 Subject: [PATCH 086/816] fix(parser) Fix freezing issue with illegal 0 width matches (#2524) * fix[parser] add edge case handle for illegal 0 width matches * add last ditch catch all that tries to detect other uncaught freezes --- CHANGES.md | 3 +-- src/highlight.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8d9201c218..e5e293e3e2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -37,10 +37,9 @@ Brower build: - [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (bug) Fix: Version 10 fails to load as CommonJS module. (#2511) [Josh Goebel][] - [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (removal) AMD module loading support has been removed. (#2511) [Josh Goebel][] - Parser Engine Changes: -- ... +- [Issue](https://github.com/highlightjs/highlight.js/issues/2522) fix(parser) Fix freez issue with illegal 0 width matches (#2524) [Josh Goebel][] [Josh Goebel]: https://github.com/yyyc514 diff --git a/src/highlight.js b/src/highlight.js index d60330fba5..07f61b6aec 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -365,6 +365,23 @@ const HLJS = function(hljs) { } } + // edge case for when illegal matches $ (end of line) which is technically + // a 0 width match but not a begin/end match so it's not caught by the + // first handler (when ignoreIllegals is true) + if (match.type === "illegal" && lexeme === "") { + // advance so we aren't stuck in an infinite loop + return 1; + } + + // infinite loops are BAD, this is a last ditch catch all. if we have a + // decent number of iterations yet our index (cursor position in our + // parsing) still 3x behind our index then something is very wrong + // so we bail + if (iterations > 100000 && iterations > match.index * 3) { + const err = new Error('potential infinite loop, way more iterations than matches'); + throw err; + } + /* Why might be find ourselves here? Only one occasion now. An end match that was triggered but could not be completed. When might this happen? When an `endSameasBegin` @@ -396,12 +413,14 @@ const HLJS = function(hljs) { var mode_buffer = ''; var relevance = 0; var index = 0; + var iterations = 0; var continueScanAtSamePosition = false; try { top.matcher.considerAll(); for (;;) { + iterations++; if (continueScanAtSamePosition) { continueScanAtSamePosition = false; // only regexes not matched previously will now be From b31cb981dd14541270389ea21c2047ba93462486 Mon Sep 17 00:00:00 2001 From: SweetPPro Date: Mon, 4 May 2020 23:32:14 +0200 Subject: [PATCH 087/816] (docs) added unicorn-rails-log as an 3rd-party language (#2528) - (docs) Add syntax highlighting for Rails Unicorn logging to supported languages. --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index ed91834344..68a9fc07ba 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -182,6 +182,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Transact-SQL | tsql | [highlightjs-tsql](https://github.com/highlightjs/highlightjs-tsql) | | Twig | twig, craftcms | | | TypeScript | typescript, ts | | +| 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) | | VBScript | vbscript, vbs | | From 33d3afe1002e27bb4d3dde88235f6ccf0159f24d Mon Sep 17 00:00:00 2001 From: Alexandre ZANNI <16578570+noraj@users.noreply.github.com> Date: Tue, 5 May 2020 18:58:20 +0200 Subject: [PATCH 088/816] (docs) fix supported languages link: it moved again! (#2533) --- docs/css-classes-reference.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/css-classes-reference.rst b/docs/css-classes-reference.rst index a75e411a50..aa4d45321d 100644 --- a/docs/css-classes-reference.rst +++ b/docs/css-classes-reference.rst @@ -136,5 +136,4 @@ Stylable classes Language names and aliases -------------------------- -The language names and aliases table has moved to `the project -README `_. +The language names and aliases table has moved to `SUPPORTED_LANGUAGES.md `_. From 9e4f2dc22aaec92237bf5c25694842ecb8795fd3 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 6 May 2020 21:32:23 -0400 Subject: [PATCH 089/816] fix(ts/js) use identifier to match potential keywords (#2519) - (parser) Adds `keywords.$pattern` key to grammar definitions - `lexemes` is now deprecated in favor of `keywords.$pattern` key - enh(typescript) use identifier to match potential keywords, preventing false positives - enh(javascript) use identifier to match potential keywords, preventing false positives --- CHANGES.md | 9 ++++-- docs/language-guide.rst | 28 ++++++++++++------- docs/mode-reference.rst | 17 +++++++---- src/highlight.js | 8 +++--- src/languages/1c.js | 14 ++++++---- src/languages/armasm.js | 2 +- src/languages/avrasm.js | 2 +- src/languages/bash.js | 2 +- src/languages/basic.js | 2 +- src/languages/clojure.js | 6 ++-- src/languages/crystal.js | 2 +- src/languages/csp.js | 2 +- src/languages/d.js | 2 +- src/languages/elixir.js | 10 +++---- src/languages/erlang.js | 9 +++--- src/languages/excel.js | 2 +- src/languages/gams.js | 6 ++-- src/languages/gcode.js | 9 +++--- src/languages/hsp.js | 6 ++-- src/languages/hy.js | 6 ++-- src/languages/isbl.js | 6 ++-- src/languages/javascript.js | 3 +- src/languages/jboss-cli.js | 2 +- src/languages/julia.js | 9 +++--- src/languages/lasso.js | 3 +- src/languages/lib/ecmascript.js | 1 + src/languages/llvm.js | 1 - src/languages/lua.js | 2 +- src/languages/makefile.js | 15 ++++++---- src/languages/mathematica.js | 8 ++++-- src/languages/maxima.js | 2 +- src/languages/mipsasm.js | 2 +- src/languages/nginx.js | 2 +- src/languages/objectivec.js | 13 +++++---- src/languages/ocaml.js | 2 +- src/languages/oxygene.js | 10 ++++--- src/languages/perl.js | 8 ++++-- src/languages/pf.js | 2 +- src/languages/php.js | 3 +- src/languages/powershell.js | 2 +- src/languages/q.js | 2 +- src/languages/r.js | 2 +- src/languages/routeros.js | 2 +- src/languages/rust.js | 2 +- src/languages/scheme.js | 6 ++-- src/languages/scilab.js | 2 +- src/languages/sml.js | 2 +- src/languages/sql.js | 2 +- src/languages/stan.js | 8 +++--- src/languages/step21.js | 2 +- src/languages/typescript.js | 9 +++--- src/languages/verilog.js | 3 +- src/languages/vim.js | 2 +- src/languages/x86asm.js | 2 +- src/languages/xl.js | 2 +- src/languages/xquery.js | 2 +- src/lib/mode_compiler.js | 16 ++++++++++- ...entifiers_that_include_keywords.expect.txt | 2 ++ .../identifiers_that_include_keywords.txt | 2 ++ 59 files changed, 181 insertions(+), 129 deletions(-) create mode 100644 test/markup/typescript/identifiers_that_include_keywords.expect.txt create mode 100644 test/markup/typescript/identifiers_that_include_keywords.txt diff --git a/CHANGES.md b/CHANGES.md index e5e293e3e2..2cf4ad9ace 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Parser Engine: +- (parser) Adds `keywords.$pattern` key to grammar definitions (#2519) [Josh Goebel][] - (parser) Adds SHEBANG utility mode [Josh Goebel][] - (enh) Added `on:begin` callback for modes (#2261) [Josh Goebel][] - (enh) Added `on:end` callback for modes (#2261) [Josh Goebel][] @@ -10,10 +11,12 @@ Parser Engine: Deprecations: -- (deprecation) `endSameAsBegin` is now deprecated. (#2261) [Josh Goebel][] +- `lexemes` is now deprecated in favor of `keywords.$pattern` key (#2519) [Josh Goebel][] +- `endSameAsBegin` is now deprecated. (#2261) [Josh Goebel][] Language Improvements: - +- enh(typescript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][] +- enh(javascript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][] - [enh] Add `OPTIMIZE:` and `HACK:` to the labels highlighted inside comments [Josh Goebel][] - enh(typescript/javascript/coffeescript/livescript) derive ECMAscript keywords from a common foudation (#2518) [Josh Goebel][] - enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][] @@ -30,7 +33,7 @@ Language Improvements: [Vania Kucher]: https://github.com/qWici -## Version 10.0.2 (pending) +## Version 10.0.2 Brower build: diff --git a/docs/language-guide.rst b/docs/language-guide.rst index 4ed26d2d96..71aa2754ac 100644 --- a/docs/language-guide.rst +++ b/docs/language-guide.rst @@ -64,7 +64,7 @@ and most interesting parsing happens inside tags. Keywords -------- -In the simple case language keywords are defined in a string, separated by space: +In the simple case language keywords can be defined with a string, separated by space: :: @@ -72,9 +72,11 @@ In the simple case language keywords are defined in a string, separated by space keywords: 'else for if while' } -Some languages have different kinds of "keywords" that might not be called as such by the language spec -but are very close to them from the point of view of a syntax highlighter. These are all sorts of "literals", "built-ins", "symbols" and such. -To define such keyword groups the attribute ``keywords`` becomes an object each property of which defines its own group of keywords: +Some languages have different kinds of "keywords" that might not be called as +such by the language spec but are very close to them from the point of view of a +syntax highlighter. These are all sorts of "literals", "built-ins", "symbols" +and such. To define such keyword groups the attribute ``keywords`` becomes an +object each property of which defines its own group of keywords: :: @@ -85,19 +87,25 @@ To define such keyword groups the attribute ``keywords`` becomes an object each } } -The group name becomes then a class name in a generated markup enabling different styling for different kinds of keywords. +The group name becomes the class name in the generated markup enabling different +themeing for different kinds of keywords. -To detect keywords highlight.js breaks the processed chunk of code into separate words — a process called lexing. -The "word" here is defined by the regexp ``[a-zA-Z][a-zA-Z0-9_]*`` that works for keywords in most languages. -Different lexing rules can be defined by the ``lexemes`` attribute: +To detect keywords highlight.js breaks the processed chunk of code into separate +words — a process called lexing. By default "words" are matched with the regexp +``\w+``, and that works well for many languages. Different lexing rules can be +defined by the magic ``$pattern`` attribute: :: { - lexemes: '-[a-z]+', - keywords: '-import -export' + keywords: { + $pattern: /-[a-z]+/, // allow keywords to begin with dash + keyword: '-import -export' + } } +Note: The older ``lexemes`` setting has been deprecated in favor of using +``keywords.$pattern``. They are functionally identical. Sub-modes --------- diff --git a/docs/mode-reference.rst b/docs/mode-reference.rst index a60400d536..afec714bb0 100644 --- a/docs/mode-reference.rst +++ b/docs/mode-reference.rst @@ -241,14 +241,19 @@ and ``endSameAsBegin: true``. .. _lexemes: -lexemes -^^^^^^^ +lexemes (now keywords.$pattern) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **type**: regexp -A regular expression that extracts individual lexemes from language text to find :ref:`keywords ` among them. -Default value is ``hljs.IDENT_RE`` which works for most languages. +A regular expression that extracts individual "words" from the code to compare +against :ref:`keywords `. The default value is ``\w+`` which works for +many languages. +Note: It's now recommmended that you use ``keywords.$pattern`` instead of +``lexemes``, as this makes it easier to keep your keyword pattern associated +with your keywords themselves, particularly if your keyword configuration is a +constant that you repeat multiple times within different modes of your grammar. .. _keywords: @@ -259,8 +264,8 @@ keywords Keyword definition comes in two forms: -* ``'for while if else weird_voodoo|10 ... '`` -- a string of space-separated keywords with an optional relevance over a pipe -* ``{'keyword': ' ... ', 'literal': ' ... '}`` -- an object whose keys are names of different kinds of keywords and values are keyword definition strings in the first form +* ``'for while if|0 else weird_voodoo|10 ... '`` -- a string of space-separated keywords with an optional relevance over a pipe +* ``{keyword: ' ... ', literal: ' ... ', $pattern: /\w+/ }`` -- an object that describes multiple sets of keywords and the pattern used to find them For detailed explanation see :doc:`Language definition guide `. diff --git a/src/highlight.js b/src/highlight.js index 07f61b6aec..38ef8e17f0 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -131,8 +131,8 @@ const HLJS = function(hljs) { } let last_index = 0; - top.lexemesRe.lastIndex = 0; - let match = top.lexemesRe.exec(mode_buffer); + top.keywordPatternRe.lastIndex = 0; + let match = top.keywordPatternRe.exec(mode_buffer); let buf = ""; while (match) { @@ -148,8 +148,8 @@ const HLJS = function(hljs) { } else { buf += match[0]; } - last_index = top.lexemesRe.lastIndex; - match = top.lexemesRe.exec(mode_buffer); + last_index = top.keywordPatternRe.lastIndex; + match = top.keywordPatternRe.exec(mode_buffer); } buf += mode_buffer.substr(last_index); emitter.addText(buf); diff --git a/src/languages/1c.js b/src/languages/1c.js index 7656f765a5..d40f539ec5 100644 --- a/src/languages/1c.js +++ b/src/languages/1c.js @@ -5,7 +5,7 @@ Description: built-in language 1C:Enterprise (v7, v8) Category: enterprise */ -export default function(hljs){ +export default function(hljs) { // общий паттерн для определения идентификаторов var UNDERSCORE_IDENT_RE = '[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+'; @@ -446,9 +446,12 @@ export default function(hljs){ // meta : инструкции препроцессора, директивы компиляции var META = { className: 'meta', - lexemes: UNDERSCORE_IDENT_RE, + begin: '#|&', end: '$', - keywords: {'meta-keyword': KEYWORD + METAKEYWORD}, + keywords: { + $pattern: UNDERSCORE_IDENT_RE, + 'meta-keyword': KEYWORD + METAKEYWORD + }, contains: [ COMMENTS ] @@ -463,7 +466,6 @@ export default function(hljs){ // function : объявление процедур и функций var FUNCTION = { className: 'function', - lexemes: UNDERSCORE_IDENT_RE, variants: [ {begin: 'процедура|функция', end: '\\)', keywords: 'процедура функция'}, {begin: 'конецпроцедуры|конецфункции', keywords: 'конецпроцедуры конецфункции'} @@ -474,9 +476,9 @@ export default function(hljs){ contains: [ { className: 'params', - lexemes: UNDERSCORE_IDENT_RE, begin: UNDERSCORE_IDENT_RE, end: ',', excludeEnd: true, endsWithParent: true, keywords: { + $pattern: UNDERSCORE_IDENT_RE, keyword: 'знач', literal: LITERAL }, @@ -496,8 +498,8 @@ export default function(hljs){ return { name: '1C:Enterprise', case_insensitive: true, - lexemes: UNDERSCORE_IDENT_RE, keywords: { + $pattern: UNDERSCORE_IDENT_RE, keyword: KEYWORD, built_in: BUILTIN, class: CLASS, diff --git a/src/languages/armasm.js b/src/languages/armasm.js index f7175f8835..a8b993534a 100644 --- a/src/languages/armasm.js +++ b/src/languages/armasm.js @@ -21,8 +21,8 @@ export default function(hljs) { name: 'ARM Assembly', case_insensitive: true, aliases: ['arm'], - lexemes: '\\.?' + hljs.IDENT_RE, keywords: { + $pattern: '\\.?' + hljs.IDENT_RE, meta: //GNU preprocs '.2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg '+ diff --git a/src/languages/avrasm.js b/src/languages/avrasm.js index da0c41506b..4d3c5add9c 100644 --- a/src/languages/avrasm.js +++ b/src/languages/avrasm.js @@ -9,8 +9,8 @@ export default function(hljs) { return { name: 'AVR Assembly', case_insensitive: true, - lexemes: '\\.?' + hljs.IDENT_RE, keywords: { + $pattern: '\\.?' + hljs.IDENT_RE, keyword: /* mnemonic */ 'adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs ' + diff --git a/src/languages/bash.js b/src/languages/bash.js index e96a46dfd8..0e52636449 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -81,8 +81,8 @@ export default function(hljs) { return { name: 'Bash', aliases: ['sh', 'zsh'], - lexemes: /\b-?[a-z\._]+\b/, keywords: { + $pattern: /\b-?[a-z\._]+\b/, keyword: 'if then else elif fi for while in do done case esac function', literal: diff --git a/src/languages/basic.js b/src/languages/basic.js index 412768219d..6b5f57e14b 100644 --- a/src/languages/basic.js +++ b/src/languages/basic.js @@ -11,8 +11,8 @@ export default function(hljs) { case_insensitive: true, illegal: '^\.', // Support explicitly typed variables that end with $%! or #. - lexemes: '[a-zA-Z][a-zA-Z0-9_\$\%\!\#]*', keywords: { + $pattern: '[a-zA-Z][a-zA-Z0-9_\$\%\!\#]*', keyword: 'ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE ' + 'CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ ' + diff --git a/src/languages/clojure.js b/src/languages/clojure.js index 5be1dfc517..cab6d2593c 100644 --- a/src/languages/clojure.js +++ b/src/languages/clojure.js @@ -7,8 +7,11 @@ Category: lisp */ export default function(hljs) { + var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\''; + var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*'; var globals = 'def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord'; var keywords = { + $pattern: SYMBOL_RE, 'builtin-name': // Clojure keywords globals + ' ' + @@ -41,8 +44,6 @@ export default function(hljs) { 'lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize' }; - var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\''; - var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*'; var SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?'; var SYMBOL = { @@ -86,7 +87,6 @@ export default function(hljs) { }; var NAME = { keywords: keywords, - lexemes: SYMBOL_RE, className: 'name', begin: SYMBOL_RE, starts: BODY }; diff --git a/src/languages/crystal.js b/src/languages/crystal.js index 58beb328e8..6cd26ff1be 100644 --- a/src/languages/crystal.js +++ b/src/languages/crystal.js @@ -11,6 +11,7 @@ export default function(hljs) { var CRYSTAL_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?'; var CRYSTAL_PATH_RE = '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?'; var CRYSTAL_KEYWORDS = { + $pattern: CRYSTAL_IDENT_RE, keyword: 'abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if ' + 'include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? ' + @@ -187,7 +188,6 @@ export default function(hljs) { return { name: 'Crystal', aliases: ['cr'], - lexemes: CRYSTAL_IDENT_RE, keywords: CRYSTAL_KEYWORDS, contains: CRYSTAL_DEFAULT_CONTAINS }; diff --git a/src/languages/csp.js b/src/languages/csp.js index 496b106621..b024ec6de3 100644 --- a/src/languages/csp.js +++ b/src/languages/csp.js @@ -11,8 +11,8 @@ export default function(hljs) { return { name: 'CSP', case_insensitive: false, - lexemes: '[a-zA-Z][a-zA-Z0-9_-]*', keywords: { + $pattern: '[a-zA-Z][a-zA-Z0-9_-]*', keyword: 'base-uri child-src connect-src default-src font-src form-action ' + 'frame-ancestors frame-src img-src media-src object-src plugin-types ' + 'report-uri sandbox script-src style-src', diff --git a/src/languages/d.js b/src/languages/d.js index 9d6e482614..b17be1696f 100644 --- a/src/languages/d.js +++ b/src/languages/d.js @@ -30,6 +30,7 @@ export default function(hljs) { * @type {Object} */ var D_KEYWORDS = { + $pattern: hljs.UNDERSCORE_IDENT_RE, keyword: 'abstract alias align asm assert auto body break byte case cast catch class ' + 'const continue debug default delete deprecated do else enum export extern final ' + @@ -245,7 +246,6 @@ export default function(hljs) { return { name: 'D', - lexemes: hljs.UNDERSCORE_IDENT_RE, keywords: D_KEYWORDS, contains: [ hljs.C_LINE_COMMENT_MODE, diff --git a/src/languages/elixir.js b/src/languages/elixir.js index e78767d6d2..70bbe16758 100644 --- a/src/languages/elixir.js +++ b/src/languages/elixir.js @@ -9,14 +9,15 @@ Website: https://elixir-lang.org export default function(hljs) { var ELIXIR_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_.]*(\\!|\\?)?'; var ELIXIR_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?'; - var ELIXIR_KEYWORDS = - 'and false then defined module in return redo retry end for true self when ' + + var ELIXIR_KEYWORDS = { + $pattern: ELIXIR_IDENT_RE, + keyword: 'and false then defined module in return redo retry end for true self when ' + 'next until do begin unless nil break not case cond alias while ensure or ' + - 'include use alias fn quote require import with|0'; + 'include use alias fn quote require import with|0' + }; var SUBST = { className: 'subst', begin: '#\\{', end: '}', - lexemes: ELIXIR_IDENT_RE, keywords: ELIXIR_KEYWORDS }; var NUMBER = { @@ -174,7 +175,6 @@ export default function(hljs) { return { name: 'Elixir', - lexemes: ELIXIR_IDENT_RE, keywords: ELIXIR_KEYWORDS, contains: ELIXIR_DEFAULT_CONTAINS }; diff --git a/src/languages/erlang.js b/src/languages/erlang.js index e289bce1fd..2cec6aecf5 100644 --- a/src/languages/erlang.js +++ b/src/languages/erlang.js @@ -136,11 +136,12 @@ export default function(hljs) { relevance: 0, excludeEnd: true, returnBegin: true, - lexemes: '-' + hljs.IDENT_RE, - keywords: - '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' + + keywords: { + $pattern: '-' + hljs.IDENT_RE, + keyword: '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' + '-import -include -include_lib -compile -define -else -endif -file -behaviour ' + - '-behavior -spec', + '-behavior -spec' + }, contains: [PARAMS] }, NUMBER, diff --git a/src/languages/excel.js b/src/languages/excel.js index 03516d12a5..9ce2df2677 100644 --- a/src/languages/excel.js +++ b/src/languages/excel.js @@ -10,9 +10,9 @@ export default function(hljs) { name: 'Excel formulae', aliases: ['xlsx', 'xls'], case_insensitive: true, - lexemes: /[a-zA-Z][\w\.]*/, // built-in functions imported from https://web.archive.org/web/20160513042710/https://support.office.com/en-us/article/Excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188 keywords: { + $pattern: /[a-zA-Z][\w\.]*/, built_in: 'ABS ACCRINT ACCRINTM ACOS ACOSH ACOT ACOTH AGGREGATE ADDRESS AMORDEGRC AMORLINC AND ARABIC AREAS ASC ASIN ASINH ATAN ATAN2 ATANH AVEDEV AVERAGE AVERAGEA AVERAGEIF AVERAGEIFS BAHTTEXT BASE BESSELI BESSELJ BESSELK BESSELY BETADIST BETA.DIST BETAINV BETA.INV BIN2DEC BIN2HEX BIN2OCT BINOMDIST BINOM.DIST BINOM.DIST.RANGE BINOM.INV BITAND BITLSHIFT BITOR BITRSHIFT BITXOR CALL CEILING CEILING.MATH CEILING.PRECISE CELL CHAR CHIDIST CHIINV CHITEST CHISQ.DIST CHISQ.DIST.RT CHISQ.INV CHISQ.INV.RT CHISQ.TEST CHOOSE CLEAN CODE COLUMN COLUMNS COMBIN COMBINA COMPLEX CONCAT CONCATENATE CONFIDENCE CONFIDENCE.NORM CONFIDENCE.T CONVERT CORREL COS COSH COT COTH COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS COUPDAYBS COUPDAYS COUPDAYSNC COUPNCD COUPNUM COUPPCD COVAR COVARIANCE.P COVARIANCE.S CRITBINOM CSC CSCH CUBEKPIMEMBER CUBEMEMBER CUBEMEMBERPROPERTY CUBERANKEDMEMBER CUBESET CUBESETCOUNT CUBEVALUE CUMIPMT CUMPRINC DATE DATEDIF DATEVALUE DAVERAGE DAY DAYS DAYS360 DB DBCS DCOUNT DCOUNTA DDB DEC2BIN DEC2HEX DEC2OCT DECIMAL DEGREES DELTA DEVSQ DGET DISC DMAX DMIN DOLLAR DOLLARDE DOLLARFR DPRODUCT DSTDEV DSTDEVP DSUM DURATION DVAR DVARP EDATE EFFECT ENCODEURL EOMONTH ERF ERF.PRECISE ERFC ERFC.PRECISE ERROR.TYPE EUROCONVERT EVEN EXACT EXP EXPON.DIST EXPONDIST FACT FACTDOUBLE FALSE|0 F.DIST FDIST F.DIST.RT FILTERXML FIND FINDB F.INV F.INV.RT FINV FISHER FISHERINV FIXED FLOOR FLOOR.MATH FLOOR.PRECISE FORECAST FORECAST.ETS FORECAST.ETS.CONFINT FORECAST.ETS.SEASONALITY FORECAST.ETS.STAT FORECAST.LINEAR FORMULATEXT FREQUENCY F.TEST FTEST FV FVSCHEDULE GAMMA GAMMA.DIST GAMMADIST GAMMA.INV GAMMAINV GAMMALN GAMMALN.PRECISE GAUSS GCD GEOMEAN GESTEP GETPIVOTDATA GROWTH HARMEAN HEX2BIN HEX2DEC HEX2OCT HLOOKUP HOUR HYPERLINK HYPGEOM.DIST HYPGEOMDIST IF IFERROR IFNA IFS IMABS IMAGINARY IMARGUMENT IMCONJUGATE IMCOS IMCOSH IMCOT IMCSC IMCSCH IMDIV IMEXP IMLN IMLOG10 IMLOG2 IMPOWER IMPRODUCT IMREAL IMSEC IMSECH IMSIN IMSINH IMSQRT IMSUB IMSUM IMTAN INDEX INDIRECT INFO INT INTERCEPT INTRATE IPMT IRR ISBLANK ISERR ISERROR ISEVEN ISFORMULA ISLOGICAL ISNA ISNONTEXT ISNUMBER ISODD ISREF ISTEXT ISO.CEILING ISOWEEKNUM ISPMT JIS KURT LARGE LCM LEFT LEFTB LEN LENB LINEST LN LOG LOG10 LOGEST LOGINV LOGNORM.DIST LOGNORMDIST LOGNORM.INV LOOKUP LOWER MATCH MAX MAXA MAXIFS MDETERM MDURATION MEDIAN MID MIDBs MIN MINIFS MINA MINUTE MINVERSE MIRR MMULT MOD MODE MODE.MULT MODE.SNGL MONTH MROUND MULTINOMIAL MUNIT N NA NEGBINOM.DIST NEGBINOMDIST NETWORKDAYS NETWORKDAYS.INTL NOMINAL NORM.DIST NORMDIST NORMINV NORM.INV NORM.S.DIST NORMSDIST NORM.S.INV NORMSINV NOT NOW NPER NPV NUMBERVALUE OCT2BIN OCT2DEC OCT2HEX ODD ODDFPRICE ODDFYIELD ODDLPRICE ODDLYIELD OFFSET OR PDURATION PEARSON PERCENTILE.EXC PERCENTILE.INC PERCENTILE PERCENTRANK.EXC PERCENTRANK.INC PERCENTRANK PERMUT PERMUTATIONA PHI PHONETIC PI PMT POISSON.DIST POISSON POWER PPMT PRICE PRICEDISC PRICEMAT PROB PRODUCT PROPER PV QUARTILE QUARTILE.EXC QUARTILE.INC QUOTIENT RADIANS RAND RANDBETWEEN RANK.AVG RANK.EQ RANK RATE RECEIVED REGISTER.ID REPLACE REPLACEB REPT RIGHT RIGHTB ROMAN ROUND ROUNDDOWN ROUNDUP ROW ROWS RRI RSQ RTD SEARCH SEARCHB SEC SECH SECOND SERIESSUM SHEET SHEETS SIGN SIN SINH SKEW SKEW.P SLN SLOPE SMALL SQL.REQUEST SQRT SQRTPI STANDARDIZE STDEV STDEV.P STDEV.S STDEVA STDEVP STDEVPA STEYX SUBSTITUTE SUBTOTAL SUM SUMIF SUMIFS SUMPRODUCT SUMSQ SUMX2MY2 SUMX2PY2 SUMXMY2 SWITCH SYD T TAN TANH TBILLEQ TBILLPRICE TBILLYIELD T.DIST T.DIST.2T T.DIST.RT TDIST TEXT TEXTJOIN TIME TIMEVALUE T.INV T.INV.2T TINV TODAY TRANSPOSE TREND TRIM TRIMMEAN TRUE|0 TRUNC T.TEST TTEST TYPE UNICHAR UNICODE UPPER VALUE VAR VAR.P VAR.S VARA VARP VARPA VDB VLOOKUP WEBSERVICE WEEKDAY WEEKNUM WEIBULL WEIBULL.DIST WORKDAY WORKDAY.INTL XIRR XNPV XOR YEAR YEARFRAC YIELD YIELDDISC YIELDMAT Z.TEST ZTEST' }, contains: [ diff --git a/src/languages/gams.js b/src/languages/gams.js index 597cbb8040..e94e045c70 100644 --- a/src/languages/gams.js +++ b/src/languages/gams.js @@ -10,14 +10,14 @@ export default function (hljs) { var KEYWORDS = { - 'keyword': + 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': + 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 ' + diff --git a/src/languages/gcode.js b/src/languages/gcode.js index abf8cff9eb..93b86adde4 100644 --- a/src/languages/gcode.js +++ b/src/languages/gcode.js @@ -8,9 +8,11 @@ export default function(hljs) { var GCODE_IDENT_RE = '[A-Z_][A-Z0-9_.]*'; var GCODE_CLOSE_RE = '\\%'; - var GCODE_KEYWORDS = - 'IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT ' + - 'EQ LT GT NE GE LE OR XOR'; + var GCODE_KEYWORDS = { + $pattern: GCODE_IDENT_RE, + keyword: 'IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT ' + + 'EQ LT GT NE GE LE OR XOR' + }; var GCODE_START = { className: 'meta', begin: '([O])([0-9]+)' @@ -61,7 +63,6 @@ export default function(hljs) { // Some implementations (CNC controls) of G-code are interoperable with uppercase and lowercase letters seamlessly. // However, most prefer all uppercase and uppercase is customary. case_insensitive: true, - lexemes: GCODE_IDENT_RE, keywords: GCODE_KEYWORDS, contains: [ { diff --git a/src/languages/hsp.js b/src/languages/hsp.js index b9477d7e74..72d6b01e43 100644 --- a/src/languages/hsp.js +++ b/src/languages/hsp.js @@ -9,8 +9,10 @@ export default function(hljs) { return { name: 'HSP', 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', + keywords: { + $pattern: /[\w._]+/, + keyword: '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' + }, contains: [ hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, diff --git a/src/languages/hy.js b/src/languages/hy.js index 027502a6c6..b86d6f787f 100644 --- a/src/languages/hy.js +++ b/src/languages/hy.js @@ -7,7 +7,10 @@ Category: lisp */ export default function(hljs) { + var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\''; + var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*'; var keywords = { + $pattern: SYMBOL_RE, 'builtin-name': // keywords '!= % %= & &= * ** **= *= *map ' + @@ -41,8 +44,6 @@ export default function(hljs) { 'xi xor yield yield-from zero? zip zip-longest | |= ~' }; - var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\''; - var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*'; var SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?'; var SYMBOL = { @@ -86,7 +87,6 @@ export default function(hljs) { }; var NAME = { keywords: keywords, - lexemes: SYMBOL_RE, className: 'name', begin: SYMBOL_RE, starts: BODY }; diff --git a/src/languages/isbl.js b/src/languages/isbl.js index 8e630221b9..33e5287c7d 100644 --- a/src/languages/isbl.js +++ b/src/languages/isbl.js @@ -3102,6 +3102,7 @@ export default function(hljs) { // keywords : ключевые слова var KEYWORDS = { + $pattern: UNDERSCORE_IDENT_RE, keyword: KEYWORD, built_in: BUILTIN, class: CLASS, @@ -3126,7 +3127,6 @@ export default function(hljs) { // variables : переменные var VARIABLES = { className: "variable", - lexemes: UNDERSCORE_IDENT_RE, keywords: KEYWORDS, begin: UNDERSCORE_IDENT_RE, relevance: 0, @@ -3138,8 +3138,8 @@ export default function(hljs) { var TITLE_MODE = { className: "title", - lexemes: UNDERSCORE_IDENT_RE, keywords: { + $pattern: UNDERSCORE_IDENT_RE, built_in: system_functions, }, begin: FUNCTION_TITLE, @@ -3154,7 +3154,6 @@ export default function(hljs) { begin: FUNCTION_TITLE, end: "\\)$", returnBegin: true, - lexemes: UNDERSCORE_IDENT_RE, keywords: KEYWORDS, illegal: "[\\[\\]\\|\\$\\?%,~#@]", contains: [TITLE_MODE, METHODS, VARIABLES, STRINGS, NUMBERS, COMMENTS], @@ -3164,7 +3163,6 @@ export default function(hljs) { name: 'ISBL', aliases: ["isbl"], case_insensitive: true, - lexemes: UNDERSCORE_IDENT_RE, keywords: KEYWORDS, illegal: "\\$|\\?|%|,|;$|~|#|@|', end: '' @@ -16,8 +17,8 @@ export default function(hljs) { begin: /<[A-Za-z0-9\\._:-]+/, end: /\/[A-Za-z0-9\\._:-]+>|\/>/ }; - var IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; var KEYWORDS = { + $pattern: ECMAScript.IDENT_RE, keyword: ECMAScript.KEYWORDS.join(" "), literal: ECMAScript.LITERALS.join(" "), built_in: ECMAScript.BUILT_INS.join(" ") diff --git a/src/languages/jboss-cli.js b/src/languages/jboss-cli.js index 7328c4d49f..6def5bbb3a 100644 --- a/src/languages/jboss-cli.js +++ b/src/languages/jboss-cli.js @@ -35,8 +35,8 @@ export default function (hljs) { return { name: 'JBoss CLI', aliases: ['wildfly-cli'], - lexemes: '[a-z\-]+', keywords: { + $pattern: '[a-z\-]+', keyword: 'alias batch cd clear command connect connection-factory connection-info data-source deploy ' + 'deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls ' + 'patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias ' + diff --git a/src/languages/julia.js b/src/languages/julia.js index ec40e0d9ab..518284fcc6 100644 --- a/src/languages/julia.js +++ b/src/languages/julia.js @@ -12,7 +12,11 @@ export default function(hljs) { // built-ins) are automatically generated from Julia v0.6 itself through // the following scripts for each. + // ref: http://julia.readthedocs.org/en/latest/manual/variables/#allowed-variable-names + var VARIABLE_NAME_RE = '[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*'; + var KEYWORDS = { + $pattern: VARIABLE_NAME_RE, // # keyword generator, multi-word keywords handled manually below // foreach(println, ["in", "isa", "where"]) // for kw in Base.REPLCompletions.complete_keyword("") @@ -81,12 +85,9 @@ export default function(hljs) { 'VersionNumber Void WeakKeyDict WeakRef WorkerConfig WorkerPool ' }; - // ref: http://julia.readthedocs.org/en/latest/manual/variables/#allowed-variable-names - var VARIABLE_NAME_RE = '[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*'; - // placeholder for recursive self-reference var DEFAULT = { - lexemes: VARIABLE_NAME_RE, keywords: KEYWORDS, illegal: /<\// + keywords: KEYWORDS, illegal: /<\// }; // ref: http://julia.readthedocs.org/en/latest/manual/integers-and-floating-point-numbers/ diff --git a/src/languages/lasso.js b/src/languages/lasso.js index 24cc5a93ba..eb3439a938 100644 --- a/src/languages/lasso.js +++ b/src/languages/lasso.js @@ -10,6 +10,7 @@ export default function(hljs) { var LASSO_ANGLE_RE = '<\\?(lasso(script)?|=)'; var LASSO_CLOSE_RE = '\\]|\\?>'; var LASSO_KEYWORDS = { + $pattern: LASSO_IDENT_RE + '|&[lg]t;', literal: 'true false none minimal full all void and or not ' + 'bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft', @@ -116,7 +117,6 @@ export default function(hljs) { name: 'Lasso', aliases: ['ls', 'lassoscript'], case_insensitive: true, - lexemes: LASSO_IDENT_RE + '|&[lg]t;', keywords: LASSO_KEYWORDS, contains: [ { @@ -137,7 +137,6 @@ export default function(hljs) { begin: '\\[no_square_brackets', starts: { end: '\\[/no_square_brackets\\]', // not implemented in the language - lexemes: LASSO_IDENT_RE + '|&[lg]t;', keywords: LASSO_KEYWORDS, contains: [ { diff --git a/src/languages/lib/ecmascript.js b/src/languages/lib/ecmascript.js index 0e80f2c40c..b80f24d480 100644 --- a/src/languages/lib/ecmascript.js +++ b/src/languages/lib/ecmascript.js @@ -1,3 +1,4 @@ +export const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; const KEYWORDS = [ "as", // for exports "in", diff --git a/src/languages/llvm.js b/src/languages/llvm.js index a014f24fb9..21711e88a7 100644 --- a/src/languages/llvm.js +++ b/src/languages/llvm.js @@ -10,7 +10,6 @@ export default function(hljs) { var identifier = '([-a-zA-Z$._][\\w\\-$.]*)'; return { name: 'LLVM IR', - //lexemes: '[.%]?' + hljs.IDENT_RE, keywords: 'begin end true false declare define global ' + 'constant private linker_private internal ' + diff --git a/src/languages/lua.js b/src/languages/lua.js index 29935a1af9..48bb928b04 100644 --- a/src/languages/lua.js +++ b/src/languages/lua.js @@ -26,8 +26,8 @@ export default function(hljs) { ]; return { name: 'Lua', - lexemes: hljs.UNDERSCORE_IDENT_RE, keywords: { + $pattern: hljs.UNDERSCORE_IDENT_RE, 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: diff --git a/src/languages/makefile.js b/src/languages/makefile.js index 3d7abbadef..2f021eb406 100644 --- a/src/languages/makefile.js +++ b/src/languages/makefile.js @@ -52,8 +52,10 @@ export default function(hljs) { var META = { className: 'meta', begin: /^\.PHONY:/, end: /$/, - keywords: {'meta-keyword': '.PHONY'}, - lexemes: /[\.\w]+/ + keywords: { + $pattern: /[\.\w]+/, + 'meta-keyword': '.PHONY' + } }; /* Targets */ var TARGET = { @@ -64,10 +66,11 @@ export default function(hljs) { return { name: 'Makefile', aliases: ['mk', 'mak'], - keywords: - 'define endef undefine ifdef ifndef ifeq ifneq else endif ' + - 'include -include sinclude override export unexport private vpath', - lexemes: /[\w-]+/, + keywords: { + $pattern: /[\w-]+/, + keyword: 'define endef undefine ifdef ifndef ifeq ifneq else endif ' + + 'include -include sinclude override export unexport private vpath' + }, contains: [ hljs.HASH_COMMENT_MODE, VARIABLE, diff --git a/src/languages/mathematica.js b/src/languages/mathematica.js index db85a58c1d..789b6e8345 100644 --- a/src/languages/mathematica.js +++ b/src/languages/mathematica.js @@ -10,7 +10,6 @@ export default function(hljs) { return { name: 'Mathematica', aliases: ['mma', 'wl'], - lexemes: '(\\$|\\b)' + hljs.IDENT_RE + '\\b', // // The list of "keywords" (System` symbols) was determined by evaluating the following Wolfram Language code in Mathematica 12.0: // @@ -21,7 +20,9 @@ export default function(hljs) { // StringStartsQ[#, CharacterRange["A", "Z"] | "$"] &], // First[Characters[#]] &]], " +\n"] // - keywords: 'AASTriangle AbelianGroup Abort AbortKernels AbortProtect AbortScheduledTask Above Abs AbsArg AbsArgPlot Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AcceptanceThreshold AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Activate Active ActiveClassification ActiveClassificationObject ActiveItem ActivePrediction ActivePredictionObject ActiveStyle AcyclicGraphQ AddOnHelpPath AddSides AddTo AddToSearchIndex AddUsers AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AdministrativeDivisionData AffineHalfSpace AffineSpace AffineStateSpaceModel AffineTransform After AggregatedEntityClass AggregationLayer AircraftData AirportData AirPressureData AirTemperatureData AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowAdultContent AllowedCloudExtraParameters AllowedCloudParameterExtensions AllowedDimensions AllowedFrequencyRange AllowedHeads AllowGroupClose AllowIncomplete AllowInlineCells AllowKernelInitialization AllowLooseGrammar AllowReverseGroupClose AllowScriptLevelChange AllTrue Alphabet AlphabeticOrder AlphabeticSort AlphaChannel AlternateImage AlternatingFactorial AlternatingGroup AlternativeHypothesis Alternatives AltitudeMethod AmbientLight AmbiguityFunction AmbiguityList Analytic AnatomyData AnatomyForm AnatomyPlot3D AnatomySkinStyle AnatomyStyling AnchoredSearch And AndersonDarlingTest AngerJ AngleBisector AngleBracket AnglePath AnglePath3D AngleVector AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning AnimationRunTime AnimationTimeIndex Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotate Annotation AnnotationDelete AnnotationNames AnnotationRules AnnotationValue Annuity AnnuityDue Annulus AnomalyDetection AnomalyDetectorFunction Anonymous Antialiasing AntihermitianMatrixQ Antisymmetric AntisymmetricMatrixQ Antonyms AnyOrder AnySubset AnyTrue Apart ApartSquareFree APIFunction Appearance AppearanceElements AppearanceRules AppellF1 Append AppendCheck AppendLayer AppendTo ApplicationIdentificationKey Apply ApplySides ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcCurvature ARCHProcess ArcLength ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Area Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess Around AroundReplace ARProcess Array ArrayComponents ArrayDepth ArrayFilter ArrayFlatten ArrayMesh ArrayPad ArrayPlot ArrayQ ArrayResample ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads ASATriangle Ask AskAppend AskConfirm AskDisplay AskedQ AskedValue AskFunction AskState AskTemplateDisplay AspectRatio AspectRatioFixed Assert AssociateTo Association AssociationFormat AssociationMap AssociationQ AssociationThread AssumeDeterministic Assuming Assumptions AstronomicalData AsymptoticDSolveValue AsymptoticEqual AsymptoticEquivalent AsymptoticGreater AsymptoticGreaterEqual AsymptoticIntegrate AsymptoticLess AsymptoticLessEqual AsymptoticOutputTracker AsymptoticRSolveValue AsymptoticSolve AsymptoticSum Asynchronous AsynchronousTaskObject AsynchronousTasks Atom AtomCoordinates AtomCount AtomDiagramCoordinates AtomList AtomQ AttentionLayer Attributes Audio AudioAmplify AudioAnnotate AudioAnnotationLookup AudioBlockMap AudioCapture AudioChannelAssignment AudioChannelCombine AudioChannelMix AudioChannels AudioChannelSeparate AudioData AudioDelay AudioDelete AudioDevice AudioDistance AudioFade AudioFrequencyShift AudioGenerator AudioIdentify AudioInputDevice AudioInsert AudioIntervals AudioJoin AudioLabel AudioLength AudioLocalMeasurements AudioLooping AudioLoudness AudioMeasurements AudioNormalize AudioOutputDevice AudioOverlay AudioPad AudioPan AudioPartition AudioPause AudioPitchShift AudioPlay AudioPlot AudioQ AudioRecord AudioReplace AudioResample AudioReverb AudioSampleRate AudioSpectralMap AudioSpectralTransformation AudioSplit AudioStop AudioStream AudioStreams AudioTimeStretch AudioTrim AudioType AugmentedPolyhedron AugmentedSymmetricPolynomial Authenticate Authentication AuthenticationDialog AutoAction Autocomplete AutocompletionFunction AutoCopy AutocorrelationTest AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutoQuoteCharacters AutoRefreshed AutoRemove AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords AutoSubmitting Axes AxesEdge AxesLabel AxesOrigin AxesStyle AxiomaticTheory Axis ' + + keywords: { + $pattern: '(\\$|\\b)' + hljs.IDENT_RE + '\\b', + keyword: 'AASTriangle AbelianGroup Abort AbortKernels AbortProtect AbortScheduledTask Above Abs AbsArg AbsArgPlot Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AcceptanceThreshold AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Activate Active ActiveClassification ActiveClassificationObject ActiveItem ActivePrediction ActivePredictionObject ActiveStyle AcyclicGraphQ AddOnHelpPath AddSides AddTo AddToSearchIndex AddUsers AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AdministrativeDivisionData AffineHalfSpace AffineSpace AffineStateSpaceModel AffineTransform After AggregatedEntityClass AggregationLayer AircraftData AirportData AirPressureData AirTemperatureData AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowAdultContent AllowedCloudExtraParameters AllowedCloudParameterExtensions AllowedDimensions AllowedFrequencyRange AllowedHeads AllowGroupClose AllowIncomplete AllowInlineCells AllowKernelInitialization AllowLooseGrammar AllowReverseGroupClose AllowScriptLevelChange AllTrue Alphabet AlphabeticOrder AlphabeticSort AlphaChannel AlternateImage AlternatingFactorial AlternatingGroup AlternativeHypothesis Alternatives AltitudeMethod AmbientLight AmbiguityFunction AmbiguityList Analytic AnatomyData AnatomyForm AnatomyPlot3D AnatomySkinStyle AnatomyStyling AnchoredSearch And AndersonDarlingTest AngerJ AngleBisector AngleBracket AnglePath AnglePath3D AngleVector AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning AnimationRunTime AnimationTimeIndex Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotate Annotation AnnotationDelete AnnotationNames AnnotationRules AnnotationValue Annuity AnnuityDue Annulus AnomalyDetection AnomalyDetectorFunction Anonymous Antialiasing AntihermitianMatrixQ Antisymmetric AntisymmetricMatrixQ Antonyms AnyOrder AnySubset AnyTrue Apart ApartSquareFree APIFunction Appearance AppearanceElements AppearanceRules AppellF1 Append AppendCheck AppendLayer AppendTo ApplicationIdentificationKey Apply ApplySides ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcCurvature ARCHProcess ArcLength ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Area Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess Around AroundReplace ARProcess Array ArrayComponents ArrayDepth ArrayFilter ArrayFlatten ArrayMesh ArrayPad ArrayPlot ArrayQ ArrayResample ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads ASATriangle Ask AskAppend AskConfirm AskDisplay AskedQ AskedValue AskFunction AskState AskTemplateDisplay AspectRatio AspectRatioFixed Assert AssociateTo Association AssociationFormat AssociationMap AssociationQ AssociationThread AssumeDeterministic Assuming Assumptions AstronomicalData AsymptoticDSolveValue AsymptoticEqual AsymptoticEquivalent AsymptoticGreater AsymptoticGreaterEqual AsymptoticIntegrate AsymptoticLess AsymptoticLessEqual AsymptoticOutputTracker AsymptoticRSolveValue AsymptoticSolve AsymptoticSum Asynchronous AsynchronousTaskObject AsynchronousTasks Atom AtomCoordinates AtomCount AtomDiagramCoordinates AtomList AtomQ AttentionLayer Attributes Audio AudioAmplify AudioAnnotate AudioAnnotationLookup AudioBlockMap AudioCapture AudioChannelAssignment AudioChannelCombine AudioChannelMix AudioChannels AudioChannelSeparate AudioData AudioDelay AudioDelete AudioDevice AudioDistance AudioFade AudioFrequencyShift AudioGenerator AudioIdentify AudioInputDevice AudioInsert AudioIntervals AudioJoin AudioLabel AudioLength AudioLocalMeasurements AudioLooping AudioLoudness AudioMeasurements AudioNormalize AudioOutputDevice AudioOverlay AudioPad AudioPan AudioPartition AudioPause AudioPitchShift AudioPlay AudioPlot AudioQ AudioRecord AudioReplace AudioResample AudioReverb AudioSampleRate AudioSpectralMap AudioSpectralTransformation AudioSplit AudioStop AudioStream AudioStreams AudioTimeStretch AudioTrim AudioType AugmentedPolyhedron AugmentedSymmetricPolynomial Authenticate Authentication AuthenticationDialog AutoAction Autocomplete AutocompletionFunction AutoCopy AutocorrelationTest AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutoQuoteCharacters AutoRefreshed AutoRemove AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords AutoSubmitting Axes AxesEdge AxesLabel AxesOrigin AxesStyle AxiomaticTheory Axis ' + 'BabyMonsterGroupB Back Background BackgroundAppearance BackgroundTasksSettings Backslash Backsubstitution Backward Ball Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarcodeImage BarcodeRecognize BaringhausHenzeTest BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseDecode BaseEncode BaseForm Baseline BaselinePosition BaseStyle BasicRecurrentLayer BatchNormalizationLayer BatchSize BatesDistribution BattleLemarieWavelet BayesianMaximization BayesianMaximizationObject BayesianMinimization BayesianMinimizationObject Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized Between BetweennessCentrality BeveledPolyhedron BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryDeserialize BinaryDistance BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinarySerialize BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BiquadraticFilterModel BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor BiweightLocation BiweightMidvariance Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockchainAddressData BlockchainBase BlockchainBlockData BlockchainContractValue BlockchainData BlockchainGet BlockchainKeyEncode BlockchainPut BlockchainTokenData BlockchainTransaction BlockchainTransactionData BlockchainTransactionSign BlockchainTransactionSubmit BlockMap BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bond BondCount BondList BondQ Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms BooleanQ BooleanRegion Booleans BooleanStrings BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryDiscretizeGraphics BoundaryDiscretizeRegion BoundaryMesh BoundaryMeshRegion BoundaryMeshRegionQ BoundaryStyle BoundedRegionQ BoundingRegion Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxObject BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break BridgeData BrightnessEqualize BroadcastStationData Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurve3DBoxOptions BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BSplineSurface3DBoxOptions BubbleChart BubbleChart3D BubbleScale BubbleSizes BuildingData BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteArray ByteArrayFormat ByteArrayQ ByteArrayToString ByteCount ByteOrdering ' + 'C CachedValue CacheGraphics CachePersistence CalendarConvert CalendarData CalendarType Callout CalloutMarker CalloutStyle CallPacket CanberraDistance Cancel CancelButton CandlestickChart CanonicalGraph CanonicalizePolygon CanonicalizePolyhedron CanonicalName CanonicalWarpingCorrespondence CanonicalWarpingDistance CantorMesh CantorStaircase Cap CapForm CapitalDifferentialD Capitalize CapsuleShape CaptureRunning CardinalBSplineBasis CarlemanLinearize CarmichaelLambda CaseOrdering Cases CaseSensitive Cashflow Casoratian Catalan CatalanNumber Catch Catenate CatenateLayer CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling CelestialSystem Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEvaluationLanguage CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellLabelStyle CellLabelTemplate CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterArray CenterDot CentralFeature CentralMoment CentralMomentGeneratingFunction Cepstrogram CepstrogramArray CepstrumArray CForm ChampernowneNumber ChangeOptions ChannelBase ChannelBrokerAction ChannelDatabin ChannelHistoryLength ChannelListen ChannelListener ChannelListeners ChannelListenerWait ChannelObject ChannelPreSendFunction ChannelReceiverFunction ChannelSend ChannelSubscribers ChanVeseBinarize Character CharacterCounts CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterName CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop ChromaticityPlot ChromaticityPlot3D ChromaticPolynomial Circle CircleBox CircleDot CircleMinus CirclePlus CirclePoints CircleThrough CircleTimes CirculantGraph CircularOrthogonalMatrixDistribution CircularQuaternionMatrixDistribution CircularRealMatrixDistribution CircularSymplecticMatrixDistribution CircularUnitaryMatrixDistribution Circumsphere CityData ClassifierFunction ClassifierInformation ClassifierMeasurements ClassifierMeasurementsObject Classify ClassPriors Clear ClearAll ClearAttributes ClearCookies ClearPermissions ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipPlanesStyle ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent CloudAccountData CloudBase CloudConnect CloudDeploy CloudDirectory CloudDisconnect CloudEvaluate CloudExport CloudExpression CloudExpressions CloudFunction CloudGet CloudImport CloudLoggingData CloudObject CloudObjectInformation CloudObjectInformationData CloudObjectNameFormat CloudObjects CloudObjectURLType CloudPublish CloudPut CloudRenderingMethod CloudSave CloudShare CloudSubmit CloudSymbol CloudUnshare ClusterClassify ClusterDissimilarityFunction ClusteringComponents ClusteringTree CMYKColor Coarse CodeAssistOptions Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorBalance ColorCombine ColorConvert ColorCoverage ColorData ColorDataFunction ColorDetect ColorDistance ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQ ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorsNear ColorSpace ColorToneMapping Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CombinedEntityClass CombinerFunction CometData CommonDefaultFormatTypes Commonest CommonestFilter CommonName CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompanyData CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledCodeFunction CompiledFunction CompilerOptions Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComplexListPlot ComplexPlot ComplexPlot3D ComponentMeasurements ComponentwiseContextMenu Compose ComposeList ComposeSeries CompositeQ Composition CompoundElement CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData ComputeUncertainty Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath ConformAudio ConformImages Congruent ConicHullRegion ConicHullRegion3DBox ConicHullRegionBox ConicOptimization Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphComponents ConnectedGraphQ ConnectedMeshComponents ConnectedMoleculeComponents ConnectedMoleculeQ ConnectionSettings ConnectLibraryCallbackFunction ConnectSystemModelComponents ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray ConstantArrayLayer ConstantImage ConstantPlusLayer ConstantRegionQ Constants ConstantTimesLayer ConstellationData ConstrainedMax ConstrainedMin Construct Containing ContainsAll ContainsAny ContainsExactly ContainsNone ContainsOnly ContentFieldOptions ContentLocationFunction ContentObject ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTask ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean ContrastiveLossLayer Control ControlActive ControlAlignment ControlGroupContentsBox ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket ConvexHullMesh ConvexPolygonQ ConvexPolyhedronQ ConvolutionLayer Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CookieFunction Cookies CoordinateBoundingBox CoordinateBoundingBoxArray CoordinateBounds CoordinateBoundsArray CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDatabin CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CountDistinct CountDistinctBy CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Counts CountsBy Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateCellID CreateChannel CreateCloudExpression CreateDatabin CreateDataSystemModel CreateDialog CreateDirectory CreateDocument CreateFile CreateIntermediateDirectories CreateManagedLibraryExpression CreateNotebook CreatePalette CreatePalettePacket CreatePermissionsGroup CreateScheduledTask CreateSearchIndex CreateSystemModel CreateTemporary CreateUUID CreateWindow CriterionFunction CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossEntropyLossLayer CrossingCount CrossingDetect CrossingPolygon CrossMatrix Csc Csch CTCLossLayer Cube CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrencyConvert CurrentDate CurrentImage CurrentlySpeakingPacket CurrentNotebookImage CurrentScreenImage CurrentValue Curry CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition ' + 'D DagumDistribution DamData DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DatabaseConnect DatabaseDisconnect DatabaseReference Databin DatabinAdd DatabinRemove Databins DatabinUpload DataCompression DataDistribution DataRange DataReversed Dataset Date DateBounds Dated DateDelimiters DateDifference DatedUnit DateFormat DateFunction DateHistogram DateList DateListLogPlot DateListPlot DateListStepPlot DateObject DateObjectQ DateOverlapsQ DatePattern DatePlus DateRange DateReduction DateString DateTicksFormat DateValue DateWithinQ DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayHemisphere DaylightQ DayMatchQ DayName DayNightTerminator DayPlus DayRange DayRound DeBruijnGraph DeBruijnSequence Debug DebugTag Decapitalize Decimal DecimalForm DeclareKnownSymbols DeclarePackage Decompose DeconvolutionLayer Decrement Decrypt DecryptFile DedekindEta DeepSpaceProbeData Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultPrintPrecision DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValue DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod DefineResourceFunction Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic DEigensystem DEigenvalues Deinitialization Del DelaunayMesh Delayed Deletable Delete DeleteAnomalies DeleteBorderComponents DeleteCases DeleteChannel DeleteCloudExpression DeleteContents DeleteDirectory DeleteDuplicates DeleteDuplicatesBy DeleteFile DeleteMissing DeleteObject DeletePermissionsKey DeleteSearchIndex DeleteSmallComponents DeleteStopwords DeleteWithContents DeletionWarning DelimitedArray DelimitedSequence Delimiter DelimiterFlashTime DelimiterMatching Delimiters DeliveryFunction Dendrogram Denominator DensityGraphics DensityHistogram DensityPlot DensityPlot3D DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DerivedKey DescriptorStateSpace DesignMatrix DestroyAfterEvaluation Det DeviceClose DeviceConfigure DeviceExecute DeviceExecuteAsynchronous DeviceObject DeviceOpen DeviceOpenQ DeviceRead DeviceReadBuffer DeviceReadLatest DeviceReadList DeviceReadTimeSeries Devices DeviceStreams DeviceWrite DeviceWriteBuffer DGaussianWavelet DiacriticalPositioning Diagonal DiagonalizableMatrixQ DiagonalMatrix DiagonalMatrixQ Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DictionaryWordQ DifferenceDelta DifferenceOrder DifferenceQuotient DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitalSignature DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralAngle DihedralGroup Dilation DimensionalCombinations DimensionalMeshComponents DimensionReduce DimensionReducerFunction DimensionReduction Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletBeta DirichletCharacter DirichletCondition DirichletConvolve DirichletDistribution DirichletEta DirichletL DirichletLambda DirichletTransform DirichletWindow DisableConsolePrintPacket DisableFormatting DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLimit DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscreteMaxLimit DiscreteMinLimit DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform DiscreteWaveletTransform DiscretizeGraphics DiscretizeRegion Discriminant DisjointQ Disjunction Disk DiskBox DiskMatrix DiskSegment Dispatch DispatchQ DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceMatrix DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers DivideSides Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentGenerator DocumentGeneratorInformation DocumentGeneratorInformationData DocumentGenerators DocumentNotebook DocumentWeightingRules Dodecahedron DomainRegistrationInformation DominantColors DOSTextFormat Dot DotDashed DotEqual DotLayer DotPlusLayer Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DropoutLayer DSolve DSolveValue Dt DualLinearProgramming DualPolyhedron DualSystemsModel DumpGet DumpSave DuplicateFreeQ Duration Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicGeoGraphics DynamicImage DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions ' + @@ -47,7 +48,8 @@ export default function(hljs) { 'XMLElement XMLObject XMLTemplate Xnor Xor XYZColor ' + 'Yellow Yesterday YuleDissimilarity ' + 'ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZIPCodeData ZipfDistribution ZoomCenter ZoomFactor ZTest ZTransform ' + - '$Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AllowExternalChannelFunctions $AssertFunction $Assumptions $AsynchronousTask $AudioInputDevices $AudioOutputDevices $BaseDirectory $BatchInput $BatchOutput $BlockchainBase $BoxForms $ByteOrdering $CacheBaseDirectory $Canceled $ChannelBase $CharacterEncoding $CharacterEncodings $CloudBase $CloudConnected $CloudCreditsAvailable $CloudEvaluation $CloudExpressionBase $CloudObjectNameFormat $CloudObjectURLType $CloudRootDirectory $CloudSymbolBase $CloudUserID $CloudUserUUID $CloudVersion $CloudVersionNumber $CloudWolframEngineVersionNumber $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $Cookies $CookieStore $CreationDate $CurrentLink $CurrentTask $CurrentWebSession $DateStringFormat $DefaultAudioInputDevice $DefaultAudioOutputDevice $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultLocalBase $DefaultMailbox $DefaultNetworkInterface $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $EmbedCodeEnvironments $EmbeddableServices $EntityStores $Epilog $EvaluationCloudBase $EvaluationCloudObject $EvaluationEnvironment $ExportFormats $Failed $FinancialDataSource $FontFamilies $FormatType $FrontEnd $FrontEndSession $GeoEntityTypes $GeoLocation $GeoLocationCity $GeoLocationCountry $GeoLocationPrecision $GeoLocationSource $HistoryLength $HomeDirectory $HTMLExportRules $HTTPCookies $HTTPRequest $IgnoreEOF $ImageFormattingWidth $ImagingDevice $ImagingDevices $ImportFormats $IncomingMailSettings $InitialDirectory $Initialization $InitializationContexts $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $InterpreterTypes $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $LocalBase $LocalSymbolBase $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $MobilePhone $ModuleNumber $NetworkConnected $NetworkInterfaces $NetworkLicense $NewMessage $NewSymbol $Notebooks $NoValue $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $Permissions $PermissionsGroupBase $PersistenceBase $PersistencePath $PipeSupported $PlotTheme $Post $Pre $PreferencesDirectory $PreInitialization $PrePrint $PreRead $PrintForms $PrintLiteral $Printout3DPreviewer $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $PublisherID $RandomState $RecursionLimit $RegisteredDeviceClasses $RegisteredUserName $ReleaseNumber $RequesterAddress $RequesterWolframID $RequesterWolframUUID $ResourceSystemBase $RootDirectory $ScheduledTask $ScriptCommandLine $ScriptInputString $SecuredAuthenticationKeyTokens $ServiceCreditsAvailable $Services $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SourceLink $SSHAuthentication $SummaryBoxDataSizeLimit $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemMemory $SystemShell $SystemTimeZone $SystemWordLength $TemplatePath $TemporaryDirectory $TemporaryPrefix $TestFileName $TextStyle $TimedOut $TimeUnit $TimeZone $TimeZoneEntity $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $UnitSystem $Urgent $UserAddOnsDirectory $UserAgentLanguages $UserAgentMachine $UserAgentName $UserAgentOperatingSystem $UserAgentString $UserAgentVersion $UserBaseDirectory $UserDocumentsDirectory $Username $UserName $UserURLBase $Version $VersionNumber $VoiceStyles $WolframID $WolframUUID', + '$Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AllowExternalChannelFunctions $AssertFunction $Assumptions $AsynchronousTask $AudioInputDevices $AudioOutputDevices $BaseDirectory $BatchInput $BatchOutput $BlockchainBase $BoxForms $ByteOrdering $CacheBaseDirectory $Canceled $ChannelBase $CharacterEncoding $CharacterEncodings $CloudBase $CloudConnected $CloudCreditsAvailable $CloudEvaluation $CloudExpressionBase $CloudObjectNameFormat $CloudObjectURLType $CloudRootDirectory $CloudSymbolBase $CloudUserID $CloudUserUUID $CloudVersion $CloudVersionNumber $CloudWolframEngineVersionNumber $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $Cookies $CookieStore $CreationDate $CurrentLink $CurrentTask $CurrentWebSession $DateStringFormat $DefaultAudioInputDevice $DefaultAudioOutputDevice $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultLocalBase $DefaultMailbox $DefaultNetworkInterface $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $EmbedCodeEnvironments $EmbeddableServices $EntityStores $Epilog $EvaluationCloudBase $EvaluationCloudObject $EvaluationEnvironment $ExportFormats $Failed $FinancialDataSource $FontFamilies $FormatType $FrontEnd $FrontEndSession $GeoEntityTypes $GeoLocation $GeoLocationCity $GeoLocationCountry $GeoLocationPrecision $GeoLocationSource $HistoryLength $HomeDirectory $HTMLExportRules $HTTPCookies $HTTPRequest $IgnoreEOF $ImageFormattingWidth $ImagingDevice $ImagingDevices $ImportFormats $IncomingMailSettings $InitialDirectory $Initialization $InitializationContexts $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $InterpreterTypes $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $LocalBase $LocalSymbolBase $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $MobilePhone $ModuleNumber $NetworkConnected $NetworkInterfaces $NetworkLicense $NewMessage $NewSymbol $Notebooks $NoValue $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $Permissions $PermissionsGroupBase $PersistenceBase $PersistencePath $PipeSupported $PlotTheme $Post $Pre $PreferencesDirectory $PreInitialization $PrePrint $PreRead $PrintForms $PrintLiteral $Printout3DPreviewer $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $PublisherID $RandomState $RecursionLimit $RegisteredDeviceClasses $RegisteredUserName $ReleaseNumber $RequesterAddress $RequesterWolframID $RequesterWolframUUID $ResourceSystemBase $RootDirectory $ScheduledTask $ScriptCommandLine $ScriptInputString $SecuredAuthenticationKeyTokens $ServiceCreditsAvailable $Services $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SourceLink $SSHAuthentication $SummaryBoxDataSizeLimit $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemMemory $SystemShell $SystemTimeZone $SystemWordLength $TemplatePath $TemporaryDirectory $TemporaryPrefix $TestFileName $TextStyle $TimedOut $TimeUnit $TimeZone $TimeZoneEntity $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $UnitSystem $Urgent $UserAddOnsDirectory $UserAgentLanguages $UserAgentMachine $UserAgentName $UserAgentOperatingSystem $UserAgentString $UserAgentVersion $UserBaseDirectory $UserDocumentsDirectory $Username $UserName $UserURLBase $Version $VersionNumber $VoiceStyles $WolframID $WolframUUID' + }, contains: [ hljs.COMMENT('\\(\\*', '\\*\\)', {contains: ['self']}), hljs.QUOTE_STRING_MODE, diff --git a/src/languages/maxima.js b/src/languages/maxima.js index d48e2933b1..39751032f2 100644 --- a/src/languages/maxima.js +++ b/src/languages/maxima.js @@ -366,8 +366,8 @@ export default function(hljs) { return { name: 'Maxima', - lexemes: '[A-Za-z_%][0-9A-Za-z_%]*', keywords: { + $pattern: '[A-Za-z_%][0-9A-Za-z_%]*', keyword: KEYWORDS, literal: LITERALS, built_in: BUILTIN_FUNCTIONS, diff --git a/src/languages/mipsasm.js b/src/languages/mipsasm.js index b1fc6ff34b..f7444428bf 100644 --- a/src/languages/mipsasm.js +++ b/src/languages/mipsasm.js @@ -12,8 +12,8 @@ export default function(hljs) { name: 'MIPS Assembly', case_insensitive: true, aliases: ['mips'], - lexemes: '\\.?' + hljs.IDENT_RE, keywords: { + $pattern: '\\.?' + hljs.IDENT_RE, meta: //GNU preprocs '.2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .ltorg ', diff --git a/src/languages/nginx.js b/src/languages/nginx.js index 2dc2a3e09c..d0eb3b5dec 100644 --- a/src/languages/nginx.js +++ b/src/languages/nginx.js @@ -17,8 +17,8 @@ export default function(hljs) { }; var DEFAULT = { endsWithParent: true, - lexemes: '[a-z/_]+', keywords: { + $pattern: '[a-z/_]+', literal: 'on off yes no true false none blocked debug info notice warn error crit ' + 'select break last permanent redirect kqueue rtsig epoll poll /dev/poll' diff --git a/src/languages/objectivec.js b/src/languages/objectivec.js index de95dbf2ff..5bd98d1bf3 100644 --- a/src/languages/objectivec.js +++ b/src/languages/objectivec.js @@ -11,7 +11,9 @@ export default function(hljs) { className: 'built_in', begin: '\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+', }; + var IDENTIFIER_RE = /[a-zA-Z@][a-zA-Z0-9_]*/; var OBJC_KEYWORDS = { + $pattern: IDENTIFIER_RE, keyword: 'int float while char export sizeof typedef const struct for union ' + 'unsigned long volatile static bool mutable if do return goto void ' + @@ -40,13 +42,14 @@ export default function(hljs) { built_in: 'BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once' }; - var LEXEMES = /[a-zA-Z@][a-zA-Z0-9_]*/; - var CLASS_KEYWORDS = '@interface @class @protocol @implementation'; + var CLASS_KEYWORDS = { + $pattern: IDENTIFIER_RE, + keyword: '@interface @class @protocol @implementation' + }; return { name: 'Objective-C', aliases: ['mm', 'objc', 'obj-c'], keywords: OBJC_KEYWORDS, - lexemes: LEXEMES, illegal: '>/, - lexemes: '[a-z_]\\w*!?', contains: [ { className: 'literal', diff --git a/src/languages/oxygene.js b/src/languages/oxygene.js index b392371f37..fbdd1288e0 100644 --- a/src/languages/oxygene.js +++ b/src/languages/oxygene.js @@ -6,15 +6,18 @@ Website: https://www.elementscompiler.com/elements/default.aspx */ export default function(hljs) { - var OXYGENE_KEYWORDS = 'abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue '+ + var OXYGENE_KEYWORDS = { + $pattern: /\.?\w+/, + keyword: 'abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue '+ 'create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false '+ 'final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited '+ 'inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of '+ 'old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly '+ 'record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple '+ 'type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal '+ - 'register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained'; - var CURLY_COMMENT = hljs.COMMENT( + 'register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained' + }; + var CURLY_COMMENT = hljs.COMMENT( '{', '}', { @@ -54,7 +57,6 @@ export default function(hljs) { return { name: 'Oxygene', case_insensitive: true, - lexemes: /\.?\w+/, keywords: OXYGENE_KEYWORDS, illegal: '("|\\$[G-Zg-z]|\\/\\*||->)', contains: [ diff --git a/src/languages/perl.js b/src/languages/perl.js index 9647b41ddc..971d64f1c9 100644 --- a/src/languages/perl.js +++ b/src/languages/perl.js @@ -6,7 +6,9 @@ Category: common */ export default function(hljs) { - var PERL_KEYWORDS = 'getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ' + + var PERL_KEYWORDS = { + $pattern: /[\w.]+/, + keyword: 'getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ' + 'ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime ' + 'readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq ' + 'fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent ' + @@ -24,7 +26,8 @@ export default function(hljs) { 'chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach ' + 'tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir ' + 'ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe ' + - 'atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when'; + 'atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when' + }; var SUBST = { className: 'subst', begin: '[$@]\\{', end: '\\}', @@ -157,7 +160,6 @@ export default function(hljs) { return { name: 'Perl', aliases: ['pl', 'pm'], - lexemes: /[\w\.]+/, keywords: PERL_KEYWORDS, contains: PERL_DEFAULT_CONTAINS }; diff --git a/src/languages/pf.js b/src/languages/pf.js index 369cec34e3..6c16cac0b0 100644 --- a/src/languages/pf.js +++ b/src/languages/pf.js @@ -23,8 +23,8 @@ export default function(hljs) { return { name: 'Packet Filter config', aliases: ['pf.conf'], - lexemes: /[a-z0-9_<>-]+/, keywords: { + $pattern: /[a-z0-9_<>-]+/, built_in: /* block match pass are "actions" in pf.conf(5), the rest are * lexically similar top-level commands. */ diff --git a/src/languages/php.js b/src/languages/php.js index 752bc448df..45471053da 100644 --- a/src/languages/php.js +++ b/src/languages/php.js @@ -84,8 +84,7 @@ export default function(hljs) { false, { endsWithParent: true, - keywords: '__halt_compiler', - lexemes: hljs.UNDERSCORE_IDENT_RE + keywords: '__halt_compiler' } ), { diff --git a/src/languages/powershell.js b/src/languages/powershell.js index 0a56e1adcf..ed21d082a1 100644 --- a/src/languages/powershell.js +++ b/src/languages/powershell.js @@ -36,6 +36,7 @@ export default function(hljs) { '-split|-wildcard|-xor'; var KEYWORDS = { + $pattern: /-?[A-z\.\-]+\b/, keyword: 'if else foreach return do while until elseif begin for trap data dynamicparam ' + 'end break throw param continue finally in switch exit filter try process catch ' + 'hidden static parameter', @@ -246,7 +247,6 @@ export default function(hljs) { return { name: 'PowerShell', aliases: ["ps", "ps1"], - lexemes: /-?[A-z\.\-]+\b/, case_insensitive: true, keywords: KEYWORDS, contains: GENTLEMANS_SET.concat( diff --git a/src/languages/q.js b/src/languages/q.js index f8aca0d548..5765429fa6 100644 --- a/src/languages/q.js +++ b/src/languages/q.js @@ -7,6 +7,7 @@ Website: https://kx.com/connect-with-us/developers/ */ export default function(hljs) { var Q_KEYWORDS = { + $pattern: /(`?)[A-Za-z0-9_]+\b/, keyword: 'do while select delete by update from', literal: @@ -20,7 +21,6 @@ export default function(hljs) { name: 'Q', aliases:['k', 'kdb'], keywords: Q_KEYWORDS, - lexemes: /(`?)[A-Za-z0-9_]+\b/, contains: [ hljs.C_LINE_COMMENT_MODE, hljs.QUOTE_STRING_MODE, diff --git a/src/languages/r.js b/src/languages/r.js index 45094f000c..3c5c2c3d7f 100644 --- a/src/languages/r.js +++ b/src/languages/r.js @@ -15,8 +15,8 @@ export default function(hljs) { hljs.HASH_COMMENT_MODE, { begin: IDENT_RE, - lexemes: IDENT_RE, keywords: { + $pattern: IDENT_RE, keyword: 'function if in break next repeat else for return switch while try tryCatch ' + 'stop warning require library attach detach source setMethod setGeneric ' + diff --git a/src/languages/routeros.js b/src/languages/routeros.js index e244313017..8fa38223fe 100644 --- a/src/languages/routeros.js +++ b/src/languages/routeros.js @@ -68,8 +68,8 @@ export default function(hljs) { name: 'Microtik RouterOS script', aliases: ['routeros', 'mikrotik'], case_insensitive: true, - lexemes: /:?[\w-]+/, keywords: { + $pattern: /:?[\w-]+/, literal: LITERALS, keyword: STATEMENTS + ' :' + STATEMENTS.split(' ').join(' :') + ' :' + GLOBAL_COMMANDS.split(' ').join(' :'), }, diff --git a/src/languages/rust.js b/src/languages/rust.js index d7cb15ecc2..2dbb17a286 100644 --- a/src/languages/rust.js +++ b/src/languages/rust.js @@ -37,6 +37,7 @@ export default function(hljs) { name: 'Rust', aliases: ['rs'], keywords: { + $pattern: hljs.IDENT_RE + '!?', keyword: KEYWORDS, literal: @@ -44,7 +45,6 @@ export default function(hljs) { built_in: BUILTINS }, - lexemes: hljs.IDENT_RE + '!?', illegal: '>/, - lexemes: '[a-z_]\\w*!?', contains: [ { className: 'literal', diff --git a/src/languages/sql.js b/src/languages/sql.js index 6a9a5a0ba6..25484ef494 100644 --- a/src/languages/sql.js +++ b/src/languages/sql.js @@ -20,8 +20,8 @@ export default function(hljs) { 'unlock purge reset change stop analyze cache flush optimize repair kill ' + 'install uninstall checksum restore check backup revoke comment values with', end: /;/, endsWithParent: true, - lexemes: /[\w\.]+/, keywords: { + $pattern: /[\w\.]+/, keyword: 'as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add ' + 'addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias ' + diff --git a/src/languages/stan.js b/src/languages/stan.js index c9ad712269..b3a8a499d8 100644 --- a/src/languages/stan.js +++ b/src/languages/stan.js @@ -154,11 +154,11 @@ export default function(hljs) { name: 'Stan', aliases: ['stanfuncs'], keywords: { - 'title': BLOCKS.join(' '), - 'keyword': STATEMENTS.concat(VAR_TYPES).concat(SPECIAL_FUNCTIONS).join(' '), - 'built_in': FUNCTIONS.join(' ') + $pattern: hljs.IDENT_RE, + title: BLOCKS.join(' '), + keyword: STATEMENTS.concat(VAR_TYPES).concat(SPECIAL_FUNCTIONS).join(' '), + built_in: FUNCTIONS.join(' ') }, - lexemes: hljs.IDENT_RE, contains: [ hljs.C_LINE_COMMENT_MODE, hljs.COMMENT( diff --git a/src/languages/step21.js b/src/languages/step21.js index d7ea5a596d..562f919137 100644 --- a/src/languages/step21.js +++ b/src/languages/step21.js @@ -8,6 +8,7 @@ Website: https://en.wikipedia.org/wiki/ISO_10303-21 export default function(hljs) { var STEP21_IDENT_RE = '[A-Z_][A-Z0-9_.]*'; var STEP21_KEYWORDS = { + $pattern: STEP21_IDENT_RE, keyword: 'HEADER ENDSEC DATA' }; var STEP21_START = { @@ -25,7 +26,6 @@ export default function(hljs) { name: 'STEP Part 21', aliases: ['p21', 'step', 'stp'], case_insensitive: true, // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized. - lexemes: STEP21_IDENT_RE, keywords: STEP21_KEYWORDS, contains: [ STEP21_START, diff --git a/src/languages/typescript.js b/src/languages/typescript.js index f830428477..c912157cdc 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -10,7 +10,7 @@ Category: common, scripting import * as ECMAScript from "./lib/ecmascript"; export default function(hljs) { - var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*'; + var IDENT_RE = ECMAScript.IDENT_RE; var TYPES = [ "any", "void", @@ -34,13 +34,14 @@ export default function(hljs) { "abstract" ]; var KEYWORDS = { + $pattern: ECMAScript.IDENT_RE, keyword: ECMAScript.KEYWORDS.concat(TS_SPECIFIC_KEYWORDS).join(" "), literal: ECMAScript.LITERALS.join(" "), built_in: ECMAScript.BUILT_INS.concat(TYPES).join(" ") }; var DECORATOR = { className: 'meta', - begin: '@' + JS_IDENT_RE, + begin: '@' + IDENT_RE, }; var NUMBER = { className: 'number', @@ -55,7 +56,7 @@ export default function(hljs) { className: 'subst', begin: '\\$\\{', end: '\\}', keywords: KEYWORDS, - contains: [] // defined later + contains: [] // defined later }; var HTML_TEMPLATE = { begin: 'html`', end: '', @@ -190,7 +191,7 @@ export default function(hljs) { keywords: KEYWORDS, contains: [ 'self', - hljs.inherit(hljs.TITLE_MODE, { begin: JS_IDENT_RE }), + hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE }), PARAMS ], illegal: /%/, diff --git a/src/languages/verilog.js b/src/languages/verilog.js index 855794df9f..cb88958636 100644 --- a/src/languages/verilog.js +++ b/src/languages/verilog.js @@ -8,6 +8,7 @@ Website: http://www.verilog.com export default function(hljs) { var 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 ' + @@ -70,7 +71,7 @@ export default function(hljs) { name: 'Verilog', aliases: ['v', 'sv', 'svh'], case_insensitive: false, - keywords: SV_KEYWORDS, lexemes: /[\w\$]+/, + keywords: SV_KEYWORDS, contains: [ hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE, diff --git a/src/languages/vim.js b/src/languages/vim.js index 61b0ff19f7..5b2af2c9b7 100644 --- a/src/languages/vim.js +++ b/src/languages/vim.js @@ -9,8 +9,8 @@ Category: scripting export default function(hljs) { return { name: 'Vim Script', - lexemes: /[!#@\w]+/, keywords: { + $pattern: /[!#@\w]+/, keyword: // express version except: ! & * < = > !! # @ @@ 'N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope '+ diff --git a/src/languages/x86asm.js b/src/languages/x86asm.js index 3c35a28075..f01c639d9a 100644 --- a/src/languages/x86asm.js +++ b/src/languages/x86asm.js @@ -10,8 +10,8 @@ export default function(hljs) { return { name: 'Intel x86 Assembly', case_insensitive: true, - lexemes: '[.%]?' + hljs.IDENT_RE, keywords: { + $pattern: '[.%]?' + hljs.IDENT_RE, keyword: 'lock rep repe repz repne repnz xaquire xrelease bnd nobnd ' + 'aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63', diff --git a/src/languages/xl.js b/src/languages/xl.js index 7ebe82c5d6..f45d464a60 100644 --- a/src/languages/xl.js +++ b/src/languages/xl.js @@ -11,6 +11,7 @@ export default function(hljs) { 'StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts'; var XL_KEYWORDS = { + $pattern: /[a-zA-Z][a-zA-Z0-9_?]*/, keyword: 'if then else do while until for loop import with is as where when by data constant ' + 'integer real text name boolean symbol infix prefix postfix block tree', @@ -63,7 +64,6 @@ export default function(hljs) { return { name: 'XL', aliases: ['tao'], - lexemes: /[a-zA-Z][a-zA-Z0-9_?]*/, keywords: XL_KEYWORDS, contains: [ hljs.C_LINE_COMMENT_MODE, diff --git a/src/languages/xquery.js b/src/languages/xquery.js index 851ebaae33..a03949da91 100644 --- a/src/languages/xquery.js +++ b/src/languages/xquery.js @@ -168,9 +168,9 @@ export default function(hljs) { name: 'XQuery', aliases: ['xpath', 'xq'], case_insensitive: false, - lexemes: /[a-zA-Z\$][a-zA-Z0-9_:\-]*/, illegal: /(proc)|(abstract)|(extends)|(until)|(#)/, keywords: { + $pattern: /[a-zA-Z\$][a-zA-Z0-9_:\-]*/, keyword: KEYWORDS, type: TYPE, literal: LITERAL diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index e853cf2c3b..8e63eeba17 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -207,11 +207,25 @@ export function compileLanguage(language) { mode.__beforeBegin = null; mode.keywords = mode.keywords || mode.beginKeywords; + + let kw_pattern = null; + if (typeof mode.keywords === "object") { + kw_pattern = mode.keywords.$pattern; + delete mode.keywords.$pattern; + } + if (mode.keywords) { mode.keywords = compileKeywords(mode.keywords, language.case_insensitive); } - mode.lexemesRe = langRe(mode.lexemes || /\w+/, true); + // both are not allowed + if (mode.lexemes && kw_pattern) { + throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) "); + } + + // `mode.lexemes` was the old standard before we added and now recommend + // using `keywords.$pattern` to pass the keyword pattern + mode.keywordPatternRe = langRe(mode.lexemes || kw_pattern || /\w+/, true); if (parent) { if (mode.beginKeywords) { diff --git a/test/markup/typescript/identifiers_that_include_keywords.expect.txt b/test/markup/typescript/identifiers_that_include_keywords.expect.txt new file mode 100644 index 0000000000..97d62024d7 --- /dev/null +++ b/test/markup/typescript/identifiers_that_include_keywords.expect.txt @@ -0,0 +1,2 @@ +const $class = () => true; +const result = $class(); diff --git a/test/markup/typescript/identifiers_that_include_keywords.txt b/test/markup/typescript/identifiers_that_include_keywords.txt new file mode 100644 index 0000000000..75cfea29eb --- /dev/null +++ b/test/markup/typescript/identifiers_that_include_keywords.txt @@ -0,0 +1,2 @@ +const $class = () => true; +const result = $class(); From 5c125b978d128e697f7a9f78d6045087fc697f53 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 7 May 2020 16:41:03 -0400 Subject: [PATCH 090/816] fix(javascript) fix regex inside parens after a non-regex (#2531) * make the object attr container smarter * deal with multi-line comments also * comments in any order, spanning multiple lines Essentially makes the object attr container much more sensitive by allowing it to look-ahead thru comments to find object keys - and therefore prevent them from being incorrectly matched by the "value container" rule. --- CHANGES.md | 2 ++ src/languages/javascript.js | 25 ++++++++++++++++--- src/lib/regex.js | 4 +++ test/markup/javascript/object-attr.expect.txt | 10 +++++++- test/markup/javascript/object-attr.txt | 11 +++++++- 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2cf4ad9ace..6c3f7225ce 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,8 @@ Deprecations: - `endSameAsBegin` is now deprecated. (#2261) [Josh Goebel][] Language Improvements: + +- fix(javascript) fix regex inside parens after a non-regex (#2530) [Josh Goebel][] - enh(typescript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][] - enh(javascript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][] - [enh] Add `OPTIMIZE:` and `HACK:` to the labels highlighted inside comments [Josh Goebel][] diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 35b12dba02..c8334357bc 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -6,6 +6,7 @@ Website: https://developer.mozilla.org/en-US/docs/Web/JavaScript */ import * as ECMAScript from "./lib/ecmascript"; +import * as regex from "../lib/regex"; export default function(hljs) { var IDENT_RE = ECMAScript.IDENT_RE; @@ -149,13 +150,29 @@ export default function(hljs) { hljs.C_BLOCK_COMMENT_MODE, NUMBER, { // object attr container - begin: /[{,\n]\s*/, relevance: 0, + begin: regex.concat(/[{,\n]\s*/, + // we need to look ahead to make sure that we actually have an + // attribute coming up so we don't steal a comma from a potential + // "value" container + // + // NOTE: this might not work how you think. We don't actually always + // enter this mode and stay. Instead it might merely match `, + // ` and then immediately end after the , because it + // fails to find any actual attrs. But this still does the job because + // it prevents the value contain rule from grabbing this instead and + // prevening this rule from firing when we actually DO have keys. + regex.lookahead(regex.concat( + // we also need to allow for multiple possible comments inbetween + // the first key:value pairing + /(((\/\/.*)|(\/\*(.|\n)*\*\/))\s*)*/, + IDENT_RE + '\\s*:'))), + relevance: 0, contains: [ { - begin: IDENT_RE + '\\s*:', returnBegin: true, + className: 'attr', + begin: IDENT_RE + regex.lookahead('\\s*:'), relevance: 0, - contains: [{className: 'attr', begin: IDENT_RE, relevance: 0}] - } + }, ] }, { // "value" container diff --git a/src/lib/regex.js b/src/lib/regex.js index 003dc9cbca..80a9ce1b70 100644 --- a/src/lib/regex.js +++ b/src/lib/regex.js @@ -8,6 +8,10 @@ export function source(re) { return (re && re.source) || re; } +export function lookahead(regex) { + return concat('(?=', regex, ')'); +} + export function concat(...args) { const joined = args.map((x) => source(x)).join(""); return joined; diff --git a/test/markup/javascript/object-attr.expect.txt b/test/markup/javascript/object-attr.expect.txt index e92b578cea..54e9d7301f 100644 --- a/test/markup/javascript/object-attr.expect.txt +++ b/test/markup/javascript/object-attr.expect.txt @@ -1,6 +1,14 @@ { key: value, // with comment key2: value, + key2clone: value, 'key-3': value, - key4: false ? undefined : true + key4: false ? undefined : true, + key5: value, /* with a multiline comment */ + key6: value, + key7: value, /* with a multiline comment */ // another comment + key8: value, + key9: value, /* with a REAL multiline +comment */ + key10: value, } diff --git a/test/markup/javascript/object-attr.txt b/test/markup/javascript/object-attr.txt index 442c0a17ae..b024927090 100644 --- a/test/markup/javascript/object-attr.txt +++ b/test/markup/javascript/object-attr.txt @@ -1,6 +1,15 @@ { key: value, // with comment key2: value, + key2clone: value, 'key-3': value, - key4: false ? undefined : true + key4: false ? undefined : true, + key5: value, /* with a multiline comment */ + key6: value, + key7: value, /* with a multiline comment */ // another comment + key8: value, + key9: value, /* with a REAL multiline +comment */ + key10: value, } + From 2fafd0e0b7c89979066600918ea97e394010687a Mon Sep 17 00:00:00 2001 From: Taufik Nurrohman Date: Fri, 8 May 2020 07:14:51 +0700 Subject: [PATCH 091/816] (parser) Add hljs.registerAlias() public API (#2540) * Add hljs.registerAlias(alias, languageName) public API * Add .registerAlias() test --- CHANGES.md | 1 + docs/api.rst | 27 +++++++++++++++++---------- src/highlight.js | 9 +++++++++ test/api/registerAlias.js | 24 ++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 test/api/registerAlias.js diff --git a/CHANGES.md b/CHANGES.md index 6c3f7225ce..948397d522 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ Parser Engine: - (parser) Adds `keywords.$pattern` key to grammar definitions (#2519) [Josh Goebel][] - (parser) Adds SHEBANG utility mode [Josh Goebel][] +- (parser) Adds `registerAlias` method (#2540) [Taufik Nurrohman][] - (enh) Added `on:begin` callback for modes (#2261) [Josh Goebel][] - (enh) Added `on:end` callback for modes (#2261) [Josh Goebel][] - (enh) Added ability to programatically ignore begin and end matches (#2261) [Josh Goebel][] diff --git a/docs/api.rst b/docs/api.rst index deb6f496c2..a219bfa9ea 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -5,7 +5,7 @@ Highlight.js exports a few functions as methods of the ``hljs`` object. ``highlight(languageName, code, ignore_illegals, continuation)`` ---------------------------------------------------------- +---------------------------------------------------------------- Core highlighting function. Accepts a language name, or an alias, and a string with the code to highlight. @@ -32,7 +32,7 @@ Returns an object with the following properties: ``highlightAuto(code, languageSubset)`` ----------------------------------------- +--------------------------------------- Highlighting with language detection. Accepts a string with the code to highlight and an optional array of language names and aliases restricting detection to only those languages. The subset can also be set with ``configure``, but the local parameter overrides the option if set. @@ -76,7 +76,7 @@ Configures global options: * ``classPrefix``: a string prefix added before class names in the generated markup, used for backwards compatibility with stylesheets. * ``languages``: an array of language names and aliases restricting auto detection to only these languages. * ``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 +* ``noHighlightRe``: a regex to configure which CSS classes are to be skipped completely. Accepts an object representing options with the values to updated. Other options don't change :: @@ -85,15 +85,14 @@ Accepts an object representing options with the values to updated. Other options tabReplace: ' ', // 4 spaces classPrefix: '' // don't append class prefix // … other options aren't changed - }) + }); hljs.initHighlighting(); ``initHighlighting()`` ---------------------- -Applies highlighting to all ``
..
`` blocks on a page. - +Applies highlighting to all ``
...
`` blocks on a page. ``initHighlightingOnLoad()`` @@ -113,13 +112,21 @@ Adds new language to the library under the specified name. Used mostly internall to use common regular expressions defined within it. +``registerAlias(alias|aliases, {languageName})`` +------------------------------------------------ + +Adds new language alias or aliases to the library for the specified language name defined under ``languageName`` key. + +* ``alias|aliases``: a string or array with the name of alias being registered +* ``languageName``: the language name as specified by ``registerLanguage``. + + ``listLanguages()`` ----------------------------- +------------------- Returns the languages names list. - .. _getLanguage: @@ -132,7 +139,7 @@ Returns the language object if found, ``undefined`` otherwise. ``requireLanguage(name)`` ---------------------- +------------------------- Looks up a language by name or alias. @@ -150,5 +157,5 @@ Enables *debug/development* mode. **This mode purposely makes Highlight.js more For example, if a new version suddenly had a serious bug (or breaking change) that affected only a single language: -* **In Safe Mode**: All other languages would continue to highlight just fine. The broken language would appear as a code block, but without any highlighting (as if it were plaintext). +* **In Safe Mode**: All other languages would continue to highlight just fine. The broken language would appear as a code block, but without any highlighting (as if it were plaintext). * **In Debug Mode**: All highlighting would stop when an error was encountered and a JavaScript error would be thrown. diff --git a/src/highlight.js b/src/highlight.js index 38ef8e17f0..c2779be23f 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -685,6 +685,14 @@ const HLJS = function(hljs) { return languages[name] || languages[aliases[name]]; } + function registerAlias(alias, {languageName}) { + let list = alias; + if (typeof list === 'string') { + list = [alias] + } + list.forEach(alias => aliases[alias] = languageName); + } + function autoDetection(name) { var lang = getLanguage(name); return lang && !lang.disableAutodetect; @@ -716,6 +724,7 @@ const HLJS = function(hljs) { registerLanguage, listLanguages, getLanguage, + registerAlias, requireLanguage, autoDetection, inherit, diff --git a/test/api/registerAlias.js b/test/api/registerAlias.js new file mode 100644 index 0000000000..3e03136fe4 --- /dev/null +++ b/test/api/registerAlias.js @@ -0,0 +1,24 @@ +'use strict'; + +const hljs = require('../../build'); +const should = require('should'); + +describe('.registerAlias()', () => { + it('should get an existing language by alias', () => { + hljs.registerAlias('jquery', { + languageName: 'javascript' + }); + const result = hljs.getLanguage('jquery'); + + result.should.be.instanceOf(Object); + }); + + it('should get an existing language by aliases', () => { + hljs.registerAlias(['jquery', 'jqueryui'], { + languageName: 'javascript' + }); + const result = hljs.getLanguage('jquery'); + + result.should.be.instanceOf(Object); + }); +}); From 04e4991d66657bd3c23d5356e069591f281910c6 Mon Sep 17 00:00:00 2001 From: Lin <50829219+Linhk1606@users.noreply.github.com> Date: Fri, 8 May 2020 10:04:02 +0800 Subject: [PATCH 092/816] enh(cpp) add `pair`, `make_pair`, `priority_queue` as built-ins (#2538) --- CHANGES.md | 2 ++ src/languages/c-like.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 948397d522..65b4771d18 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,7 @@ Language Improvements: - enh(typescript/javascript/coffeescript/livescript) derive ECMAscript keywords from a common foudation (#2518) [Josh Goebel][] - enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][] - enh(javascript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Vania Kucher][] +- enh(cpp) add `pair`, `make_pair`, `priority_queue` as built-ins (#2538) [Hankun Lin][] - fix(javascript) prevent `set` keyword conflicting with setTimeout, etc. (#2514) [Vania Kucher][] - fix(cpp) Fix highlighting of unterminated raw strings (#2261) [David Benjamin][] - fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] @@ -34,6 +35,7 @@ Language Improvements: [Peter Plantinga]: https://github.com/pplantinga [David Benjamin]: https://github.com/davidben [Vania Kucher]: https://github.com/qWici +[Hankun Lin]: https://github.com/Linhk1606 ## Version 10.0.2 diff --git a/src/languages/c-like.js b/src/languages/c-like.js index fb3a70c2af..d3ff9222c0 100644 --- a/src/languages/c-like.js +++ b/src/languages/c-like.js @@ -106,8 +106,8 @@ export default function(hljs) { 'atomic_ullong new throw return ' + 'and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq', built_in: 'std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream ' + - 'auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set ' + - 'unordered_map unordered_multiset unordered_multimap array shared_ptr abort terminate abs acos ' + + 'auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set ' + + 'unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos ' + 'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' + 'fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' + 'isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow ' + From 8c7422958b8cca585e1866cde0d9f9ea6c7a8e43 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 8 May 2020 02:03:31 -0400 Subject: [PATCH 093/816] (fix) `fixMarkup` would rarely destroy markup when `useBR` was enabled (#2532) --- CHANGES.md | 1 + src/highlight.js | 12 ++++++------ test/api/fixmarkup.js | 16 +++++++++++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 65b4771d18..eacc0a0d0d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ Parser Engine: - (enh) Added `on:end` callback for modes (#2261) [Josh Goebel][] - (enh) Added ability to programatically ignore begin and end matches (#2261) [Josh Goebel][] - (enh) Added `END_SAME_AS_BEGIN` mode to replace `endSameAsBegin` parser attribute (#2261) [Josh Goebel][] +- (fix) `fixMarkup` would rarely destroy markup when `useBR` was enabled (#2532) [Josh Goebel][] Deprecations: diff --git a/src/highlight.js b/src/highlight.js index c2779be23f..bc34fb4fc3 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -32,7 +32,7 @@ const HLJS = function(hljs) { var SAFE_MODE = true; // Regular expressions used throughout the highlight.js library. - var fixMarkupRe = /((^(<[^>]+>|\t|)+|(?:\n)))/gm; + var fixMarkupRe = /(^(<[^>]+>|\t|)+|\n)/gm; var LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?"; @@ -540,13 +540,13 @@ const HLJS = function(hljs) { return value; } - return value.replace(fixMarkupRe, function(match, p1) { - if (options.useBR && match === '\n') { - return '
'; + return value.replace(fixMarkupRe, match => { + if (match === '\n') { + return options.useBR ? '
' : match; } else if (options.tabReplace) { - return p1.replace(/\t/g, options.tabReplace); + return match.replace(/\t/g, options.tabReplace); } - return ''; + return match; }); } diff --git a/test/api/fixmarkup.js b/test/api/fixmarkup.js index 25600926ef..360b6a51e9 100644 --- a/test/api/fixmarkup.js +++ b/test/api/fixmarkup.js @@ -5,11 +5,21 @@ const hljs = require('../../build'); describe('.fixmarkup()', () => { after(() => { - hljs.configure({ useBR: false }) - }) + hljs.configure({ useBR: false }); + }); + + it('should not strip HTML from beginning of strings', () => { + hljs.configure({ useBR: true }); + const value = '"some": \n "json"'; + const result = hljs.fixMarkup(value); + + result.should.equal( + '"some":
"json"' + ); + }); it('should not add "undefined" to the beginning of the result (#1452)', () => { - hljs.configure({ useBR: true }) + hljs.configure({ useBR: true }); const value = '{ "some": \n "json" }'; const result = hljs.fixMarkup(value); From 527086fd42f9edac78db44c74731886e804b8266 Mon Sep 17 00:00:00 2001 From: Lin <50829219+Linhk1606@users.noreply.github.com> Date: Fri, 8 May 2020 16:29:54 +0800 Subject: [PATCH 094/816] enh(cpp) Recognize `priority_queue`, `pair` as containers (#2541) --- CHANGES.md | 1 + src/languages/c-like.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index eacc0a0d0d..e6348fdfe3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,7 @@ Language Improvements: - enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][] - enh(javascript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Vania Kucher][] - enh(cpp) add `pair`, `make_pair`, `priority_queue` as built-ins (#2538) [Hankun Lin][] +- enh(cpp) recognize `priority_queue` `pair` as cpp containers (#2541) [Hankun Lin][] - fix(javascript) prevent `set` keyword conflicting with setTimeout, etc. (#2514) [Vania Kucher][] - fix(cpp) Fix highlighting of unterminated raw strings (#2261) [David Benjamin][] - fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] diff --git a/src/languages/c-like.js b/src/languages/c-like.js index d3ff9222c0..ef795072e9 100644 --- a/src/languages/c-like.js +++ b/src/languages/c-like.js @@ -212,8 +212,8 @@ export default function(hljs) { EXPRESSION_CONTAINS, [ PREPROCESSOR, - { - begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>', + { // 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)\\s*<', end: '>', keywords: CPP_KEYWORDS, contains: ['self', CPP_PRIMITIVE_TYPES] }, From a3be151a6b05c58915910aa92f15a76b6561fdf0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 8 May 2020 09:52:47 -0400 Subject: [PATCH 095/816] chore: rename `registerAlias` to `registerAliases` Plural form is clearly better as it's not surprising to the reader to see it being passed an array - where as the singular form might have been. Meanwhile it's also easy to assume that it also supports arrays of any size - including an array with a singular alias. The fact that it can magically accept a string as the first argument might not be obvious, but we document it and even if one didn't know this they could still use the array form of the API without any issue by passing a one item array. --- CHANGES.md | 2 +- docs/api.rst | 4 ++-- src/highlight.js | 13 ++++++------- test/api/index.js | 1 + test/api/registerAlias.js | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e6348fdfe3..2b74d3d100 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ Parser Engine: - (parser) Adds `keywords.$pattern` key to grammar definitions (#2519) [Josh Goebel][] - (parser) Adds SHEBANG utility mode [Josh Goebel][] -- (parser) Adds `registerAlias` method (#2540) [Taufik Nurrohman][] +- (parser) Adds `registerAliases` method (#2540) [Taufik Nurrohman][] - (enh) Added `on:begin` callback for modes (#2261) [Josh Goebel][] - (enh) Added `on:end` callback for modes (#2261) [Josh Goebel][] - (enh) Added ability to programatically ignore begin and end matches (#2261) [Josh Goebel][] diff --git a/docs/api.rst b/docs/api.rst index a219bfa9ea..41f7014ad6 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -112,8 +112,8 @@ Adds new language to the library under the specified name. Used mostly internall to use common regular expressions defined within it. -``registerAlias(alias|aliases, {languageName})`` ------------------------------------------------- +``registerAliases(alias|aliases, {languageName})`` +-------------------------------------------------- Adds new language alias or aliases to the library for the specified language name defined under ``languageName`` key. diff --git a/src/highlight.js b/src/highlight.js index bc34fb4fc3..2b3f776429 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -658,7 +658,7 @@ const HLJS = function(hljs) { lang.rawDefinition = language.bind(null, hljs); if (lang.aliases) { - lang.aliases.forEach(function(alias) { aliases[alias] = name; }); + registerAliases(lang.aliases, { languageName: name }); } } @@ -685,12 +685,11 @@ const HLJS = function(hljs) { return languages[name] || languages[aliases[name]]; } - function registerAlias(alias, {languageName}) { - let list = alias; - if (typeof list === 'string') { - list = [alias] + function registerAliases(aliasList, {languageName}) { + if (typeof aliasList === 'string') { + aliasList = [aliasList] } - list.forEach(alias => aliases[alias] = languageName); + aliasList.forEach(alias => aliases[alias] = languageName); } function autoDetection(name) { @@ -724,7 +723,7 @@ const HLJS = function(hljs) { registerLanguage, listLanguages, getLanguage, - registerAlias, + registerAliases, requireLanguage, autoDetection, inherit, diff --git a/test/api/index.js b/test/api/index.js index 043bb65b4d..0e4b596dcb 100644 --- a/test/api/index.js +++ b/test/api/index.js @@ -12,4 +12,5 @@ describe('hljs', function() { require('./highlight'); require('./fixmarkup'); require('./keywords'); + require('./registerAlias'); }); diff --git a/test/api/registerAlias.js b/test/api/registerAlias.js index 3e03136fe4..aede3ebb7a 100644 --- a/test/api/registerAlias.js +++ b/test/api/registerAlias.js @@ -3,9 +3,9 @@ const hljs = require('../../build'); const should = require('should'); -describe('.registerAlias()', () => { +describe('.registerAliases()', () => { it('should get an existing language by alias', () => { - hljs.registerAlias('jquery', { + hljs.registerAliases('jquery', { languageName: 'javascript' }); const result = hljs.getLanguage('jquery'); @@ -14,7 +14,7 @@ describe('.registerAlias()', () => { }); it('should get an existing language by aliases', () => { - hljs.registerAlias(['jquery', 'jqueryui'], { + hljs.registerAliases(['jquery', 'jqueryui'], { languageName: 'javascript' }); const result = hljs.getLanguage('jquery'); From 544ed68d731f8b560e0e5616e60d254eb13ff466 Mon Sep 17 00:00:00 2001 From: nicked Date: Sun, 10 May 2020 21:36:39 +0200 Subject: [PATCH 096/816] (swift) @objcMembers not completely highlighted (#2543) * Fixed @objcMembers in Swift Would match `@objc` first, and the `Members` part would be unhighlighted * Update CHANGES.md * Update swift.js --- CHANGES.md | 2 ++ src/languages/swift.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 2b74d3d100..3ddb1a2c23 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,12 +32,14 @@ Language Improvements: - fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] - fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] - fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][] +- fix(swift) `@objcMembers` was being partially highlighted (#2543) [Nick Randall][] [Josh Goebel]: https://github.com/yyyc514 [Peter Plantinga]: https://github.com/pplantinga [David Benjamin]: https://github.com/davidben [Vania Kucher]: https://github.com/qWici [Hankun Lin]: https://github.com/Linhk1606 +[Nick Randall]: https://github.com/nicked ## Version 10.0.2 diff --git a/src/languages/swift.js b/src/languages/swift.js index c5e5b0e8ac..e04fd72109 100644 --- a/src/languages/swift.js +++ b/src/languages/swift.js @@ -129,7 +129,7 @@ export default function(hljs) { '@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|' + '@infix|@prefix|@postfix|@autoclosure|@testable|@available|' + '@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|' + - '@propertyWrapper)' + '@propertyWrapper)\\b' }, { From 02fd993c55697a455e8af5fd4de48a226c7ee6b3 Mon Sep 17 00:00:00 2001 From: Nicolas Homble Date: Mon, 11 May 2020 00:45:56 -0400 Subject: [PATCH 097/816] (docs) add OCL to list of supported languages (#2547) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 68a9fc07ba..d6a65eeddf 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -121,6 +121,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Nginx | nginx, nginxconf | | | Nim | nimrod | | | Nix | nix | | +| Object Constraint Language | ocl | [highlightjs-ocl](https://github.com/nhomble/highlightjs-ocl) | | OCaml | ocaml, ml | | | Objective C | objectivec, mm, objc, obj-c | | | OpenGL Shading Language | glsl | | From a34f2d46019e14ccc2ad19141d6b0c0fb4cce633 Mon Sep 17 00:00:00 2001 From: Ryandi Tjia Date: Wed, 13 May 2020 04:55:54 +0700 Subject: [PATCH 098/816] (docs) Add Svelte to list of supported languages (#2549) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index d6a65eeddf..ad4bbdc950 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -174,6 +174,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Stylus | stylus, styl | | | SubUnit | subunit | | | Supercollider | supercollider, sc | [highlightjs-supercollider](https://github.com/highlightjs/highlightjs-supercollider) | +| Svelte | svelte | [highlightjs-svelte](https://github.com/AlexxNB/highlightjs-svelte) | | Swift | swift | | | Tcl | tcl, tk | | | Terraform (HCL) | terraform, tf, hcl | [highlightjs-terraform](https://github.com/highlightjs/highlightjs-terraform) | From f64993fc9da344fe4592c8f78dc651a2032681e1 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 12 May 2020 15:23:58 -0700 Subject: [PATCH 099/816] enh(dart) Add `late` and `required` keywords, and `Never` built-in type (Dart 2.9) (#2551) * Add new Dart 2.9 keywords for Null Safety language feature --- CHANGES.md | 2 ++ src/languages/dart.js | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3ddb1a2c23..03e90acb8e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -33,6 +33,7 @@ Language Improvements: - fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] - fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][] - fix(swift) `@objcMembers` was being partially highlighted (#2543) [Nick Randall][] +- enh(dart) Add `late` and `required` keywords, and `Never` built-in type (#2550) [Sam Rawlins][] [Josh Goebel]: https://github.com/yyyc514 [Peter Plantinga]: https://github.com/pplantinga @@ -40,6 +41,7 @@ Language Improvements: [Vania Kucher]: https://github.com/qWici [Hankun Lin]: https://github.com/Linhk1606 [Nick Randall]: https://github.com/nicked +[Sam Rawlins]: https://github.com/srawlins ## Version 10.0.2 diff --git a/src/languages/dart.js b/src/languages/dart.js index c7101b0643..25a05b63f1 100644 --- a/src/languages/dart.js +++ b/src/languages/dart.js @@ -75,12 +75,12 @@ export default function(hljs) { var KEYWORDS = { keyword: 'abstract as assert async await break case catch class const continue covariant default deferred do ' + 'dynamic else enum export extends extension external factory false final finally for Function get hide if ' + - 'implements import in inferface is library mixin new null on operator part rethrow return set show static ' + - 'super switch sync this throw true try typedef var void while with yield', + 'implements import in inferface is late library mixin new null on operator part required rethrow return set ' + + 'show static super switch sync this throw true try typedef var void while with yield', built_in: // dart:core - 'Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set ' + - 'Stopwatch String StringBuffer StringSink Symbol Type Uri bool double dynamic int num print ' + + 'Comparable DateTime Duration Function Iterable Iterator List Map Match Never Null Object Pattern RegExp ' + + 'Set Stopwatch String StringBuffer StringSink Symbol Type Uri bool double dynamic int num print ' + // dart:html 'Element ElementList document querySelector querySelectorAll window' }; From b50fa497894c08b3d22efd0cca4c791126311778 Mon Sep 17 00:00:00 2001 From: Sergey Prokhorov Date: Thu, 14 May 2020 02:42:03 +0200 Subject: [PATCH 100/816] enh(erlang) add support for underscore separators in numeric literals (#2554) * (erlang) add support for underscore separators in numeric literals * (erlang) add tests --- CHANGES.md | 2 ++ src/languages/erlang-repl.js | 2 +- src/languages/erlang.js | 2 +- test/markup/erlang/numbers.expect.txt | 14 ++++++++++++++ test/markup/erlang/numbers.txt | 14 ++++++++++++++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 test/markup/erlang/numbers.expect.txt create mode 100644 test/markup/erlang/numbers.txt diff --git a/CHANGES.md b/CHANGES.md index 03e90acb8e..a631b26860 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -34,6 +34,7 @@ Language Improvements: - fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][] - fix(swift) `@objcMembers` was being partially highlighted (#2543) [Nick Randall][] - enh(dart) Add `late` and `required` keywords, and `Never` built-in type (#2550) [Sam Rawlins][] +- enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][] [Josh Goebel]: https://github.com/yyyc514 [Peter Plantinga]: https://github.com/pplantinga @@ -42,6 +43,7 @@ Language Improvements: [Hankun Lin]: https://github.com/Linhk1606 [Nick Randall]: https://github.com/nicked [Sam Rawlins]: https://github.com/srawlins +[Sergey Prokhorov]: https://github.com/seriyps ## Version 10.0.2 diff --git a/src/languages/erlang-repl.js b/src/languages/erlang-repl.js index 6ba6e0ed49..5d1e6679e9 100644 --- a/src/languages/erlang-repl.js +++ b/src/languages/erlang-repl.js @@ -23,7 +23,7 @@ export default function(hljs) { hljs.COMMENT('%', '$'), { className: 'number', - begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)', + begin: '\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)', relevance: 0 }, hljs.APOS_STRING_MODE, diff --git a/src/languages/erlang.js b/src/languages/erlang.js index 2cec6aecf5..e37b94ea53 100644 --- a/src/languages/erlang.js +++ b/src/languages/erlang.js @@ -20,7 +20,7 @@ export default function(hljs) { var COMMENT = hljs.COMMENT('%', '$'); var NUMBER = { className: 'number', - begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)', + begin: '\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)', relevance: 0 }; var NAMED_FUN = { diff --git a/test/markup/erlang/numbers.expect.txt b/test/markup/erlang/numbers.expect.txt new file mode 100644 index 0000000000..9fdb67b1ae --- /dev/null +++ b/test/markup/erlang/numbers.expect.txt @@ -0,0 +1,14 @@ +Integer = 1234 +BigInteger = 1_234_000 +NegInteger = -20_000 +Float = 2.34 +BigFloat = 3_333.14159_26535_89793 +SciFloat = 2.4e23 +PlusSciFloat = 2.4e+23 +SmallSciFloat = 2.4e-23 +Binary = 2#1010 +StrangeBinary = 2#1010_1010_1010 +Octal = 8#777 +StrangeOctal = 8#777_666_555 +Hex = 16#1ABEF +StrangeHex = 16#1234_FACE_987D diff --git a/test/markup/erlang/numbers.txt b/test/markup/erlang/numbers.txt new file mode 100644 index 0000000000..d14aff8819 --- /dev/null +++ b/test/markup/erlang/numbers.txt @@ -0,0 +1,14 @@ +Integer = 1234 +BigInteger = 1_234_000 +NegInteger = -20_000 +Float = 2.34 +BigFloat = 3_333.14159_26535_89793 +SciFloat = 2.4e23 +PlusSciFloat = 2.4e+23 +SmallSciFloat = 2.4e-23 +Binary = 2#1010 +StrangeBinary = 2#1010_1010_1010 +Octal = 8#777 +StrangeOctal = 8#777_666_555 +Hex = 16#1ABEF +StrangeHex = 16#1234_FACE_987D From c5cdc1cbe1b70dfcd14946cc68cd44014f322b3c Mon Sep 17 00:00:00 2001 From: Brian Alberg Date: Thu, 14 May 2020 17:38:32 +0200 Subject: [PATCH 101/816] (docs) add Jolie to Supported Languages (#2556) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index ad4bbdc950..5d3d3ea152 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -92,6 +92,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | JSON | json | | | Java | java, jsp | | | JavaScript | javascript, js, jsx | | +| Jolie | jolie, iol, ol | [highlightjs-jolie](https://github.com/xiroV/highlightjs-jolie) | | Kotlin | kotlin, kt | | | LaTeX | tex | | | Leaf | leaf | | From c836e3aae667ce8c8f7b28534a25d280587f7d3f Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 15 May 2020 19:14:50 -0400 Subject: [PATCH 102/816] (parser/docs) Add jsdoc annotations and TypeScript type file (#2517) Adds JSDoc annotations and a .tsconfig that allows TypeScript to be run in it's "allowJS" mode and apply type and sanity checking to JavaScript code also. See Type Checking JavaScript Files. I've been using TypeScript a lot lately and finding it very beneficial and wanted to get those same benefits here but without converting the whole project to TypeScript. It was rough at the beginning but now that this is finished I think it's about 80%-90% of the benefits without any of the TS compilation pipeline. The big difference in being JSDoc for adding typing information vs inline types with TypeScript. Should be super helpful for maintainers using an editor with tight TypeScript integration and the improved docs/comments should help everyone else. - Adds types/index.d.ts to NPM build (should be useful for TypeScript peeps) - Improves documentation of many functions - Adds JSDoc annotations to almost all functions - Adds JSDoc type annotations to variables that can't be inferred - Refactors a few smaller things to allow the TypeScript compiler to better infer what is happening (and usually also made the code clearer) --- .eslintrc.js | 6 +- docs/api.rst | 6 +- package-lock.json | 119 ++++++++++++++ package.json | 8 +- src/highlight.js | 281 ++++++++++++++++++++++++---------- src/languages/abnf.js | 1 + src/languages/accesslog.js | 1 + src/languages/actionscript.js | 1 + src/languages/ada.js | 1 + src/languages/angelscript.js | 1 + src/languages/apache.js | 1 + src/languages/applescript.js | 1 + src/languages/arcade.js | 5 +- src/languages/arduino.js | 1 + src/languages/armasm.js | 1 + src/languages/asciidoc.js | 1 + src/languages/aspectj.js | 4 +- src/languages/autohotkey.js | 1 + src/languages/autoit.js | 1 + src/languages/avrasm.js | 1 + src/languages/awk.js | 1 + src/languages/axapta.js | 1 + src/languages/bash.js | 1 + src/languages/basic.js | 1 + src/languages/bnf.js | 1 + src/languages/brainfuck.js | 1 + src/languages/c-like.js | 1 + src/languages/c.js | 1 + src/languages/cal.js | 1 + src/languages/capnproto.js | 1 + src/languages/ceylon.js | 2 + src/languages/clean.js | 1 + src/languages/clojure-repl.js | 1 + src/languages/clojure.js | 1 + src/languages/cmake.js | 1 + src/languages/coffeescript.js | 1 + src/languages/coq.js | 1 + src/languages/cos.js | 2 + src/languages/cpp.js | 2 +- src/languages/crmsh.js | 1 + src/languages/crystal.js | 1 + src/languages/csharp.js | 1 + src/languages/csp.js | 1 + src/languages/css.js | 1 + src/languages/d.js | 1 + src/languages/delphi.js | 1 + src/languages/diff.js | 1 + src/languages/dns.js | 1 + src/lib/html_renderer.js | 56 ++++++- src/lib/mode_compiler.js | 164 ++++++++++++++++---- src/lib/modes.js | 33 +++- src/lib/regex.js | 43 +++++- src/lib/response.js | 8 +- src/lib/token_tree.js | 55 ++++++- src/lib/utils.js | 54 +++++-- src/vendor/deep_freeze.js | 23 +-- test/markup/index.js | 2 + tools/build_node.js | 2 + tsconfig.json | 64 ++++++++ types/index.d.ts | 212 +++++++++++++++++++++++++ 60 files changed, 1015 insertions(+), 174 deletions(-) create mode 100644 tsconfig.json create mode 100644 types/index.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index 930b631331..e531d00a73 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,6 +17,10 @@ module.exports = { "ecmaVersion": 2018, "sourceType": "module" }, + "parser": '@typescript-eslint/parser', + "plugins": [ + "@typescript-eslint" + ], "rules": { "array-callback-return": "error", "block-scoped-var": "error", @@ -27,7 +31,7 @@ module.exports = { // for now ignore diff between types of quoting "quotes": "off", // this is the style we are already using - "operator-linebreak": ["error","after", { "overrides": { "?": "after", ":": "after" } }], + "operator-linebreak": ["error","before", { "overrides": { "?": "after", ":": "after", "+": "after" } }], // sometimes we declare variables with extra spacing "indent": ["error", 2, {"VariableDeclarator":2}], // seems like a good idea not to use explicit undefined diff --git a/docs/api.rst b/docs/api.rst index 41f7014ad6..8b5ee44540 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -101,13 +101,13 @@ Applies highlighting to all ``
...
`` blocks on a page. Attaches highlighting to the page load event. -``registerLanguage(name, language)`` +``registerLanguage(languageName, languageDefinition)`` ------------------------------------ Adds new language to the library under the specified name. Used mostly internally. -* ``name``: a string with the name of the language being registered -* ``language``: a function that returns an object which represents the +* ``languageName``: a string with the name of the language being registered +* ``languageDefinition``: a function that returns an object which represents the language definition. The function is passed the ``hljs`` object to be able to use common regular expressions defined within it. diff --git a/package-lock.json b/package-lock.json index 09fe06c654..318acfc140 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,6 +62,12 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -79,6 +85,12 @@ "@types/node": "*" } }, + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", + "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -91,6 +103,98 @@ "integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.32.0.tgz", + "integrity": "sha512-nb1kSUa8cd22hGgxpGdVT6/iyP7IKyrnyZEGYo+tN8iyDdXvXa+nfsX03tJVeFfhbkwR/0CDk910zPbqSflAsg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "2.32.0", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + }, + "dependencies": { + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.32.0.tgz", + "integrity": "sha512-oDWuB2q5AXsQ/mLq2N4qtWiBASWXPf7KhqXgeGH4QsyVKx+km8F6Vfqd3bspJQyhyCqxcbLO/jKJuIV3DzHZ6A==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.32.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.32.0.tgz", + "integrity": "sha512-swRtH835fUfm2khchiOVNchU3gVNaZNj2pY92QSx4kXan+RzaGNrwIRaCyX8uqzmK0xNPzseaUYHP8CsmrsjFw==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "2.32.0", + "@typescript-eslint/typescript-estree": "2.32.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.32.0.tgz", + "integrity": "sha512-hQpbWM/Y2iq6jB9FHYJBqa3h1R9IEGodOtajhb261cVHt9cz30AKjXM6WP7LxJdEPPlyJ9rPTZVgBUgZgiyPgw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "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" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } + } + }, "abab": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", @@ -3719,6 +3823,15 @@ "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", "dev": true }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -3749,6 +3862,12 @@ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, + "typescript": { + "version": "4.0.0-dev.20200512", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.0-dev.20200512.tgz", + "integrity": "sha512-ZsVvhdxpQaA6KpjlT8wNNtweORzNsMtwgCo8viKWQmOvaU+BlMsd3MjD2LONQjFSiETCaw4uq0nNdyfKrCjjIw==", + "dev": true + }, "uglify-js": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.2.tgz", diff --git a/package.json b/package.json index f442149c96..c6f72791e3 100644 --- a/package.json +++ b/package.json @@ -21,14 +21,13 @@ "url": "git://github.com/highlightjs/highlight.js.git" }, "main": "./lib/index.js", + "types": "./types/index.d.ts", "scripts": { "mocha": "mocha", - "build_and_test": "npm run build && npm run test", "build": "node ./tools/build.js -t node", "build-cdn": "node ./tools/build.js -t cdn", "build-browser": "node ./tools/build.js -t browser :common", - "test": "mocha --globals document test", "test-markup": "mocha --globals document test/markup", "test-detect": "mocha --globals document test/detect", @@ -38,6 +37,8 @@ "node": "*" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^2.32.0", + "@typescript-eslint/parser": "^2.32.0", "clean-css": "^4.2.1", "cli-table": "^0.3.1", "colors": "^1.1.2", @@ -62,7 +63,8 @@ "rollup-plugin-json": "^4.0.0", "should": "^13.2.3", "terser": "^4.3.9", - "tiny-worker": "^2.3.0" + "tiny-worker": "^2.3.0", + "typescript": "^4.0.0-dev.20200512" }, "dependencies": {} } diff --git a/src/highlight.js b/src/highlight.js index 2b3f776429..9b24b1682d 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -18,26 +18,33 @@ const inherit = utils.inherit; const { nodeStream, mergeStreams } = utils; const NO_MATCH = Symbol("nomatch"); +/** + * @param {any} hljs - object that is extended (legacy) + */ const HLJS = function(hljs) { // Convenience variables for build-in objects + /** @type {unknown[]} */ var ArrayProto = []; // Global internal variables used within the highlight.js library. + /** @type {Record} */ var languages = {}; + /** @type {Record} */ var aliases = {}; + /** @type {HLJSPlugin[]} */ var plugins = []; // safe/production mode - swallows more errors, tries to keep running // even if a single syntax or parse hits a fatal error var SAFE_MODE = true; - - // Regular expressions used throughout the highlight.js library. var fixMarkupRe = /(^(<[^>]+>|\t|)+|\n)/gm; - var LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?"; + /** @type {Language} */ + const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text', contains: [] }; // Global options used when within external APIs. This is modified when // calling the `hljs.configure` function. + /** @type HLJSOptions */ var options = { noHighlightRe: /^(no-?highlight)$/i, languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i, @@ -52,10 +59,17 @@ const HLJS = function(hljs) { /* Utility functions */ - function shouldNotHighlight(language) { - return options.noHighlightRe.test(language); + /** + * Tests a language name to see if highlighting should be skipped + * @param {string} languageName + */ + function shouldNotHighlight(languageName) { + return options.noHighlightRe.test(languageName); } + /** + * @param {HighlightedHTMLElement} block - the HTML element to determine language for + */ function blockLanguage(block) { var classes = block.className + ' '; @@ -82,18 +96,19 @@ const HLJS = function(hljs) { * * @param {string} languageName - the language to use for highlighting * @param {string} code - the code to highlight - * @param {boolean} ignoreIllegals - whether to ignore illegal matches, default is to bail - * @param {array} continuation - array of continuation modes + * @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail + * @param {Mode} [continuation] - current continuation mode, if any * - * @returns an object that represents the result + * @returns {HighlightResult} Result - an object that represents the result * @property {string} language - the language name * @property {number} relevance - the relevance score * @property {string} value - the highlighted HTML code * @property {string} code - the original raw code - * @property {mode} top - top of the current mode stack + * @property {Mode} top - top of the current mode stack * @property {boolean} illegal - indicates whether any illegal matches were found */ function highlight(languageName, code, ignoreIllegals, continuation) { + /** @type {{ code: string, language: string, result?: any }} */ var context = { code, language: languageName @@ -115,10 +130,23 @@ const HLJS = function(hljs) { return result; } - // private highlight that's used internally and does not fire callbacks + /** + * private highlight that's used internally and does not fire callbacks + * + * @param {string} languageName - the language to use for highlighting + * @param {string} code - the code to highlight + * @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail + * @param {Mode} [continuation] - current continuation mode, if any + */ function _highlight(languageName, code, ignoreIllegals, continuation) { var codeToHighlight = code; + /** + * Return keyword data if a match is a keyword + * @param {CompiledMode} mode - current mode + * @param {RegExpMatchArray} match - regexp match data + * @returns {KeywordData | false} + */ function keywordData(mode, match) { var matchText = language.case_insensitive ? match[0].toLowerCase() : match[0]; return Object.prototype.hasOwnProperty.call(mode.keywords, matchText) && mode.keywords[matchText]; @@ -157,18 +185,20 @@ const HLJS = function(hljs) { function processSubLanguage() { if (mode_buffer === "") return; + /** @type HighlightResult */ + var result = null; - var explicit = typeof top.subLanguage === 'string'; - - if (explicit && !languages[top.subLanguage]) { - emitter.addText(mode_buffer); - return; + if (typeof top.subLanguage === 'string') { + if (!languages[top.subLanguage]) { + emitter.addText(mode_buffer); + return; + } + result = _highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]); + continuations[top.subLanguage] = result.top; + } else { + result = highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : null); } - var result = explicit ? - _highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : - highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : null); - // Counting embedded language score towards the host language may be disabled // with zeroing the containing mode relevance. Use case in point is Markdown that // allows XML everywhere and makes every XML snippet to have a much larger Markdown @@ -176,9 +206,6 @@ const HLJS = function(hljs) { if (top.relevance > 0) { relevance += result.relevance; } - if (explicit) { - continuations[top.subLanguage] = result.top; - } emitter.addSublanguage(result.emitter, result.language); } @@ -191,23 +218,31 @@ const HLJS = function(hljs) { mode_buffer = ''; } + /** + * @param {Mode} mode - new mode to start + */ function startNewMode(mode) { if (mode.className) { emitter.openNode(mode.className); } - top = Object.create(mode, {parent: {value: top}}); + top = Object.create(mode, { parent: { value: top } }); return top; } + /** + * @param {CompiledMode } mode - the mode to potentially end + * @param {RegExpMatchArray} match - the latest match + * @param {string} matchPlusRemainder - match plus remainder of content + * @returns {CompiledMode | void} - the next mode, or if void continue on in current mode + */ function endOfMode(mode, match, matchPlusRemainder) { let matched = regex.startsWith(mode.endRe, matchPlusRemainder); if (matched) { if (mode["on:end"]) { - let resp = new Response(mode); + const resp = new Response(mode); mode["on:end"](match, resp); - if (resp.ignore) - matched = false; + if (resp.ignore) matched = false; } if (matched) { @@ -224,6 +259,11 @@ const HLJS = function(hljs) { } } + /** + * Handle matching but then ignoring a sequence of text + * + * @param {string} lexeme - string containing full match text + */ function doIgnore(lexeme) { if (top.matcher.regexIndex === 0) { // no more regexs to potentially match here, so we move the cursor forward one @@ -238,15 +278,20 @@ const HLJS = function(hljs) { } } + /** + * Handle the start of a new potential mode match + * + * @param {EnhancedMatch} match - the current match + * @returns {number} how far to advance the parse cursor + */ function doBeginMatch(match) { var lexeme = match[0]; var new_mode = match.rule; - var mode; - let resp = new Response(new_mode); + const resp = new Response(new_mode); // first internal before callbacks, then the public ones - let beforeCallbacks = [new_mode.__beforeBegin, new_mode["on:begin"]]; - for (let cb of beforeCallbacks) { + const beforeCallbacks = [new_mode.__beforeBegin, new_mode["on:begin"]]; + for (const cb of beforeCallbacks) { if (!cb) continue; cb(match, resp); if (resp.ignore) return doIgnore(lexeme); @@ -267,7 +312,7 @@ const HLJS = function(hljs) { mode_buffer = lexeme; } } - mode = startNewMode(new_mode); + startNewMode(new_mode); // if (mode["after:begin"]) { // let resp = new Response(mode); // mode["after:begin"](match, resp); @@ -275,6 +320,11 @@ const HLJS = function(hljs) { return new_mode.returnBegin ? 0 : lexeme.length; } + /** + * Handle the potential end of mode + * + * @param {RegExpMatchArray} match - the current match + */ function doEndMatch(match) { var lexeme = match[0]; var matchPlusRemainder = codeToHighlight.substr(match.index); @@ -322,7 +372,15 @@ const HLJS = function(hljs) { list.forEach(item => emitter.openNode(item)); } + /** @type {{type?: MatchType, index?: number, rule?: Mode}}} */ var lastMatch = {}; + + /** + * Process an individual match + * + * @param {string} textBeforeMatch - text preceeding the match (since the last match) + * @param {EnhancedMatch} [match] - the match itself + */ function processLexeme(textBeforeMatch, match) { var lexeme = match && match[0]; @@ -342,6 +400,7 @@ const HLJS = function(hljs) { // spit the "skipped" character that our regex choked on back into the output sequence mode_buffer += codeToHighlight.slice(match.index, match.index + 1); if (!SAFE_MODE) { + /** @type {AnnotatedError} */ const err = new Error('0 width match regex'); err.languageName = languageName; err.badRule = lastMatch.rule; @@ -355,6 +414,7 @@ const HLJS = function(hljs) { return doBeginMatch(match); } else if (match.type === "illegal" && !ignoreIllegals) { // illegal match, we do not continue processing + /** @type {AnnotatedError} */ const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); err.mode = top; throw err; @@ -404,9 +464,11 @@ const HLJS = function(hljs) { throw new Error('Unknown language: "' + languageName + '"'); } - compileLanguage(language); + var md = compileLanguage(language); var result = ''; - var top = continuation || language; + /** @type {CompiledMode} */ + var top = continuation || md; + /** @type Record */ var continuations = {}; // keep continuations for sub-languages var emitter = new options.__emitter(options); processContinuations(); @@ -422,9 +484,9 @@ const HLJS = function(hljs) { for (;;) { iterations++; if (continueScanAtSamePosition) { - continueScanAtSamePosition = false; // only regexes not matched previously will now be // considered for a potential match + continueScanAtSamePosition = false; } else { top.matcher.lastIndex = index; top.matcher.considerAll(); @@ -466,6 +528,7 @@ const HLJS = function(hljs) { }; } else if (SAFE_MODE) { return { + illegal: false, relevance: 0, value: escape(codeToHighlight), emitter: emitter, @@ -479,10 +542,13 @@ const HLJS = function(hljs) { } } - // returns a valid highlight result, without actually - // doing any actual work, auto highlight starts with - // this and it's possible for small snippets that - // auto-detection may not find a better match + /** + * returns a valid highlight result, without actually doing any actual work, + * auto highlight starts with this and it's possible for small snippets that + * auto-detection may not find a better match + * @param {string} code + * @returns {HighlightResult} + */ function justTextHighlightResult(code) { const result = { relevance: 0, @@ -491,11 +557,11 @@ const HLJS = function(hljs) { illegal: false, top: PLAINTEXT_LANGUAGE }; - result.emitter.addText(code) + result.emitter.addText(code); return result; } - /* + /** Highlighting with language detection. Accepts a string with the code to highlight. Returns an object with the following properties: @@ -505,10 +571,13 @@ const HLJS = function(hljs) { - second_best (object with the same structure for second-best heuristically detected language, may be absent) + @param {string} code + @param {Array} [languageSubset] + @returns {AutoHighlightResult} */ function highlightAuto(code, languageSubset) { languageSubset = languageSubset || options.languages || Object.keys(languages); - var result = justTextHighlightResult(code) + var result = justTextHighlightResult(code); var secondBest = result; languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) { var current = _highlight(name, code, false); @@ -528,19 +597,21 @@ const HLJS = function(hljs) { return result; } - /* + /** Post-processing of the highlighted markup: - replace TABs with something more useful - replace real line-breaks with '
' for non-pre containers + @param {string} html + @returns {string} */ - function fixMarkup(value) { + function fixMarkup(html) { if (!(options.tabReplace || options.useBR)) { - return value; + return html; } - return value.replace(fixMarkupRe, match => { + return html.replace(fixMarkupRe, match => { if (match === '\n') { return options.useBR ? '
' : match; } else if (options.tabReplace) { @@ -550,6 +621,13 @@ const HLJS = function(hljs) { }); } + /** + * Builds new class name for block given the language name + * + * @param {string} prevClassName + * @param {string} [currentLang] + * @param {string} [resultLang] + */ function buildClassName(prevClassName, currentLang, resultLang) { var language = currentLang ? aliases[currentLang] : resultLang; var result = [prevClassName.trim()]; @@ -565,24 +643,27 @@ const HLJS = function(hljs) { return result.join(' ').trim(); } - /* - Applies highlighting to a DOM node containing code. Accepts a DOM node and - two optional parameters for fixMarkup. + /** + * Applies highlighting to a DOM node containing code. Accepts a DOM node and + * two optional parameters for fixMarkup. + * + * @param {HighlightedHTMLElement} element - the HTML element to highlight */ - function highlightBlock(block) { + function highlightBlock(element) { + /** @type HTMLElement */ let node = null; - const language = blockLanguage(block); + const language = blockLanguage(element); if (shouldNotHighlight(language)) return; fire("before:highlightBlock", - { block: block, language: language }); + { block: element, language: language }); if (options.useBR) { node = document.createElement('div'); - node.innerHTML = block.innerHTML.replace(/\n/g, '').replace(//g, '\n'); + node.innerHTML = element.innerHTML.replace(/\n/g, '').replace(//g, '\n'); } else { - node = block; + node = element; } const text = node.textContent; const result = language ? highlight(language, text, true) : highlightAuto(text); @@ -595,55 +676,62 @@ const HLJS = function(hljs) { } result.value = fixMarkup(result.value); - fire("after:highlightBlock", { block: block, result: result }); + fire("after:highlightBlock", { block: element, result: result }); - block.innerHTML = result.value; - block.className = buildClassName(block.className, language, result.language); - block.result = { + element.innerHTML = result.value; + element.className = buildClassName(element.className, language, result.language); + element.result = { language: result.language, re: result.relevance }; if (result.second_best) { - block.second_best = { + element.second_best = { language: result.second_best.language, re: result.second_best.relevance }; } } - /* - Updates highlight.js global options with values passed in the form of an object. - */ + /** + * Updates highlight.js global options with the passed options + * + * @param {{}} userOptions + */ function configure(userOptions) { options = inherit(options, userOptions); } - /* - Applies highlighting to all
..
blocks on a page. - */ - function initHighlighting() { + /** + * Highlights to all
 blocks on a page
+   *
+   * @type {Function & {called?: boolean}}
+   */
+  const initHighlighting = () => {
     if (initHighlighting.called) return;
     initHighlighting.called = true;
 
     var blocks = document.querySelectorAll('pre code');
     ArrayProto.forEach.call(blocks, highlightBlock);
-  }
+  };
 
-  /*
-  Attaches highlighting to the page load event.
-  */
+  // Higlights all when DOMContentLoaded fires
   function initHighlightingOnLoad() {
+    // @ts-ignore
     window.addEventListener('DOMContentLoaded', initHighlighting, false);
   }
 
-  const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text' };
-
-  function registerLanguage(name, language) {
+  /**
+   * Register a language grammar module
+   *
+   * @param {string} languageName
+   * @param {LanguageFn} languageDefinition
+   */
+  function registerLanguage(languageName, languageDefinition) {
     var lang = null;
     try {
-      lang = language(hljs);
+      lang = languageDefinition(hljs);
     } catch (error) {
-      console.error("Language definition for '{}' could not be registered.".replace("{}", name));
+      console.error("Language definition for '{}' could not be registered.".replace("{}", languageName));
       // hard or soft error
       if (!SAFE_MODE) { throw error; } else { console.error(error); }
       // languages that have serious errors are replaced with essentially a
@@ -653,24 +741,30 @@ const HLJS = function(hljs) {
       lang = PLAINTEXT_LANGUAGE;
     }
     // give it a temporary name if it doesn't have one in the meta-data
-    if (!lang.name) lang.name = name;
-    languages[name] = lang;
-    lang.rawDefinition = language.bind(null, hljs);
+    if (!lang.name) lang.name = languageName;
+    languages[languageName] = lang;
+    lang.rawDefinition = languageDefinition.bind(null, hljs);
 
     if (lang.aliases) {
-      registerAliases(lang.aliases, { languageName: name });
+      registerAliases(lang.aliases, { languageName });
     }
   }
 
+  /**
+   * @returns {string[]} List of language internal names
+   */
   function listLanguages() {
     return Object.keys(languages);
   }
 
-  /*
+  /**
     intended usage: When one language truly requires another
 
     Unlike `getLanguage`, this will throw when the requested language
     is not available.
+
+    @param {string} name - name of the language to fetch/require
+    @returns {Language | never}
   */
   function requireLanguage(name) {
     var lang = getLanguage(name);
@@ -680,27 +774,48 @@ const HLJS = function(hljs) {
     throw err;
   }
 
+  /**
+   * @param {string} name - name of the language to retrieve
+   * @returns {Language | undefined}
+   */
   function getLanguage(name) {
     name = (name || '').toLowerCase();
     return languages[name] || languages[aliases[name]];
   }
 
-  function registerAliases(aliasList, {languageName}) {
+  /**
+   *
+   * @param {string|string[]} aliasList - single alias or list of aliases
+   * @param {{languageName: string}} opts
+   */
+  function registerAliases(aliasList, { languageName }) {
     if (typeof aliasList === 'string') {
-      aliasList = [aliasList]
+      aliasList = [aliasList];
     }
-    aliasList.forEach(alias => aliases[alias] = languageName);
+    aliasList.forEach(alias => { aliases[alias] = languageName; });
   }
 
+  /**
+   * Determines if a given language has auto-detection enabled
+   * @param {string} name - name of the language
+   */
   function autoDetection(name) {
     var lang = getLanguage(name);
     return lang && !lang.disableAutodetect;
   }
 
+  /**
+   * @param {HLJSPlugin} plugin
+   */
   function addPlugin(plugin) {
     plugins.push(plugin);
   }
 
+  /**
+   *
+   * @param {PluginEvent} event
+   * @param {any} args
+   */
   function fire(event, args) {
     var cb = event;
     plugins.forEach(function(plugin) {
@@ -735,7 +850,9 @@ const HLJS = function(hljs) {
   hljs.versionString = packageJSON.version;
 
   for (const key in MODES) {
+    // @ts-ignore
     if (typeof MODES[key] === "object") {
+      // @ts-ignore
       deepFreeze(MODES[key]);
     }
   }
diff --git a/src/languages/abnf.js b/src/languages/abnf.js
index 3b45dff974..505a35426f 100644
--- a/src/languages/abnf.js
+++ b/src/languages/abnf.js
@@ -4,6 +4,7 @@ Author: Alex McKibben 
 Website: https://tools.ietf.org/html/rfc5234
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
     var regexes = {
         ruleDeclaration: "^[a-zA-Z][a-zA-Z0-9-]*",
diff --git a/src/languages/accesslog.js b/src/languages/accesslog.js
index 8d26334647..7826f8631e 100644
--- a/src/languages/accesslog.js
+++ b/src/languages/accesslog.js
@@ -5,6 +5,7 @@
  Website: https://httpd.apache.org/docs/2.4/logs.html#accesslog
  */
 
+ /** @type LanguageFn */
 export default function(hljs) {
   // https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
   var HTTP_VERBS = [
diff --git a/src/languages/actionscript.js b/src/languages/actionscript.js
index 80e4f9b724..bd290ef823 100644
--- a/src/languages/actionscript.js
+++ b/src/languages/actionscript.js
@@ -4,6 +4,7 @@ Author: Alexander Myadzel 
 Category: scripting
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
   var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
diff --git a/src/languages/ada.js b/src/languages/ada.js
index 64a96f6176..eba10a79d5 100644
--- a/src/languages/ada.js
+++ b/src/languages/ada.js
@@ -17,6 +17,7 @@ Description: Ada is a general-purpose programming language that has great suppor
 // xml (broken by Foo : Bar type), elm (broken by Foo : Bar type), vbscript-html (broken by body keyword)
 // sql (ada default.txt has a lot of sql keywords)
 
+/** @type LanguageFn */
 export default function(hljs) {
     // Regular expression for Ada numeric literals.
     // stolen form the VHDL highlighter
diff --git a/src/languages/angelscript.js b/src/languages/angelscript.js
index f192efa352..d04be25d50 100644
--- a/src/languages/angelscript.js
+++ b/src/languages/angelscript.js
@@ -5,6 +5,7 @@ Category: scripting
 Website: https://www.angelcode.com/angelscript/
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var builtInTypeMode = {
     className: 'built_in',
diff --git a/src/languages/apache.js b/src/languages/apache.js
index 2ee76a6861..9c8fd7db6c 100644
--- a/src/languages/apache.js
+++ b/src/languages/apache.js
@@ -7,6 +7,7 @@ Description: language definition for Apache configuration files (httpd.conf & .h
 Category: common, config
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var NUMBER_REF = {className: 'number', begin: '[\\$%]\\d+'};
   var NUMBER = {className: 'number', begin: '\\d+'};
diff --git a/src/languages/applescript.js b/src/languages/applescript.js
index 0fd9cc71c5..339f9b906d 100644
--- a/src/languages/applescript.js
+++ b/src/languages/applescript.js
@@ -5,6 +5,7 @@ Category: scripting
 Website: https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: ''});
   var PARAMS = {
diff --git a/src/languages/arcade.js b/src/languages/arcade.js
index 9485e20f91..8370158ebb 100644
--- a/src/languages/arcade.js
+++ b/src/languages/arcade.js
@@ -5,6 +5,8 @@
  Website: https://developers.arcgis.com/arcade/
  Description: ArcGIS Arcade is an expression language used in many Esri ArcGIS products such as Pro, Online, Server, Runtime, JavaScript, and Python
 */
+
+/** @type LanguageFn */
 export default function(hljs) {
   var IDENT_RE = '[A-Za-z_][0-9A-Za-z_]*';
   var KEYWORDS = {
@@ -25,7 +27,6 @@ export default function(hljs) {
       'TrackGeometryWindow TrackIndex TrackStartTime TrackWindow TypeOf Union UrlEncode Variance ' +
       'Weekday When Within Year '
   };
-  var EXPRESSIONS;
   var SYMBOL = {
     className: 'symbol',
     begin: '\\$[datastore|feature|layer|map|measure|sourcefeature|sourcelayer|targetfeature|targetlayer|value|view]+'
@@ -43,7 +44,7 @@ export default function(hljs) {
     className: 'subst',
     begin: '\\$\\{', end: '\\}',
     keywords: KEYWORDS,
-    contains: []  // defined later
+    contains: [] // defined later
   };
   var TEMPLATE_STRING = {
     className: 'string',
diff --git a/src/languages/arduino.js b/src/languages/arduino.js
index 8bd1098ce8..823e20395c 100644
--- a/src/languages/arduino.js
+++ b/src/languages/arduino.js
@@ -6,6 +6,7 @@ Requires: cpp.js
 Website: https://www.arduino.cc
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
 
 	var ARDUINO_KW = {
diff --git a/src/languages/armasm.js b/src/languages/armasm.js
index a8b993534a..eadcaf077d 100644
--- a/src/languages/armasm.js
+++ b/src/languages/armasm.js
@@ -5,6 +5,7 @@ Description: ARM Assembly including Thumb and Thumb2 instructions
 Category: assembler
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
     //local labels: %?[FB]?[AT]?\d{1,2}\w+
 
diff --git a/src/languages/asciidoc.js b/src/languages/asciidoc.js
index 84774a937f..419a2d551a 100644
--- a/src/languages/asciidoc.js
+++ b/src/languages/asciidoc.js
@@ -7,6 +7,7 @@ Description: A semantic, text-based document format that can be exported to HTML
 Category: markup
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'AsciiDoc',
diff --git a/src/languages/aspectj.js b/src/languages/aspectj.js
index f12c3c8ecb..5b5d5740da 100644
--- a/src/languages/aspectj.js
+++ b/src/languages/aspectj.js
@@ -4,7 +4,9 @@ Author: Hakan Ozler 
 Website: https://www.eclipse.org/aspectj/
 Description: Syntax Highlighting for the AspectJ Language which is a general-purpose aspect-oriented extension to the Java programming language.
  */
-export default function (hljs) {
+
+/** @type LanguageFn */
+export default function(hljs) {
   var KEYWORDS =
     'false synchronized int abstract float private char boolean static null if const ' +
     'for true while long throw strictfp finally protected import native final return void ' +
diff --git a/src/languages/autohotkey.js b/src/languages/autohotkey.js
index 030715c6fd..94c5d19ad6 100644
--- a/src/languages/autohotkey.js
+++ b/src/languages/autohotkey.js
@@ -5,6 +5,7 @@ Description: AutoHotkey language definition
 Category: scripting
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var BACKTICK_ESCAPE = {
     begin: '`[\\s\\S]'
diff --git a/src/languages/autoit.js b/src/languages/autoit.js
index 8a6f05439e..f5ecd57cf9 100644
--- a/src/languages/autoit.js
+++ b/src/languages/autoit.js
@@ -5,6 +5,7 @@ Description: AutoIt language definition
 Category: scripting
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
     var KEYWORDS = 'ByRef Case Const ContinueCase ContinueLoop ' +
         'Default Dim Do Else ElseIf EndFunc EndIf EndSelect ' +
diff --git a/src/languages/avrasm.js b/src/languages/avrasm.js
index 4d3c5add9c..de2c7a46d9 100644
--- a/src/languages/avrasm.js
+++ b/src/languages/avrasm.js
@@ -5,6 +5,7 @@ Category: assembler
 Website: https://www.microchip.com/webdoc/avrassembler/avrassembler.wb_instruction_list.html
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'AVR Assembly',
diff --git a/src/languages/awk.js b/src/languages/awk.js
index 48ef1de47b..0d61c54cc5 100644
--- a/src/languages/awk.js
+++ b/src/languages/awk.js
@@ -5,6 +5,7 @@ Website: https://www.gnu.org/software/gawk/manual/gawk.html
 Description: language definition for Awk scripts
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var VARIABLE = {
     className: 'variable',
diff --git a/src/languages/axapta.js b/src/languages/axapta.js
index 5f4a3633ea..e91207963b 100644
--- a/src/languages/axapta.js
+++ b/src/languages/axapta.js
@@ -5,6 +5,7 @@ Website: https://dynamics.microsoft.com/en-us/ax-overview/
 Category: enterprise
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'Dynamics 365',
diff --git a/src/languages/bash.js b/src/languages/bash.js
index 0e52636449..e199f4f448 100644
--- a/src/languages/bash.js
+++ b/src/languages/bash.js
@@ -6,6 +6,7 @@ Website: https://www.gnu.org/software/bash/
 Category: common
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   const VAR = {};
   const BRACED_VAR = {
diff --git a/src/languages/basic.js b/src/languages/basic.js
index 6b5f57e14b..c37bedac71 100644
--- a/src/languages/basic.js
+++ b/src/languages/basic.js
@@ -5,6 +5,7 @@ Description: Based on the BASIC reference from the Tandy 1000 guide
 Website: https://en.wikipedia.org/wiki/Tandy_1000
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'BASIC',
diff --git a/src/languages/bnf.js b/src/languages/bnf.js
index 6c83904089..d4edc03bc6 100644
--- a/src/languages/bnf.js
+++ b/src/languages/bnf.js
@@ -4,6 +4,7 @@ Website: https://en.wikipedia.org/wiki/Backus–Naur_form
 Author: Oleg Efimov 
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'Backus–Naur Form',
diff --git a/src/languages/brainfuck.js b/src/languages/brainfuck.js
index e5d813142b..957d19618b 100644
--- a/src/languages/brainfuck.js
+++ b/src/languages/brainfuck.js
@@ -4,6 +4,7 @@ Author: Evgeny Stepanischev 
 Website: https://esolangs.org/wiki/Brainfuck
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var LITERAL = {
     className: 'literal',
diff --git a/src/languages/c-like.js b/src/languages/c-like.js
index ef795072e9..11fad83a89 100644
--- a/src/languages/c-like.js
+++ b/src/languages/c-like.js
@@ -13,6 +13,7 @@ change in v10 and don't have to change the requirements again later.
 See: https://github.com/highlightjs/highlight.js/issues/2146
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   function optional(s) {
     return '(?:' + s + ')?';
diff --git a/src/languages/c.js b/src/languages/c.js
index 854c9da016..70f0afc9ba 100644
--- a/src/languages/c.js
+++ b/src/languages/c.js
@@ -5,6 +5,7 @@ Website: https://en.wikipedia.org/wiki/C_(programming_language)
 Requires: c-like.js
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
 
   var lang = hljs.getLanguage('c-like').rawDefinition();
diff --git a/src/languages/cal.js b/src/languages/cal.js
index bb00952506..ab7342e2b7 100644
--- a/src/languages/cal.js
+++ b/src/languages/cal.js
@@ -5,6 +5,7 @@ Description: Provides highlighting of Microsoft Dynamics NAV C/AL code files
 Website: https://docs.microsoft.com/en-us/dynamics-nav/programming-in-c-al
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var KEYWORDS =
     'div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to ' +
diff --git a/src/languages/capnproto.js b/src/languages/capnproto.js
index ecff298499..5fea8fc84f 100644
--- a/src/languages/capnproto.js
+++ b/src/languages/capnproto.js
@@ -6,6 +6,7 @@ Website: https://capnproto.org/capnp-tool.html
 Category: protocols
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'Cap’n Proto',
diff --git a/src/languages/ceylon.js b/src/languages/ceylon.js
index 0f7eed3c96..f9b1b7e29c 100644
--- a/src/languages/ceylon.js
+++ b/src/languages/ceylon.js
@@ -3,6 +3,8 @@ Language: Ceylon
 Author: Lucas Werkmeister 
 Website: https://ceylon-lang.org
 */
+
+/** @type LanguageFn */
 export default function(hljs) {
   // 2.3. Identifiers and keywords
   var KEYWORDS =
diff --git a/src/languages/clean.js b/src/languages/clean.js
index a7ee3d96d8..f756675f02 100644
--- a/src/languages/clean.js
+++ b/src/languages/clean.js
@@ -5,6 +5,7 @@ Category: functional
 Website: http://clean.cs.ru.nl
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'Clean',
diff --git a/src/languages/clojure-repl.js b/src/languages/clojure-repl.js
index a0fae9a918..6cc1146c6e 100644
--- a/src/languages/clojure-repl.js
+++ b/src/languages/clojure-repl.js
@@ -7,6 +7,7 @@ Website: https://clojure.org
 Category: lisp
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'Clojure REPL',
diff --git a/src/languages/clojure.js b/src/languages/clojure.js
index cab6d2593c..bf0d877810 100644
--- a/src/languages/clojure.js
+++ b/src/languages/clojure.js
@@ -6,6 +6,7 @@ Website: https://clojure.org
 Category: lisp
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\'';
   var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*';
diff --git a/src/languages/cmake.js b/src/languages/cmake.js
index 6fb70f3262..040769c610 100644
--- a/src/languages/cmake.js
+++ b/src/languages/cmake.js
@@ -5,6 +5,7 @@ Author: Igor Kalnitsky 
 Website: https://cmake.org
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'CMake',
diff --git a/src/languages/coffeescript.js b/src/languages/coffeescript.js
index 60c8bb5a4a..458ce3872a 100644
--- a/src/languages/coffeescript.js
+++ b/src/languages/coffeescript.js
@@ -9,6 +9,7 @@ Website: https://coffeescript.org
 
 import * as ECMAScript from "./lib/ecmascript";
 
+/** @type LanguageFn */
 export default function(hljs) {
   var COFFEE_BUILT_INS = [
     'npm',
diff --git a/src/languages/coq.js b/src/languages/coq.js
index 032c16988e..8f8a4e573d 100644
--- a/src/languages/coq.js
+++ b/src/languages/coq.js
@@ -5,6 +5,7 @@ Category: functional
 Website: https://coq.inria.fr
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'Coq',
diff --git a/src/languages/cos.js b/src/languages/cos.js
index 18f1c8692a..48ae01b58e 100644
--- a/src/languages/cos.js
+++ b/src/languages/cos.js
@@ -4,6 +4,8 @@ Author: Nikita Savchenko 
 Category: enterprise, scripting
 Website: https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls
 */
+
+/** @type LanguageFn */
 export default function cos (hljs) {
 
   var STRINGS = {
diff --git a/src/languages/cpp.js b/src/languages/cpp.js
index aa41288a14..2f2bd748b6 100644
--- a/src/languages/cpp.js
+++ b/src/languages/cpp.js
@@ -5,8 +5,8 @@ Website: https://isocpp.org
 Requires: c-like.js
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
-
   var lang = hljs.getLanguage('c-like').rawDefinition();
   // return auto-detection back on
   lang.disableAutodetect = false;
diff --git a/src/languages/crmsh.js b/src/languages/crmsh.js
index 72165d1d12..ecbcefe836 100644
--- a/src/languages/crmsh.js
+++ b/src/languages/crmsh.js
@@ -6,6 +6,7 @@ Description: Syntax Highlighting for the crmsh DSL
 Category: config
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var RESOURCES = 'primitive rsc_template';
 
diff --git a/src/languages/crystal.js b/src/languages/crystal.js
index 6cd26ff1be..7230d6cb7b 100644
--- a/src/languages/crystal.js
+++ b/src/languages/crystal.js
@@ -4,6 +4,7 @@ Author: TSUYUSATO Kitsune 
 Website: https://crystal-lang.org
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var INT_SUFFIX = '(_*[ui](8|16|32|64|128))?';
   var FLOAT_SUFFIX = '(_*f(32|64))?';
diff --git a/src/languages/csharp.js b/src/languages/csharp.js
index 8294552c85..a68c265d17 100644
--- a/src/languages/csharp.js
+++ b/src/languages/csharp.js
@@ -6,6 +6,7 @@ Website: https://docs.microsoft.com/en-us/dotnet/csharp/
 Category: common
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var KEYWORDS = {
     keyword:
diff --git a/src/languages/csp.js b/src/languages/csp.js
index b024ec6de3..930c381f3c 100644
--- a/src/languages/csp.js
+++ b/src/languages/csp.js
@@ -7,6 +7,7 @@ Website: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
 vim: ts=2 sw=2 st=2
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'CSP',
diff --git a/src/languages/css.js b/src/languages/css.js
index 85e3dc1222..beabf84543 100644
--- a/src/languages/css.js
+++ b/src/languages/css.js
@@ -4,6 +4,7 @@ Category: common, css
 Website: https://developer.mozilla.org/en-US/docs/Web/CSS
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var FUNCTION_LIKE = {
     begin: /[\w-]+\(/, returnBegin: true,
diff --git a/src/languages/d.js b/src/languages/d.js
index b17be1696f..9f1d8be95e 100644
--- a/src/languages/d.js
+++ b/src/languages/d.js
@@ -23,6 +23,7 @@ Date: 2012-04-08
  *   up to the end of line is matched as special token sequence)
  */
 
+/** @type LanguageFn */
 export default function(hljs) {
   /**
    * Language keywords
diff --git a/src/languages/delphi.js b/src/languages/delphi.js
index b72d3bc2d2..334dddaae4 100644
--- a/src/languages/delphi.js
+++ b/src/languages/delphi.js
@@ -3,6 +3,7 @@ Language: Delphi
 Website: https://www.embarcadero.com/products/delphi
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   var KEYWORDS =
     'exports register file shl array record property for mod while set ally label uses raise not ' +
diff --git a/src/languages/diff.js b/src/languages/diff.js
index 213ff264ce..4bcbe27540 100644
--- a/src/languages/diff.js
+++ b/src/languages/diff.js
@@ -6,6 +6,7 @@ Website: https://www.gnu.org/software/diffutils/
 Category: common
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'Diff',
diff --git a/src/languages/dns.js b/src/languages/dns.js
index 0092c07c60..aa4f29a612 100644
--- a/src/languages/dns.js
+++ b/src/languages/dns.js
@@ -5,6 +5,7 @@ Category: config
 Website: https://en.wikipedia.org/wiki/Zone_file
 */
 
+/** @type LanguageFn */
 export default function(hljs) {
   return {
     name: 'DNS Zone',
diff --git a/src/lib/html_renderer.js b/src/lib/html_renderer.js
index bd6bb20307..9e98a07ab4 100644
--- a/src/lib/html_renderer.js
+++ b/src/lib/html_renderer.js
@@ -1,23 +1,53 @@
 import { escapeHTML } from './utils';
 
+/**
+ * @typedef {object} Renderer
+ * @property {(text: string) => void} addText
+ * @property {(node: Node) => void} openNode
+ * @property {(node: Node) => void} closeNode
+ * @property {() => string} value
+ */
+
+/** @typedef {{kind?: string, sublanguage?: boolean}} Node */
+/** @typedef {{walk: (r: Renderer) => void}} Tree */
+/** */
+
 const SPAN_CLOSE = '';
+
+/**
+ * Determines if a node needs to be wrapped in 
+ *
+ * @param {Node} node */
 const emitsWrappingTags = (node) => {
   return !!node.kind;
 };
 
+/** @type {Renderer} */
 export default class HTMLRenderer {
-  constructor(tree, options) {
+  /**
+   * Creates a new HTMLRenderer
+   *
+   * @param {Tree} parseTree - the parse tree (must support `walk` API)
+   * @param {{classPrefix: string}} options
+   */
+  constructor(parseTree, options) {
     this.buffer = "";
     this.classPrefix = options.classPrefix;
-    tree.walk(this);
+    parseTree.walk(this);
   }
 
-  // renderer API
-
+  /**
+   * Adds texts to the output stream
+   *
+   * @param {string} text */
   addText(text) {
     this.buffer += escapeHTML(text);
   }
 
+  /**
+   * Adds a node open to the output stream (if needed)
+   *
+   * @param {Node} node */
   openNode(node) {
     if (!emitsWrappingTags(node)) return;
 
@@ -28,19 +58,31 @@ export default class HTMLRenderer {
     this.span(className);
   }
 
+  /**
+   * Adds a node close to the output stream (if needed)
+   *
+   * @param {Node} node */
   closeNode(node) {
     if (!emitsWrappingTags(node)) return;
 
     this.buffer += SPAN_CLOSE;
   }
 
+  /**
+   * returns the accumulated buffer
+  */
+  value() {
+    return this.buffer;
+  }
+
   // helpers
 
+  /**
+   * Builds a span element
+   *
+   * @param {string} className */
   span(className) {
     this.buffer += ``;
   }
 
-  value() {
-    return this.buffer;
-  }
 }
diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js
index 8e63eeba17..063283b173 100644
--- a/src/lib/mode_compiler.js
+++ b/src/lib/mode_compiler.js
@@ -6,8 +6,21 @@ var COMMON_KEYWORDS = 'of and for in not or if then'.split(' ');
 
 // compilation
 
+/**
+ * Compiles a language definition result
+ *
+ * Given the raw result of a language definition (Language), compiles this so
+ * that it is ready for highlighting code.
+ * @param {Language} language
+ * @returns {CompiledLanguage}
+ */
 export function compileLanguage(language) {
-
+  /**
+   * Builds a regex with the case sensativility of the current language
+   *
+   * @param {RegExp | string} value
+   * @param {boolean} [global]
+   */
   function langRe(value, global) {
     return new RegExp(
       regex.source(value),
@@ -31,13 +44,16 @@ export function compileLanguage(language) {
   class MultiRegex {
     constructor() {
       this.matchIndexes = {};
+      // @ts-ignore
       this.regexes = [];
       this.matchAt = 1;
       this.position = 0;
     }
 
+    // @ts-ignore
     addRule(re, opts) {
       opts.position = this.position++;
+      // @ts-ignore
       this.matchIndexes[this.matchAt] = opts;
       this.regexes.push([opts, re]);
       this.matchAt += regex.countMatchGroups(re) + 1;
@@ -46,13 +62,15 @@ export function compileLanguage(language) {
     compile() {
       if (this.regexes.length === 0) {
         // avoids the need to check length every time exec is called
+        // @ts-ignore
         this.exec = () => null;
       }
       const terminators = this.regexes.map(el => el[1]);
-      this.matcherRe = langRe(regex.join(terminators, '|'), true);
+      this.matcherRe = langRe(regex.join(terminators), true);
       this.lastIndex = 0;
     }
 
+    /** @param {string} s */
     exec(s) {
       this.matcherRe.lastIndex = this.lastIndex;
       const match = this.matcherRe.exec(s);
@@ -60,6 +78,7 @@ export function compileLanguage(language) {
 
       // eslint-disable-next-line no-undefined
       const i = match.findIndex((el, i) => i > 0 && el !== undefined);
+      // @ts-ignore
       const matchData = this.matchIndexes[i];
       // trim off any earlier non-relevant match groups (ie, the other regex
       // match groups that make up the multi-matcher)
@@ -102,7 +121,9 @@ export function compileLanguage(language) {
   */
   class ResumableMultiRegex {
     constructor() {
+      // @ts-ignore
       this.rules = [];
+      // @ts-ignore
       this.multiRegexes = [];
       this.count = 0;
 
@@ -110,6 +131,7 @@ export function compileLanguage(language) {
       this.regexIndex = 0;
     }
 
+    // @ts-ignore
     getMatcher(index) {
       if (this.multiRegexes[index]) return this.multiRegexes[index];
 
@@ -124,11 +146,13 @@ export function compileLanguage(language) {
       this.regexIndex = 0;
     }
 
+    // @ts-ignore
     addRule(re, opts) {
       this.rules.push([re, opts]);
       if (opts.type === "begin") this.count++;
     }
 
+    /** @param {string} s */
     exec(s) {
       const m = this.getMatcher(this.regexIndex);
       m.lastIndex = this.lastIndex;
@@ -145,6 +169,13 @@ export function compileLanguage(language) {
     }
   }
 
+  /**
+   * Given a mode, builds a huge ResumableMultiRegex that can be used to walk
+   * the content and find matches.
+   *
+   * @param {CompiledMode} mode
+   * @returns {ResumableMultiRegex}
+   */
   function buildModeRegex(mode) {
     const mm = new ResumableMultiRegex();
 
@@ -161,11 +192,20 @@ export function compileLanguage(language) {
   }
 
   // TODO: We need negative look-behind support to do this properly
-  function skipIfhasPrecedingOrTrailingDot(match, resp) {
+  /**
+   * Skip a match if it has a preceding or trailing dot
+   *
+   * This is used for `beginKeywords` to prevent matching expressions such as
+   * `bob.keyword.do()`. The mode compiler automatically wires this up as a
+   * special _internal_ 'on:begin' callback for modes with `beginKeywords`
+   * @param {RegExpMatchArray} match
+   * @param {CallbackResponse} response
+   */
+  function skipIfhasPrecedingOrTrailingDot(match, response) {
     const before = match.input[match.index - 1];
     const after = match.input[match.index + match[0].length];
     if (before === "." || after === ".") {
-      resp.ignoreMatch();
+      response.ignoreMatch();
     }
   }
 
@@ -199,8 +239,18 @@ export function compileLanguage(language) {
    *             - The parser cursor is not moved forward.
    */
 
+  /**
+   * Compiles an individual mode
+   *
+   * This can raise an error if the mode contains certain detectable known logic
+   * issues.
+   * @param {Mode} mode
+   * @param {CompiledMode | null} [parent]
+   * @returns {CompiledMode | never}
+   */
   function compileMode(mode, parent) {
-    if (mode.compiled) return;
+    const cmode = /** @type CompiledMode */ (mode);
+    if (mode.compiled) return cmode;
     mode.compiled = true;
 
     // __beforeBegin is considered private API, internal use only
@@ -225,7 +275,7 @@ export function compileLanguage(language) {
 
     // `mode.lexemes` was the old standard before we added and now recommend
     // using `keywords.$pattern` to pass the keyword pattern
-    mode.keywordPatternRe = langRe(mode.lexemes || kw_pattern || /\w+/, true);
+    cmode.keywordPatternRe = langRe(mode.lexemes || kw_pattern || /\w+/, true);
 
     if (parent) {
       if (mode.beginKeywords) {
@@ -237,51 +287,68 @@ export function compileLanguage(language) {
         mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?=\\b|\\s)';
         mode.__beforeBegin = skipIfhasPrecedingOrTrailingDot;
       }
-      if (!mode.begin)
-        mode.begin = /\B|\b/;
-      mode.beginRe = langRe(mode.begin);
-      if (mode.endSameAsBegin)
-        mode.end = mode.begin;
-      if (!mode.end && !mode.endsWithParent)
-        mode.end = /\B|\b/;
-      if (mode.end)
-        mode.endRe = langRe(mode.end);
-      mode.terminator_end = regex.source(mode.end) || '';
-      if (mode.endsWithParent && parent.terminator_end)
-        mode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end;
-    }
-    if (mode.illegal)
-      mode.illegalRe = langRe(mode.illegal);
-    if (mode.relevance == null)
-      mode.relevance = 1;
-    if (!mode.contains) {
-      mode.contains = [];
+      if (!mode.begin) mode.begin = /\B|\b/;
+      cmode.beginRe = langRe(mode.begin);
+      if (mode.endSameAsBegin) mode.end = mode.begin;
+      if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/;
+      if (mode.end) cmode.endRe = langRe(mode.end);
+      cmode.terminator_end = regex.source(mode.end) || '';
+      if (mode.endsWithParent && parent.terminator_end) {
+        cmode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end;
+      }
     }
+    if (mode.illegal) cmode.illegalRe = langRe(mode.illegal);
+    // eslint-disable-next-line no-undefined
+    if (mode.relevance === undefined) mode.relevance = 1;
+    if (!mode.contains) mode.contains = [];
+
     mode.contains = [].concat(...mode.contains.map(function(c) {
       return expand_or_clone_mode(c === 'self' ? mode : c);
     }));
-    mode.contains.forEach(function(c) { compileMode(c, mode); });
+    mode.contains.forEach(function(c) { compileMode(/** @type Mode */ (c), cmode); });
 
     if (mode.starts) {
       compileMode(mode.starts, parent);
     }
 
-    mode.matcher = buildModeRegex(mode);
+    cmode.matcher = buildModeRegex(cmode);
+    return cmode;
   }
 
   // self is not valid at the top-level
   if (language.contains && language.contains.includes('self')) {
     throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");
   }
-  compileMode(language);
+  return compileMode(/** @type Mode */ (language));
 }
 
+/**
+ * Determines if a mode has a dependency on it's parent or not
+ *
+ * If a mode does have a parent dependency then often we need to clone it if
+ * it's used in multiple places so that each copy points to the correct parent,
+ * where-as modes without a parent can often safely be re-used at the bottom of
+ * a mode chain.
+ *
+ * @param {Mode | null} mode
+ * @returns {boolean} - is there a dependency on the parent?
+ * */
 function dependencyOnParent(mode) {
   if (!mode) return false;
 
   return mode.endsWithParent || dependencyOnParent(mode.starts);
 }
 
+/**
+ * Expands a mode or clones it if necessary
+ *
+ * This is necessary for modes with parental dependenceis (see notes on
+ * `dependencyOnParent`) and for nodes that have `variants` - which must then be
+ * exploded into their own individual modes at compile time.
+ *
+ * @param {Mode} mode
+ * @returns {Mode | Mode[]}
+ * */
 function expand_or_clone_mode(mode) {
   if (mode.variants && !mode.cached_variants) {
     mode.cached_variants = mode.variants.map(function(variant) {
@@ -312,9 +379,18 @@ function expand_or_clone_mode(mode) {
   return mode;
 }
 
-// keywords
+/***********************************************
+  Keywords
+***********************************************/
 
+/**
+ * Given raw keywords from a language definition, compile them.
+ *
+ * @param {string | Record} rawKeywords
+ * @param {boolean} case_insensitive
+ */
 function compileKeywords(rawKeywords, case_insensitive) {
+  /** @type KeywordDict */
   var compiled_keywords = {};
 
   if (typeof rawKeywords === 'string') { // string
@@ -328,17 +404,33 @@ function compileKeywords(rawKeywords, case_insensitive) {
 
   // ---
 
-  function splitAndCompile(className, str) {
+  /**
+   * Compiles an individual list of keywords
+   *
+   * Ex: "for if when while|5"
+   *
+   * @param {string} className
+   * @param {string} keywordList
+   */
+  function splitAndCompile(className, keywordList) {
     if (case_insensitive) {
-      str = str.toLowerCase();
+      keywordList = keywordList.toLowerCase();
     }
-    str.split(' ').forEach(function(keyword) {
+    keywordList.split(' ').forEach(function(keyword) {
       var pair = keyword.split('|');
       compiled_keywords[pair[0]] = [className, scoreForKeyword(pair[0], pair[1])];
     });
   }
 }
 
+/**
+ * Returns the proper score for a given keyword
+ *
+ * Also takes into account comment keywords, which will be scored 0 UNLESS
+ * another score has been manually assigned.
+ * @param {string} keyword
+ * @param {string} [providedScore]
+ */
 function scoreForKeyword(keyword, providedScore) {
   // manual scores always win over common keywords
   // so you can force a score of 1 if you really insist
@@ -349,6 +441,10 @@ function scoreForKeyword(keyword, providedScore) {
   return commonKeyword(keyword) ? 0 : 1;
 }
 
-function commonKeyword(word) {
-  return COMMON_KEYWORDS.includes(word.toLowerCase());
+/**
+ * Determines if a given keyword is common or not
+ *
+ * @param {string} keyword */
+function commonKeyword(keyword) {
+  return COMMON_KEYWORDS.includes(keyword.toLowerCase());
 }
diff --git a/src/lib/modes.js b/src/lib/modes.js
index 669968d58f..33d18a9105 100644
--- a/src/lib/modes.js
+++ b/src/lib/modes.js
@@ -9,6 +9,9 @@ export const C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+
 export const BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b...
 export const RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
 
+/**
+* @param { Partial & {binary?: string | RegExp} } opts
+*/
 export const SHEBANG = (opts = {}) => {
   const beginShebang = /^#![ ]*\//;
   if (opts.binary) {
@@ -23,6 +26,7 @@ export const SHEBANG = (opts = {}) => {
     begin: beginShebang,
     end: /$/,
     relevance: 0,
+    /** @type {ModeCallback} */
     "on:begin": (m, resp) => {
       if (m.index !== 0) resp.ignoreMatch();
     }
@@ -50,15 +54,23 @@ export const QUOTE_STRING_MODE = {
 export const PHRASAL_WORDS_MODE = {
   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|they|like|more)\b/
 };
-export const COMMENT = function(begin, end, inherits) {
+/**
+ * Creates a comment mode
+ *
+ * @param {string | RegExp} begin
+ * @param {string | RegExp} end
+ * @param {Mode | {}} [modeOptions]
+ * @returns {Partial}
+ */
+export const COMMENT = function(begin, end, modeOptions = {}) {
   var mode = inherit(
     {
       className: 'comment',
-      begin: begin,
-      end: end,
+      begin,
+      end,
       contains: []
     },
-    inherits || {}
+    modeOptions
   );
   mode.contains.push(PHRASAL_WORDS_MODE);
   mode.contains.push({
@@ -139,10 +151,19 @@ export const METHOD_GUARD = {
   relevance: 0
 };
 
+/**
+ * Adds end same as begin mechanics to a mode
+ *
+ * Your mode must include at least a single () match group as that first match
+ * group is what is used for comparison
+ * @param {Partial} mode
+ */
 export const END_SAME_AS_BEGIN = function(mode) {
   return Object.assign(mode,
     {
-    'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; },
-    'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch() }
+      /** @type {ModeCallback} */
+      'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; },
+      /** @type {ModeCallback} */
+      'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch(); }
     });
 };
diff --git a/src/lib/regex.js b/src/lib/regex.js
index 80a9ce1b70..1727cb57b9 100644
--- a/src/lib/regex.js
+++ b/src/lib/regex.js
@@ -1,26 +1,52 @@
+/**
+ * @param {string} value
+ * @returns {RegExp}
+ * */
 export function escape(value) {
   return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm');
 }
 
+/**
+ * @param {RegExp | string } re
+ * @returns {string}
+ */
 export function source(re) {
-  // if it's a regex get it's source,
-  // otherwise it's a string already so just return it
-  return (re && re.source) || re;
+  if (!re) return null;
+  if (typeof re === "string") return re;
+
+  return re.source;
 }
 
-export function lookahead(regex) {
-  return concat('(?=', regex, ')');
+/**
+ * @param {RegExp | string } re
+ * @returns {string}
+ */
+export function lookahead(re) {
+  return concat('(?=', re, ')');
 }
 
+/**
+ * @param {(RegExp | string)[] } args
+ * @returns {string}
+ */
 export function concat(...args) {
   const joined = args.map((x) => source(x)).join("");
   return joined;
 }
 
+/**
+ * @param {RegExp} re
+ * @returns {number}
+ */
 export function countMatchGroups(re) {
   return (new RegExp(re.toString() + '|')).exec('').length - 1;
 }
 
+/**
+ * Does lexeme start with a regular expression match at the beginning
+ * @param {RegExp} re
+ * @param {string} lexeme
+ */
 export function startsWith(re, lexeme) {
   var match = re && re.exec(lexeme);
   return match && match.index === 0;
@@ -31,7 +57,12 @@ export function startsWith(re, lexeme) {
 // it also places each individual regular expression into it's own
 // match group, keeping track of the sequencing of those match groups
 // is currently an exercise for the caller. :-)
-export function join(regexps, separator) {
+/**
+ * @param {(string | RegExp)[]} regexps
+ * @param {string} separator
+ * @returns {string}
+ */
+export function join(regexps, separator = "|") {
   // backreferenceRe matches an open parenthesis or backreference. To avoid
   // an incorrect parse, it additionally matches the following:
   // - [...] elements, where the meaning of parentheses and escapes change
diff --git a/src/lib/response.js b/src/lib/response.js
index 9c5bcfa95c..c49c6df59f 100644
--- a/src/lib/response.js
+++ b/src/lib/response.js
@@ -1,7 +1,11 @@
 export default class Response {
+  /**
+   * @param {CompiledMode} mode
+   */
   constructor(mode) {
-    if (mode.data === undefined)
-      mode.data = {};
+    // eslint-disable-next-line no-undefined
+    if (mode.data === undefined) mode.data = {};
+
     this.data = mode.data;
   }
 
diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js
index f3f851f29e..6e2fba63b2 100644
--- a/src/lib/token_tree.js
+++ b/src/lib/token_tree.js
@@ -1,7 +1,12 @@
 import HTMLRenderer from './html_renderer';
 
+/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} | string} Node */
+/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} } DataNode */
+/**  */
+
 class TokenTree {
   constructor() {
+    /** @type DataNode */
     this.rootNode = { children: [] };
     this.stack = [this.rootNode];
   }
@@ -12,11 +17,14 @@ class TokenTree {
 
   get root() { return this.rootNode; }
 
+  /** @param {Node} node */
   add(node) {
     this.top.children.push(node);
   }
 
+  /** @param {string} kind */
   openNode(kind) {
+    /** @type Node */
     const node = { kind, children: [] };
     this.add(node);
     this.stack.push(node);
@@ -26,6 +34,8 @@ class TokenTree {
     if (this.stack.length > 1) {
       return this.stack.pop();
     }
+    // eslint-disable-next-line no-undefined
+    return undefined;
   }
 
   closeAllNodes() {
@@ -36,10 +46,21 @@ class TokenTree {
     return JSON.stringify(this.rootNode, null, 4);
   }
 
+  /**
+   * @typedef { import("./html_renderer").Renderer } Renderer
+   * @param {Renderer} builder
+   */
   walk(builder) {
+    // this does not
     return this.constructor._walk(builder, this.rootNode);
+    // this works
+    // return TokenTree._walk(builder, this.rootNode);
   }
 
+  /**
+   * @param {Renderer} builder
+   * @param {Node} node
+   */
   static _walk(builder, node) {
     if (typeof node === "string") {
       builder.addText(node);
@@ -51,16 +72,19 @@ class TokenTree {
     return builder;
   }
 
+  /**
+   * @param {Node} node
+   */
   static _collapse(node) {
-    if (!node.children) {
-      return;
-    }
+    if (typeof node === "string") return;
+    if (!node.children) return;
+
     if (node.children.every(el => typeof el === "string")) {
-      node.text = node.children.join("");
-      delete node.children;
+      // node.text = node.children.join("");
+      // delete node.children;
+      node.children = [node.children.join("")];
     } else {
       node.children.forEach((child) => {
-        if (typeof child === "string") return;
         TokenTree._collapse(child);
       });
     }
@@ -83,12 +107,23 @@ class TokenTree {
   - toHTML()
 
 */
+
+/**
+ * @implements {Emitter}
+ */
 export default class TokenTreeEmitter extends TokenTree {
+  /**
+   * @param {*} options
+   */
   constructor(options) {
     super();
     this.options = options;
   }
 
+  /**
+   * @param {string} text
+   * @param {string} kind
+   */
   addKeyword(text, kind) {
     if (text === "") { return; }
 
@@ -97,13 +132,21 @@ export default class TokenTreeEmitter extends TokenTree {
     this.closeNode();
   }
 
+  /**
+   * @param {string} text
+   */
   addText(text) {
     if (text === "") { return; }
 
     this.add(text);
   }
 
+  /**
+   * @param {Emitter & {root: DataNode}} emitter
+   * @param {string} name
+   */
   addSublanguage(emitter, name) {
+    /** @type DataNode */
     const node = emitter.root;
     node.kind = name;
     node.sublanguage = true;
diff --git a/src/lib/utils.js b/src/lib/utils.js
index c07128de10..7993ab7cd2 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -1,3 +1,7 @@
+/**
+ * @param {string} value
+ * @returns {string}
+ */
 export function escapeHTML(value) {
   return value.replace(/&/g, '&').replace(//g, '>');
 }
@@ -5,31 +9,47 @@ export function escapeHTML(value) {
 /**
  * performs a shallow merge of multiple objects into one
  *
- * @arguments list of objects with properties to merge
- * @returns a single new object
+ * @template T
+ * @param {T} original
+ * @param {Record[]} objects
+ * @returns {T} a single new object
  */
-export function inherit(parent) { // inherit(parent, override_obj, override_obj, ...)
+export function inherit(original, ...objects) {
+  /** @type Record */
   var result = {};
-  var objects = Array.prototype.slice.call(arguments, 1);
 
-  for (const key in parent) {
-    result[key] = parent[key];
+  for (const key in original) {
+    result[key] = original[key];
   }
   objects.forEach(function(obj) {
     for (const key in obj) {
       result[key] = obj[key];
     }
   });
-  return result;
+  return /** @type {T} */ (result);
 }
 
 /* Stream merging */
 
+/**
+ * @typedef Event
+ * @property {'start'|'stop'} event
+ * @property {number} offset
+ * @property {Node} node
+ */
+
+/**
+ * @param {Node} node
+ */
 function tag(node) {
   return node.nodeName.toLowerCase();
 }
 
+/**
+ * @param {Node} node
+ */
 export function nodeStream(node) {
+  /** @type Event[] */
   var result = [];
   (function _nodeStream(node, offset) {
     for (var child = node.firstChild; child; child = child.nextSibling) {
@@ -59,6 +79,11 @@ export function nodeStream(node) {
   return result;
 }
 
+/**
+ * @param {any} original - the original stream
+ * @param {any} highlighted - stream of the highlighted source
+ * @param {string} value - the original source itself
+ */
 export function mergeStreams(original, highlighted, value) {
   var processed = 0;
   var result = '';
@@ -90,17 +115,28 @@ export function mergeStreams(original, highlighted, value) {
     return highlighted[0].event === 'start' ? original : highlighted;
   }
 
+  /**
+   * @param {Node} node
+   */
   function open(node) {
-    function attr_str(a) {
-      return ' ' + a.nodeName + '="' + escapeHTML(a.value).replace(/"/g, '"') + '"';
+    /** @param {Attr} attr */
+    function attr_str(attr) {
+      return ' ' + attr.nodeName + '="' + escapeHTML(attr.value).replace(/"/g, '"') + '"';
     }
+    // @ts-ignore
     result += '<' + tag(node) + [].map.call(node.attributes, attr_str).join('') + '>';
   }
 
+  /**
+   * @param {Node} node
+   */
   function close(node) {
     result += '';
   }
 
+  /**
+   * @param {Event} event
+   */
   function render(event) {
     (event.event === 'start' ? open : close)(event.node);
   }
diff --git a/src/vendor/deep_freeze.js b/src/vendor/deep_freeze.js
index 0bc2c2d003..c5ce3eb560 100644
--- a/src/vendor/deep_freeze.js
+++ b/src/vendor/deep_freeze.js
@@ -1,20 +1,21 @@
 // https://github.com/substack/deep-freeze/blob/master/index.js
-export default function deepFreeze (o) {
-  Object.freeze(o);
+/** @param {any} obj */
+export default function deepFreeze(obj) {
+  Object.freeze(obj);
 
-  var objIsFunction = typeof o === 'function';
+  var objIsFunction = typeof obj === 'function';
 
-  Object.getOwnPropertyNames(o).forEach(function (prop) {
-    if (o.hasOwnProperty(prop)
-    && o[prop] !== null
-    && (typeof o[prop] === "object" || typeof o[prop] === "function")
+  Object.getOwnPropertyNames(obj).forEach(function(prop) {
+    if (Object.hasOwnProperty.call(obj, prop)
+    && obj[prop] !== null
+    && (typeof obj[prop] === "object" || typeof obj[prop] === "function")
     // IE11 fix: https://github.com/highlightjs/highlight.js/issues/2318
     // TODO: remove in the future
     && (objIsFunction ? prop !== 'caller' && prop !== 'callee' && prop !== 'arguments' : true)
-    && !Object.isFrozen(o[prop])) {
-      deepFreeze(o[prop]);
+    && !Object.isFrozen(obj[prop])) {
+      deepFreeze(obj[prop]);
     }
   });
 
-  return o;
-};
+  return obj;
+}
diff --git a/test/markup/index.js b/test/markup/index.js
index dea935f1f3..b43ff81dde 100644
--- a/test/markup/index.js
+++ b/test/markup/index.js
@@ -6,6 +6,8 @@ const hljs     = require('../../build');
 const path     = require('path');
 const utility  = require('../utility');
 
+hljs.debugMode();
+
 const { getThirdPartyPackages } = require("../../tools/lib/external_language")
 
 function testLanguage(language, {testDir}) {
diff --git a/tools/build_node.js b/tools/build_node.js
index 2e258a1c9b..ed30b5d675 100644
--- a/tools/build_node.js
+++ b/tools/build_node.js
@@ -75,9 +75,11 @@ async function buildNode(options) {
   mkdir("lib/languages");
   mkdir("scss");
   mkdir("styles");
+  mkdir("types");
 
   install("./LICENSE", "LICENSE");
   install("./README.md","README.md");
+  install("./types/index.d.ts","types/index.d.ts");
 
   log("Writing styles.");
   const styles = await fs.readdir("./src/styles/");
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000000..10bdf3ba1e
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,64 @@
+{
+  "compilerOptions": {
+    /* Basic Options */
+    "target": "es2016",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
+    "module": "es2015",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
+    // "lib": [],                             /* Specify library files to be included in the compilation. */
+    "allowJs": true,                       /* Allow javascript files to be compiled. */
+    "checkJs": true,                       /* Report errors in .js files. */
+    // "jsx": "preserve",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
+    // "declaration": true,                   /* Generates corresponding '.d.ts' file. */
+    // "declarationMap": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */
+    // "sourceMap": true,                     /* Generates corresponding '.map' file. */
+    // "outFile": "./",                       /* Concatenate and emit output to single file. */
+    "outDir": "./build",                        /* Redirect output structure to the directory. */
+    // "rootDir": "./src",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
+    // "composite": true,                     /* Enable project compilation */
+    // "removeComments": true,                /* Do not emit comments to output. */
+    // "noEmit": true,                        /* Do not emit outputs. */
+    // "importHelpers": true,                 /* Import emit helpers from 'tslib'. */
+    // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
+    // "isolatedModules": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
+
+    /* Strict Type-Checking Options */
+    "strict": false,                           /* Enable all strict type-checking options. */
+    "noImplicitAny": true,                   /* Raise error on expressions and declarations with an implied 'any' type. */
+    "strictNullChecks": false,              /* Enable strict null checks. */
+    // "strictFunctionTypes": true,           /* Enable strict checking of function types. */
+    // "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */
+    // "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */
+    // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */
+
+    /* Additional Checks */
+    "noUnusedLocals": true,                /* Report errors on unused locals. */
+    "noUnusedParameters": true,            /* Report errors on unused parameters. */
+    "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */
+    "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */
+
+    /* Module Resolution Options */
+    "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
+    // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */
+    // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
+    // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */
+    // "typeRoots": ["./"],                       /* List of folders to include type definitions from. */
+    "types": [
+      "./types/index"
+      ],                           /* Type declaration files to be included in compilation. */
+    // "allowSyntheticDefaultImports": true,  /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
+    "esModuleInterop": true,                   /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
+    // "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */
+    "resolveJsonModule": true,
+
+    /* Source Map Options */
+    // "sourceRoot": "",                      /* Specify the location where debugger should locate TypeScript files instead of source locations. */
+    // "mapRoot": "",                         /* Specify the location where debugger should locate map files instead of generated locations. */
+    // "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */
+    // "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
+
+    /* Experimental Options */
+    // "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */
+    // "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */,
+
+  },
+  "include": ["src/**/*", "tests/**/*"]
+}
diff --git a/types/index.d.ts b/types/index.d.ts
new file mode 100644
index 0000000000..b9eb0d317a
--- /dev/null
+++ b/types/index.d.ts
@@ -0,0 +1,212 @@
+/* Public API */
+
+// eslint-disable-next-line
+declare const hljs : HLJSApi;
+
+interface HLJSApi {
+    highlight: (languageName: string, code: string, ignoreIllegals?: boolean, continuation?: Mode) => HighlightResult
+    highlightAuto: (code: string, languageSubset?: string[]) => AutoHighlightResult
+    fixMarkup: (html: string) => string
+    highlightBlock: (element: HTMLElement) => void
+    configure: (options: Partial) => void
+    initHighlighting: () => void
+    initHighlightingOnLoad: () => void
+    registerLanguage: (languageName: string, language: LanguageFn) => void
+    listLanguages: () => string[]
+    registerAliases: (aliasList: string | string[], { languageName } : {languageName: string}) => void
+    getLanguage: (languageName: string) => Language | undefined
+    requireLanguage: (languageName: string) => Language | never
+    autoDetection: (languageName: string) => boolean
+    inherit: (original: T, ...args: Record[]) => T
+    addPlugin: (plugin: HLJSPlugin) => void
+    debugMode: () => void
+    safeMode: () => void
+    versionString: string
+}
+
+interface HLJSApi {
+    SHEBANG: (mode?: Partial & {binary?: string | RegExp}) => Mode
+    BACKSLASH_ESCAPE: Mode
+    QUOTE_STRING_MODE: Mode
+    APOS_STRING_MODE: Mode
+    PHRASAL_WORDS_MODE: Mode
+    COMMENT: (begin: string | RegExp, end: string | RegExp, modeOpts?: Mode | {}) => Mode
+    C_LINE_COMMENT_MODE: Mode
+    C_BLOCK_COMMENT_MODE: Mode
+    HASH_COMMENT_MODE: Mode
+    NUMBER_MODE: Mode
+    C_NUMBER_MODE: Mode
+    BINARY_NUMBER_MODE: Mode
+    CSS_NUMBER_MODE: Mode
+    REGEXP_MODE: Mode
+    TITLE_MODE: Mode
+    UNDERSCORE_TITLE_MODE: Mode
+    METHOD_GUARD: Mode
+    END_SAME_AS_BEGIN: (mode: Mode) => Mode
+    // build in regex
+    IDENT_RE: string
+    UNDERSCORE_IDENT_RE: string
+    NUMBER_RE: string
+    C_NUMBER_RE: string
+    BINARY_NUMBER_RE: string
+    RE_STARTERS_RE: string
+}
+
+type LanguageFn = (hljs: HLJSApi) => Language
+
+// interface RawLanguage {
+//     name?: string
+//     aliases?: string[]
+//     rawDefinition?: () => Language
+// }
+
+interface HighlightResult {
+    relevance : number
+    value : string
+    language? : string
+    emitter : Emitter
+    illegal : boolean
+    top? : Language | CompiledMode
+    illegalBy? : illegalData
+    sofar? : string
+    errorRaised? : Error
+    // * for auto-highlight
+    second_best? : Omit
+}
+
+interface illegalData {
+    msg: string
+    context: string
+    mode: CompiledMode
+}
+
+interface AutoHighlightResult extends HighlightResult {
+}
+
+type PluginEvent =
+    'before:highlight'
+    | 'after:highlight'
+    | 'before:highlightBlock'
+    | 'after:highlightBlock'
+
+type HLJSPlugin = { [K in PluginEvent]? : any }
+
+interface EmitterConstructor {
+    new (opts: any): Emitter
+}
+
+interface HLJSOptions {
+   noHighlightRe: RegExp
+   languageDetectRe: RegExp
+   classPrefix: string
+   tabReplace?: string
+   useBR: boolean
+   languages?: string[]
+   __emitter: EmitterConstructor
+}
+
+interface CallbackResponse {
+    data: Record
+    ignoreMatch: () => void
+}
+
+/************
+ PRIVATE API
+ ************/
+
+/* for jsdoc annotations in the JS source files */
+
+type AnnotatedError = Error & {mode?: Mode | Language, languageName?: string, badRule?: Mode}
+
+type ModeCallback = (match: RegExpMatchArray, response: CallbackResponse) => void
+type HighlightedHTMLElement = HTMLElement & {result?: object, second_best?: object, parentNode: HTMLElement}
+type EnhancedMatch = RegExpMatchArray & {rule: CompiledMode, type: MatchType}
+type MatchType = "begin" | "end" | "illegal"
+
+ interface Emitter {
+    addKeyword(text: string, kind: string): void
+    addText(text: string): void
+    toHTML(): string
+    finalize(): void
+    closeAllNodes(): void
+    openNode(kind: string): void
+    closeNode(): void
+    addSublanguage(emitter: Emitter, subLanguageName: string): void
+ }
+
+/* modes */
+
+ interface ModeCallbacks {
+     "on:end"?: Function,
+     "on:begin"?: Function,
+ }
+
+interface Mode extends ModeCallbacks, ModeDetails {
+
+}
+
+interface LanguageDetail {
+    name?: string
+    rawDefinition?: () => Language
+    aliases?: string[]
+    disableAutodetect?: boolean
+    contains: ("self"|Mode)[]
+    case_insensitive?: boolean
+    keywords?: Record | string
+    compiled?: boolean
+}
+
+type Language = LanguageDetail & Partial
+
+interface CompiledLanguage extends LanguageDetail, CompiledMode {
+    compiled: true
+    contains: CompiledMode[]
+    keywords: Record
+}
+
+type KeywordData = [string, number];
+type KeywordDict = Record
+
+type CompiledMode = Omit &
+    {
+        contains: CompiledMode[]
+        keywords: KeywordDict
+        data: Record
+        terminator_end: string
+        keywordPatternRe: RegExp
+        beginRe: RegExp
+        endRe: RegExp
+        illegalRe: RegExp
+        matcher: any
+        compiled: true
+        starts?: CompiledMode
+        parent?: CompiledMode
+    }
+
+interface ModeDetails {
+    begin?: RegExp | string
+    end?: RegExp | string
+    className?: string
+    contains?: ("self" | Mode)[]
+    endsParent?: boolean
+    endsWithParent?: boolean
+    endSameAsBegin?: boolean
+    skip?: boolean
+    excludeBegin?: boolean
+    excludeEnd?: boolean
+    returnBegin?: boolean
+    returnEnd?: boolean
+    __beforeBegin?: Function
+    parent?: Mode
+    starts?:Mode
+    lexemes?: string | RegExp
+    keywords?: Record | string
+    beginKeywords?: string
+    relevance?: number
+    illegal?: string | RegExp
+    variants?: Mode[]
+    cached_variants?: Mode[]
+    // parsed
+    subLanguage?: string | string[]
+    compiled?: boolean
+}

From 63f367c46f2eeb6f9b7a3545e325eeeb917f9942 Mon Sep 17 00:00:00 2001
From: Josh Goebel 
Date: Fri, 15 May 2020 19:15:40 -0400
Subject: [PATCH 103/816] (parser) highlightBlock result key `re` =>
 `relevance` (#2553)

---
 CHANGES.md       | 2 ++
 src/highlight.js | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index a631b26860..684bea0c5d 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -13,6 +13,8 @@ Parser Engine:
 
 Deprecations:
 
+- when using `highlightBlock` `result.re` deprecated. Use `result.relevance` instead. (#2552) [Josh Goebel][]
+- ditto for `result.second_best.re` => `result.second_best.relevance` (#2552)
 - `lexemes` is now deprecated in favor of `keywords.$pattern` key (#2519) [Josh Goebel][]
 - `endSameAsBegin` is now deprecated. (#2261) [Josh Goebel][]
 
diff --git a/src/highlight.js b/src/highlight.js
index 9b24b1682d..fbcca7a24d 100644
--- a/src/highlight.js
+++ b/src/highlight.js
@@ -682,12 +682,16 @@ const HLJS = function(hljs) {
     element.className = buildClassName(element.className, language, result.language);
     element.result = {
       language: result.language,
-      re: result.relevance
+      // TODO: remove with version 11.0
+      re: result.relevance,
+      relavance: result.relevance,
     };
     if (result.second_best) {
       element.second_best = {
         language: result.second_best.language,
-        re: result.second_best.relevance
+        // TODO: remove with version 11.0
+        re: result.second_best.relevance,
+        relavance: result.second_best.relevance
       };
     }
   }

From e9e7b44a348065522eec49d406f614a2b4aef5ee Mon Sep 17 00:00:00 2001
From: Nils Knappmeier 
Date: Tue, 19 May 2020 16:05:46 +0200
Subject: [PATCH 104/816] enh(handlebars) Support for sub-expressions,
 path-expressions, hashes, block-parameters and literals (#2344)

- `htmlbars` grammar is now deprecated. Use `handlebars` instead.

A stub is included so that anyone literally referencing the old `htmlbars` file (say manually requiring it in Node.js, etc) is still covered, but everyone should transition to `handlebars` now.
---
 CHANGES.md                                    |   3 +
 src/languages/handlebars.js                   | 213 +++++++++++++++---
 src/languages/htmlbars.js                     | 110 +++------
 src/lib/regex.js                              |   2 +-
 test/detect/htmlbars/default.txt              |   9 -
 ...ck-expression-variants-in-param.expect.txt |   4 +-
 .../handlebars/block-parameters-as.expect.txt |   4 +
 .../markup/handlebars/block-parameters-as.txt |   3 +
 test/markup/handlebars/built-ins.expect.txt   |   4 +-
 .../combinations-with-text.expect.txt         |   6 +
 .../handlebars/combinations-with-text.txt     |   5 +
 test/markup/handlebars/comments.expect.txt    |   2 +-
 .../handlebars/else-variants.expect.txt       |  11 +
 test/markup/handlebars/else-variants.txt      |  10 +
 .../handlebars/escaped-mustaches.expect.txt   |   6 +-
 .../handlebars/expression-variants.expect.txt |  24 +-
 test/markup/handlebars/hashes.expect.txt      |  12 +
 test/markup/handlebars/hashes.txt             |  11 +
 .../literals-in-different-places.expect.txt   |  14 ++
 .../literals-in-different-places.txt          |  13 ++
 test/markup/handlebars/literals.expect.txt    |  14 ++
 test/markup/handlebars/literals.txt           |  13 ++
 .../markup/handlebars/partial-call.expect.txt |   2 +-
 .../handlebars/path-expressions.expect.txt    |  10 +
 test/markup/handlebars/path-expressions.txt   |   9 +
 test/markup/handlebars/raw-block.expect.txt   |   2 +-
 .../handlebars/simple-expression.expect.txt   |   2 +-
 .../handlebars/sub-expressions.expect.txt     |  14 +-
 test/markup/handlebars/sub-expressions.txt    |  12 +
 .../handlebars/triple-mustache.expect.txt     |   2 +-
 30 files changed, 408 insertions(+), 138 deletions(-)
 delete mode 100644 test/detect/htmlbars/default.txt
 create mode 100644 test/markup/handlebars/block-parameters-as.expect.txt
 create mode 100644 test/markup/handlebars/block-parameters-as.txt
 create mode 100644 test/markup/handlebars/combinations-with-text.expect.txt
 create mode 100644 test/markup/handlebars/combinations-with-text.txt
 create mode 100644 test/markup/handlebars/else-variants.expect.txt
 create mode 100644 test/markup/handlebars/else-variants.txt
 create mode 100644 test/markup/handlebars/hashes.expect.txt
 create mode 100644 test/markup/handlebars/hashes.txt
 create mode 100644 test/markup/handlebars/literals-in-different-places.expect.txt
 create mode 100644 test/markup/handlebars/literals-in-different-places.txt
 create mode 100644 test/markup/handlebars/literals.expect.txt
 create mode 100644 test/markup/handlebars/literals.txt
 create mode 100644 test/markup/handlebars/path-expressions.expect.txt
 create mode 100644 test/markup/handlebars/path-expressions.txt

diff --git a/CHANGES.md b/CHANGES.md
index 684bea0c5d..294ba0defb 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -13,6 +13,7 @@ Parser Engine:
 
 Deprecations:
 
+- `htmlbars` grammar is now deprecated. Use `handlebars` instead. (#2344) [Nils Knappmeier][]
 - when using `highlightBlock` `result.re` deprecated. Use `result.relevance` instead. (#2552) [Josh Goebel][]
 - ditto for `result.second_best.re` => `result.second_best.relevance` (#2552)
 - `lexemes` is now deprecated in favor of `keywords.$pattern` key (#2519) [Josh Goebel][]
@@ -37,6 +38,7 @@ Language Improvements:
 - fix(swift) `@objcMembers` was being partially highlighted (#2543) [Nick Randall][]
 - enh(dart) Add `late` and `required` keywords, and `Never` built-in type (#2550) [Sam Rawlins][]
 - enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][]
+- enh(handlebars) Support for sub-expressions, path-expressions, hashes, block-parameters and literals (#2344) [Nils Knappmeier][]
 
 [Josh Goebel]: https://github.com/yyyc514
 [Peter Plantinga]: https://github.com/pplantinga
@@ -46,6 +48,7 @@ Language Improvements:
 [Nick Randall]: https://github.com/nicked
 [Sam Rawlins]: https://github.com/srawlins
 [Sergey Prokhorov]: https://github.com/seriyps
+[Nils Knappmeier]: https://github.com/nknapp
 
 
 ## Version 10.0.2
diff --git a/src/languages/handlebars.js b/src/languages/handlebars.js
index 7fea1c3cca..8578982470 100644
--- a/src/languages/handlebars.js
+++ b/src/languages/handlebars.js
@@ -7,38 +7,183 @@ Website: https://handlebarsjs.com
 Category: template
 */
 
+import * as regex from '../lib/regex'
+
 export default function(hljs) {
-  var BUILT_INS = {'builtin-name': 'each in with if else unless bindattr action collection debugger log outlet template unbound view yield lookup'};
+  const BUILT_INS = {
+    'builtin-name': [
+      'action',
+      'bindattr',
+      'collection',
+      'component',
+      'concat',
+      'debugger',
+      'each',
+      'each-in',
+      'get',
+      'hash',
+      'if',
+      'in',
+      'input',
+      'link-to',
+      'loc',
+      'log',
+      'lookup',
+      'mut',
+      'outlet',
+      'partial',
+      'query-params',
+      'render',
+      'template',
+      'textarea',
+      'unbound',
+      'unless',
+      'view',
+      'with',
+      'yield'
+    ].join(" ")
+  };
 
-  var IDENTIFIER_PLAIN_OR_QUOTED = {
-    begin: /".*?"|'.*?'|\[.*?\]|\w+/
+  const LITERALS = {
+    literal: [
+      'true',
+      'false',
+      'undefined',
+      'null'
+    ].join(" ")
   };
 
-  var EXPRESSION_OR_HELPER_CALL = hljs.inherit(IDENTIFIER_PLAIN_OR_QUOTED, {
-    keywords: BUILT_INS,
+  // as defined in https://handlebarsjs.com/guide/expressions.html#literal-segments
+  // this regex matches literal segments like ' abc ' or [ abc ] as well as helpers and paths
+  // like a/b, ./abc/cde, and abc.bcd
+
+  const DOUBLE_QUOTED_ID_REGEX=/".*?"/;
+  const SINGLE_QUOTED_ID_REGEX=/'.*?'/;
+  const BRACKET_QUOTED_ID_REGEX=/\[.*?\]/;
+  const PLAIN_ID_REGEX=/[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/;
+  const PATH_DELIMITER_REGEX=/\.|\//;
+
+  const IDENTIFIER_REGEX = regex.concat(
+    '(',
+    SINGLE_QUOTED_ID_REGEX, '|',
+    DOUBLE_QUOTED_ID_REGEX, '|',
+    BRACKET_QUOTED_ID_REGEX, '|',
+    PLAIN_ID_REGEX, '|',
+    PATH_DELIMITER_REGEX,
+    ')+'
+  );
+
+  // identifier followed by a equal-sign (without the equal sign)
+  const HASH_PARAM_REGEX = regex.concat(
+    '(',
+    BRACKET_QUOTED_ID_REGEX, '|',
+    PLAIN_ID_REGEX,
+    ')(?==)'
+  );
+
+  const HELPER_NAME_OR_PATH_EXPRESSION = {
+    begin: IDENTIFIER_REGEX,
+    lexemes: /[\w.\/]+/
+  };
+
+  const HELPER_PARAMETER = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {
+    keywords: LITERALS
+  });
+
+  const SUB_EXPRESSION = {
+    begin: /\(/,
+    end: /\)/
+    // the "contains" is added below when all necessary sub-modes are defined
+  };
+
+  const HASH = {
+    // fka "attribute-assignment", parameters of the form 'key=value'
+    className: 'attr',
+    begin: HASH_PARAM_REGEX,
+    relevance: 0,
     starts: {
-      // helper params
-      endsWithParent: true,
-      relevance: 0,
-      contains: [hljs.inherit(IDENTIFIER_PLAIN_OR_QUOTED, {relevance: 0})]
+      begin: /=/,
+      end: /=/,
+      starts: {
+        contains: [
+          hljs.NUMBER_MODE,
+          hljs.QUOTE_STRING_MODE,
+          hljs.APOS_STRING_MODE,
+          HELPER_PARAMETER,
+          SUB_EXPRESSION
+        ]
+      }
     }
+  };
+
+  const BLOCK_PARAMS = {
+    // parameters of the form '{{#with x as | y |}}...{{/with}}'
+    begin: /as\s+\|/,
+    keywords: { keyword: 'as' },
+    end: /\|/,
+    contains: [
+      {
+        // define sub-mode in order to prevent highlighting of block-parameter named "as"
+        begin: /\w+/
+      }
+    ]
+  };
+
+  const HELPER_PARAMETERS = {
+    contains: [
+      hljs.NUMBER_MODE,
+      hljs.QUOTE_STRING_MODE,
+      hljs.APOS_STRING_MODE,
+      BLOCK_PARAMS,
+      HASH,
+      HELPER_PARAMETER,
+      SUB_EXPRESSION
+    ],
+    returnEnd: true
+    // the property "end" is defined through inheritance when the mode is used. If depends
+    // on the surrounding mode, but "endsWithParent" does not work here (i.e. it includes the
+    // end-token of the surrounding mode)
+  };
+
+  const SUB_EXPRESSION_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {
+    className: 'name',
+    keywords: BUILT_INS,
+    starts: hljs.inherit(HELPER_PARAMETERS, {
+      end: /\)/,
+    })
   });
 
-  var BLOCK_MUSTACHE_CONTENTS = hljs.inherit(EXPRESSION_OR_HELPER_CALL, {
+  SUB_EXPRESSION.contains = [
+    SUB_EXPRESSION_CONTENTS
+  ];
+
+  const OPENING_BLOCK_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {
+    keywords: BUILT_INS,
+    className: 'name',
+    starts: hljs.inherit(HELPER_PARAMETERS, {
+      end: /}}/,
+    })
+  });
+
+  const CLOSING_BLOCK_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {
+    keywords: BUILT_INS,
     className: 'name'
   });
 
-  var BASIC_MUSTACHE_CONTENTS = hljs.inherit(EXPRESSION_OR_HELPER_CALL, {
-    // relevance 0 for backward compatibility concerning auto-detection
-    relevance: 0
+  const BASIC_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {
+    className: 'name',
+    keywords: BUILT_INS,
+    starts: hljs.inherit(HELPER_PARAMETERS, {
+      end: /}}/,
+    })
   });
 
-  var ESCAPE_MUSTACHE_WITH_PRECEEDING_BACKSLASH = {begin: /\\\{\{/, skip: true};
-  var PREVENT_ESCAPE_WITH_ANOTHER_PRECEEDING_BACKSLASH = {begin: /\\\\(?=\{\{)/, skip: true};
+  const ESCAPE_MUSTACHE_WITH_PRECEEDING_BACKSLASH = {begin: /\\\{\{/, skip: true};
+  const PREVENT_ESCAPE_WITH_ANOTHER_PRECEEDING_BACKSLASH = {begin: /\\\\(?=\{\{)/, skip: true};
 
   return {
     name: 'Handlebars',
-    aliases: ['hbs', 'html.hbs', 'html.handlebars'],
+    aliases: ['hbs', 'html.hbs', 'html.handlebars', 'htmlbars'],
     case_insensitive: true,
     subLanguage: 'xml',
     contains: [
@@ -49,34 +194,50 @@ export default function(hljs) {
       {
         // open raw block "{{{{raw}}}} content not evaluated {{{{/raw}}}}"
         className: 'template-tag',
-        begin: /\{\{\{\{(?!\/)/, end: /\}\}\}\}/,
-        contains: [BLOCK_MUSTACHE_CONTENTS],
+        begin: /\{\{\{\{(?!\/)/,
+        end: /\}\}\}\}/,
+        contains: [OPENING_BLOCK_MUSTACHE_CONTENTS],
         starts: {end: /\{\{\{\{\//, returnEnd: true, subLanguage: 'xml'}
       },
       {
         // close raw block
         className: 'template-tag',
-        begin: /\{\{\{\{\//, end: /\}\}\}\}/,
-        contains: [BLOCK_MUSTACHE_CONTENTS]
+        begin: /\{\{\{\{\//,
+        end: /\}\}\}\}/,
+        contains: [CLOSING_BLOCK_MUSTACHE_CONTENTS]
       },
       {
         // open block statement
         className: 'template-tag',
-        begin: /\{\{[#\/]/, end: /\}\}/,
-        contains: [BLOCK_MUSTACHE_CONTENTS],
+        begin: /\{\{#/,
+        end: /\}\}/,
+        contains: [OPENING_BLOCK_MUSTACHE_CONTENTS],
+      },
+      {
+        className: 'template-tag',
+        begin: /\{\{(?=else\}\})/,
+        end: /\}\}/,
+        keywords: 'else'
+      },
+      {
+        // closing block statement
+        className: 'template-tag',
+        begin: /\{\{\//,
+        end: /\}\}/,
+        contains: [CLOSING_BLOCK_MUSTACHE_CONTENTS],
       },
       {
         // template variable or helper-call that is NOT html-escaped
         className: 'template-variable',
-        begin: /\{\{\{/, end: /\}\}\}/,
-        keywords: BUILT_INS,
+        begin: /\{\{\{/,
+        end: /\}\}\}/,
         contains: [BASIC_MUSTACHE_CONTENTS]
       },
       {
         // template variable or helper-call that is html-escaped
         className: 'template-variable',
-        begin: /\{\{/, end: /\}\}/,
-        keywords: BUILT_INS,
+        begin: /\{\{/,
+        end: /\}\}/,
         contains: [BASIC_MUSTACHE_CONTENTS]
       }
     ]
diff --git a/src/languages/htmlbars.js b/src/languages/htmlbars.js
index 11a4488107..df09b5357d 100644
--- a/src/languages/htmlbars.js
+++ b/src/languages/htmlbars.js
@@ -1,86 +1,42 @@
 /*
-Language: HTMLBars
-Requires: xml.js, handlebars.js
-Author: Michael Johnston 
-Description: Matcher for HTMLBars
-Website: https://github.com/tildeio/htmlbars
-Category: template
+ Language: HTMLBars (legacy)
+ Requires: xml.js
+ Description: Matcher for Handlebars as well as EmberJS additions.
+ Website: https://github.com/tildeio/htmlbars
+ Category: template
+ */
+
+/*
+
+See: https://github.com/highlightjs/highlight.js/issues/2181
+
+This file is a stub that is only left in place for compatbility reasons for
+anyone who may be manually pulling in this file via a require or fetching
+it individually via CDN.
+
+TODO: Remove in version 11.0.
+
 */
 
-export default function(hljs) {
-  // This work isn't complete yet but this is done so that this technically
-  // breaking change becomes a part of the 10.0 release and won't force
-  // us to prematurely release 11.0 just to break this.
-  var SHOULD_INHERIT_FROM_HANDLEBARS = hljs.requireLanguage('handlebars');
-  // https://github.com/highlightjs/highlight.js/issues/2181
+// compile time dependency on handlebars
+import handlebars from "./handlebars"
 
-  var BUILT_INS = 'action collection component concat debugger each each-in else get hash if input link-to loc log mut outlet partial query-params render textarea unbound unless with yield view';
+export default function(hljs) {
+  const definition = handlebars(hljs)
 
-  var ATTR_ASSIGNMENT = {
-    illegal: /\}\}/,
-    begin: /[a-zA-Z0-9_]+=/,
-    returnBegin: true,
-    relevance: 0,
-    contains: [
-      {
-        className: 'attr', begin: /[a-zA-Z0-9_]+/
-      }
-    ]
-  };
+  definition.name = "HTMLbars"
 
-  var SUB_EXPR = {
-    illegal: /\}\}/,
-    begin: /\)/, end: /\)/,
-    contains: [
-      {
-        begin: /[a-zA-Z\.\-]+/,
-        keywords: {built_in: BUILT_INS},
-        starts: {
-          endsWithParent: true, relevance: 0,
-          contains: [
-            hljs.QUOTE_STRING_MODE,
-          ]
-        }
-      }
-    ]
-  };
+  // HACK: This lets handlebars do the auto-detection if it's been loaded (by
+  // default the build script will load in alphabetical order) and if not (perhaps
+  // an install is only using `htmlbars`, not `handlebars`) then this will still
+  // allow HTMLBars to participate in the auto-detection
 
-  var TAG_INNARDS = {
-    endsWithParent: true, relevance: 0,
-    keywords: {keyword: 'as', built_in: BUILT_INS},
-    contains: [
-      hljs.QUOTE_STRING_MODE,
-      ATTR_ASSIGNMENT,
-      hljs.NUMBER_MODE
-    ]
-  };
+  // worse case someone will have HTMLbars and handlebars competing for the same
+  // content and will need to change their setup to only require handlebars, but
+  // I don't consider this a breaking change
+  if (hljs.getLanguage("handlebars")) {
+    definition.disableAutodetect = true
+  }
 
-  return {
-    name: 'HTMLBars',
-    case_insensitive: true,
-    subLanguage: 'xml',
-    contains: [
-      hljs.COMMENT('{{!(--)?', '(--)?}}'),
-      {
-        className: 'template-tag',
-        begin: /\{\{[#\/]/, end: /\}\}/,
-        contains: [
-          {
-            className: 'name',
-            begin: /[a-zA-Z\.\-]+/,
-            keywords: {'builtin-name': BUILT_INS},
-            starts: TAG_INNARDS
-          }
-        ]
-      },
-      {
-        className: 'template-variable',
-        begin: /\{\{[a-zA-Z][a-zA-Z\-]+/, end: /\}\}/,
-        keywords: {keyword: 'as', built_in: BUILT_INS},
-        contains: [
-          hljs.QUOTE_STRING_MODE
-        ]
-      }
-    ]
-  };
+  return definition
 }
diff --git a/src/lib/regex.js b/src/lib/regex.js
index 1727cb57b9..6f2a5967d9 100644
--- a/src/lib/regex.js
+++ b/src/lib/regex.js
@@ -26,7 +26,7 @@ export function lookahead(re) {
 }
 
 /**
- * @param {(RegExp | string)[] } args
+ * @param {...(RegExp | string) } args
  * @returns {string}
  */
 export function concat(...args) {
diff --git a/test/detect/htmlbars/default.txt b/test/detect/htmlbars/default.txt
deleted file mode 100644
index c3003aef0a..0000000000
--- a/test/detect/htmlbars/default.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-
- {{!-- only output this author names if an author exists --}} - {{#if author}} - {{#playwright-wrapper playwright=author action=(mut author) as |playwright|}} -

{{playwright.firstName}} {{playwright.lastName}}

- {{/playwright-wrapper}} - {{/if}} - {{yield}} -
diff --git a/test/markup/handlebars/block-expression-variants-in-param.expect.txt b/test/markup/handlebars/block-expression-variants-in-param.expect.txt index ae081bc79b..1d6250a0a8 100644 --- a/test/markup/handlebars/block-expression-variants-in-param.expect.txt +++ b/test/markup/handlebars/block-expression-variants-in-param.expect.txt @@ -1,6 +1,6 @@ -text {{#abc "lite]'ral}}segment" }}a{{/abc}} +text {{#abc "lite]'ral}}segment" }}a{{/abc}} -text {{#abc 'lite]"ral}}segment' }}a{{/abc}} +text {{#abc 'lite]"ral}}segment' }}a{{/abc}} text {{#abc [lite"'ral}}segment] }}a{{/abc}} diff --git a/test/markup/handlebars/block-parameters-as.expect.txt b/test/markup/handlebars/block-parameters-as.expect.txt new file mode 100644 index 0000000000..87547011c7 --- /dev/null +++ b/test/markup/handlebars/block-parameters-as.expect.txt @@ -0,0 +1,4 @@ +{{#each filter as | value index|}} {{/each}} + +{{#with as as | as |}} {{/with}} + diff --git a/test/markup/handlebars/block-parameters-as.txt b/test/markup/handlebars/block-parameters-as.txt new file mode 100644 index 0000000000..4f696ef7af --- /dev/null +++ b/test/markup/handlebars/block-parameters-as.txt @@ -0,0 +1,3 @@ +{{#each filter as | value index|}} {{/each}} + +{{#with as as | as |}} {{/with}} diff --git a/test/markup/handlebars/built-ins.expect.txt b/test/markup/handlebars/built-ins.expect.txt index cedd3aa3e6..06b6df66a8 100644 --- a/test/markup/handlebars/built-ins.expect.txt +++ b/test/markup/handlebars/built-ins.expect.txt @@ -6,7 +6,7 @@ {{#each test}}abc{{/each}} -{{lookup abc}} +{{lookup abc}} -{{log test}} +{{log test}} diff --git a/test/markup/handlebars/combinations-with-text.expect.txt b/test/markup/handlebars/combinations-with-text.expect.txt new file mode 100644 index 0000000000..383bea58a6 --- /dev/null +++ b/test/markup/handlebars/combinations-with-text.expect.txt @@ -0,0 +1,6 @@ +some text + +{{#custom (nested (helper 'a{{bc' 1)) key=value as | blockParam |}} some {{blockParam}} text {{/custom}} + +some text + diff --git a/test/markup/handlebars/combinations-with-text.txt b/test/markup/handlebars/combinations-with-text.txt new file mode 100644 index 0000000000..a30fdf882a --- /dev/null +++ b/test/markup/handlebars/combinations-with-text.txt @@ -0,0 +1,5 @@ +some text + +{{#custom (nested (helper 'a{{bc' 1)) key=value as | blockParam |}} some {{blockParam}} text {{/custom}} + +some text diff --git a/test/markup/handlebars/comments.expect.txt b/test/markup/handlebars/comments.expect.txt index d1dbff8968..e8f3741766 100644 --- a/test/markup/handlebars/comments.expect.txt +++ b/test/markup/handlebars/comments.expect.txt @@ -1,4 +1,4 @@ -{{!-- a comment {{expression}} --}} {{expression}} +{{!-- a comment {{expression}} --}} {{expression}} {{! a simple comment }} diff --git a/test/markup/handlebars/else-variants.expect.txt b/test/markup/handlebars/else-variants.expect.txt new file mode 100644 index 0000000000..55bc49d22c --- /dev/null +++ b/test/markup/handlebars/else-variants.expect.txt @@ -0,0 +1,11 @@ +{{#helper}}{{else}}else-block{{/helper}} + +{{#helper}}block{{else}}else-block{{/helper}} + +{{[else]}} in brackets is a helper, not a keyword + +{{#else}} as block helper name is not a keyword {{/else}} + +\{{else}} is not a keyword if escaped + + diff --git a/test/markup/handlebars/else-variants.txt b/test/markup/handlebars/else-variants.txt new file mode 100644 index 0000000000..1f9365c83c --- /dev/null +++ b/test/markup/handlebars/else-variants.txt @@ -0,0 +1,10 @@ +{{#helper}}{{else}}else-block{{/helper}} + +{{#helper}}block{{else}}else-block{{/helper}} + +{{[else]}} in brackets is a helper, not a keyword + +{{#else}} as block helper name is not a keyword {{/else}} + +\{{else}} is not a keyword if escaped + diff --git a/test/markup/handlebars/escaped-mustaches.expect.txt b/test/markup/handlebars/escaped-mustaches.expect.txt index da37eb1812..d56ec49a6a 100644 --- a/test/markup/handlebars/escaped-mustaches.expect.txt +++ b/test/markup/handlebars/escaped-mustaches.expect.txt @@ -12,11 +12,11 @@ <!-- escaped escapings --> -\\{{expression}} +\\{{expression}} -\\\{{expression}} +\\\{{expression}} -\\\\{{expression}} +\\\\{{expression}} \\\{{! comment }} diff --git a/test/markup/handlebars/expression-variants.expect.txt b/test/markup/handlebars/expression-variants.expect.txt index 48da6b13c7..dd1c2d9814 100644 --- a/test/markup/handlebars/expression-variants.expect.txt +++ b/test/markup/handlebars/expression-variants.expect.txt @@ -1,27 +1,27 @@ text -{{ "lite]'ral}}segment" }} text +{{ "lite]'ral}}segment" }} text -{{ 'lite]"ral}}segment' }} text +{{ 'lite]"ral}}segment' }} text -{{ [lite"'ral}}segment] }} text +{{ [lite"'ral}}segment] }} text -{{ abc "lite]'ral}}segment" }} text +{{ abc "lite]'ral}}segment" }} text -{{ abc 'lite]"ral}}segment' }} text +{{ abc 'lite]"ral}}segment' }} text -{{ abc [lite"'ral}}segment] }} text +{{ abc [lite"'ral}}segment] }} text -{{ abcd.[lite"'ral}}segment] }} text +{{ abcd.[lite"'ral}}segment] }} text -{{ abcd."lite]'ral}}segment" }} text +{{ abcd."lite]'ral}}segment" }} text -{{ abcd.'lite]"ral}}segment' }} text +{{ abcd.'lite]"ral}}segment' }} text -{{ abcd.''}} text +{{ abcd.''}} text -{{ abcd."" }} text +{{ abcd."" }} text -{{ abcd.[] }} text +{{ abcd.[] }} text diff --git a/test/markup/handlebars/hashes.expect.txt b/test/markup/handlebars/hashes.expect.txt new file mode 100644 index 0000000000..ddf626e066 --- /dev/null +++ b/test/markup/handlebars/hashes.expect.txt @@ -0,0 +1,12 @@ +{{helper key=value}} + +{{{helper key=value}}} + +{{>partial key=value}} + +{{#helper key=value}} {{/helper}} + +{{{{#helper key=value}}}} {{{{/helper}}}} + +{{helper (subExpression key=value)}} + diff --git a/test/markup/handlebars/hashes.txt b/test/markup/handlebars/hashes.txt new file mode 100644 index 0000000000..6c63673b89 --- /dev/null +++ b/test/markup/handlebars/hashes.txt @@ -0,0 +1,11 @@ +{{helper key=value}} + +{{{helper key=value}}} + +{{>partial key=value}} + +{{#helper key=value}} {{/helper}} + +{{{{#helper key=value}}}} {{{{/helper}}}} + +{{helper (subExpression key=value)}} diff --git a/test/markup/handlebars/literals-in-different-places.expect.txt b/test/markup/handlebars/literals-in-different-places.expect.txt new file mode 100644 index 0000000000..a82bd9f8d7 --- /dev/null +++ b/test/markup/handlebars/literals-in-different-places.expect.txt @@ -0,0 +1,14 @@ +{{helper true false a=true b=false}} + +{{{helper true false}}} + +{{#helper true false}} {{/helper}} + +{{{{#helper true false}}}} {{{{/helper}}}} + +{{>partial true}} + +{{helper (helper true false)}} + +{{helper a=true b=false}} + diff --git a/test/markup/handlebars/literals-in-different-places.txt b/test/markup/handlebars/literals-in-different-places.txt new file mode 100644 index 0000000000..da8fe7ce60 --- /dev/null +++ b/test/markup/handlebars/literals-in-different-places.txt @@ -0,0 +1,13 @@ +{{helper true false a=true b=false}} + +{{{helper true false}}} + +{{#helper true false}} {{/helper}} + +{{{{#helper true false}}}} {{{{/helper}}}} + +{{>partial true}} + +{{helper (helper true false)}} + +{{helper a=true b=false}} diff --git a/test/markup/handlebars/literals.expect.txt b/test/markup/handlebars/literals.expect.txt new file mode 100644 index 0000000000..65cfda721f --- /dev/null +++ b/test/markup/handlebars/literals.expect.txt @@ -0,0 +1,14 @@ +{{helper true false}} + +{{helper 1234}} + +{{helper null}} + +{{helper undefined}} + +{{helper 'string'}} + +{{helper "string"}} + +{{helper [not a string literal but a variable]}} + diff --git a/test/markup/handlebars/literals.txt b/test/markup/handlebars/literals.txt new file mode 100644 index 0000000000..622c80f246 --- /dev/null +++ b/test/markup/handlebars/literals.txt @@ -0,0 +1,13 @@ +{{helper true false}} + +{{helper 1234}} + +{{helper null}} + +{{helper undefined}} + +{{helper 'string'}} + +{{helper "string"}} + +{{helper [not a string literal but a variable]}} diff --git a/test/markup/handlebars/partial-call.expect.txt b/test/markup/handlebars/partial-call.expect.txt index 139b33a8f4..506dfef8fc 100644 --- a/test/markup/handlebars/partial-call.expect.txt +++ b/test/markup/handlebars/partial-call.expect.txt @@ -1,2 +1,2 @@ -{{> partial}} +{{> partial}} diff --git a/test/markup/handlebars/path-expressions.expect.txt b/test/markup/handlebars/path-expressions.expect.txt new file mode 100644 index 0000000000..b5307b1830 --- /dev/null +++ b/test/markup/handlebars/path-expressions.expect.txt @@ -0,0 +1,10 @@ +{{path.expression}} + +{{{path.expression}}} + +{{#path.expression}} {{/path.expression}} + +{{{{#path.expression}}}} {{{{/path.expression}}}} + +{{with.in.a.path.expression}} is not a built-in + diff --git a/test/markup/handlebars/path-expressions.txt b/test/markup/handlebars/path-expressions.txt new file mode 100644 index 0000000000..c898318e07 --- /dev/null +++ b/test/markup/handlebars/path-expressions.txt @@ -0,0 +1,9 @@ +{{path.expression}} + +{{{path.expression}}} + +{{#path.expression}} {{/path.expression}} + +{{{{#path.expression}}}} {{{{/path.expression}}}} + +{{with.in.a.path.expression}} is not a built-in diff --git a/test/markup/handlebars/raw-block.expect.txt b/test/markup/handlebars/raw-block.expect.txt index 93b0a0558d..b5d94e8a34 100644 --- a/test/markup/handlebars/raw-block.expect.txt +++ b/test/markup/handlebars/raw-block.expect.txt @@ -1,2 +1,2 @@ -{{{{#raw}}}} {{verbatim}} content {{{{/raw}}}} {{var}} +{{{{#raw}}}} {{verbatim}} content {{{{/raw}}}} {{var}} diff --git a/test/markup/handlebars/simple-expression.expect.txt b/test/markup/handlebars/simple-expression.expect.txt index c243c13ba1..41d5cc869f 100644 --- a/test/markup/handlebars/simple-expression.expect.txt +++ b/test/markup/handlebars/simple-expression.expect.txt @@ -1,2 +1,2 @@ -{{abc}} +{{abc}} diff --git a/test/markup/handlebars/sub-expressions.expect.txt b/test/markup/handlebars/sub-expressions.expect.txt index d8bf1c4c32..6b386b9c3c 100644 --- a/test/markup/handlebars/sub-expressions.expect.txt +++ b/test/markup/handlebars/sub-expressions.expect.txt @@ -1,2 +1,14 @@ -{{helper (subExpression 1 2)}} +{{helper (subExpression 1 2)}} + +{{{helper (subExpression 1 2)}}} + +{{{{#helper (subExpression 1 2)}}}} {{{{/helper}}}} + +{{#helper (subExpression 1 2)}} {{/helper}} + +{{>partial (subExpression 1 2)}} + +{{helper key=(subExpression 1 2)}} + +{{helper (subExpression (canBeNested 1 2) anotherParam)}} diff --git a/test/markup/handlebars/sub-expressions.txt b/test/markup/handlebars/sub-expressions.txt index 55f2b34547..737c2967fd 100644 --- a/test/markup/handlebars/sub-expressions.txt +++ b/test/markup/handlebars/sub-expressions.txt @@ -1 +1,13 @@ {{helper (subExpression 1 2)}} + +{{{helper (subExpression 1 2)}}} + +{{{{#helper (subExpression 1 2)}}}} {{{{/helper}}}} + +{{#helper (subExpression 1 2)}} {{/helper}} + +{{>partial (subExpression 1 2)}} + +{{helper key=(subExpression 1 2)}} + +{{helper (subExpression (canBeNested 1 2) anotherParam)}} diff --git a/test/markup/handlebars/triple-mustache.expect.txt b/test/markup/handlebars/triple-mustache.expect.txt index b2fb748b97..3512548e3f 100644 --- a/test/markup/handlebars/triple-mustache.expect.txt +++ b/test/markup/handlebars/triple-mustache.expect.txt @@ -1,2 +1,2 @@ -{{{raw}}} +{{{raw}}} From 278a610ae3926634f7e06413a9e47ceaed419e5b Mon Sep 17 00:00:00 2001 From: Martin <7252614+Lhoerion@users.noreply.github.com> Date: Tue, 19 May 2020 19:43:26 +0200 Subject: [PATCH 105/816] fix(typescript) Add missing `readonly` keyword (#2562) --- CHANGES.md | 2 ++ src/languages/typescript.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 294ba0defb..efb45e530b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ Deprecations: Language Improvements: +- fix(typescript) add `readonly` keyword (#2562) [Martin (Lhoerion)][] - fix(javascript) fix regex inside parens after a non-regex (#2530) [Josh Goebel][] - enh(typescript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][] - enh(javascript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][] @@ -49,6 +50,7 @@ Language Improvements: [Sam Rawlins]: https://github.com/srawlins [Sergey Prokhorov]: https://github.com/seriyps [Nils Knappmeier]: https://github.com/nknapp +[Martin (Lhoerion)]: https://github.com/Lhoerion ## Version 10.0.2 diff --git a/src/languages/typescript.js b/src/languages/typescript.js index c912157cdc..e44ee9a86f 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -31,7 +31,8 @@ export default function(hljs) { "protected", "implements", "declare", - "abstract" + "abstract", + "readonly" ]; var KEYWORDS = { $pattern: ECMAScript.IDENT_RE, From 02bdae34d81c9e690d18700cff1df287ab318c23 Mon Sep 17 00:00:00 2001 From: Derek Lewis Date: Fri, 22 May 2020 06:32:25 -0400 Subject: [PATCH 106/816] (docs) Mention `c` is a possible class for C (#2577) --- SUPPORTED_LANGUAGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 5d3d3ea152..f770664596 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -31,7 +31,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | BNF | bnf | | | Brainfuck | brainfuck, bf | | | C# | csharp, cs | | -| C | h | | +| C | c, h | | | C++ | cpp, hpp, cc, hh, c++, h++, cxx, hxx | | | C/AL | cal | | | Cache Object Script | cos, cls | | From c6f2995371f11a66efa5f785680e825251f6a896 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 22 May 2020 08:35:23 -0400 Subject: [PATCH 107/816] fix(groovy) strings are not allowed inside ternary clauses (#2565) * fix(groovy) strings are not allowed inside ternary clauses * whitespace can also include tabs --- CHANGES.md | 1 + src/languages/groovy.js | 141 +++++++++++++++----------- test/markup/groovy/default.expect.txt | 58 +++++++++++ test/markup/groovy/default.txt | 58 +++++++++++ test/markup/groovy/oneoffs.expect.txt | 3 + test/markup/groovy/oneoffs.txt | 3 + 6 files changed, 206 insertions(+), 58 deletions(-) create mode 100644 test/markup/groovy/default.expect.txt create mode 100644 test/markup/groovy/default.txt create mode 100644 test/markup/groovy/oneoffs.expect.txt create mode 100644 test/markup/groovy/oneoffs.txt diff --git a/CHANGES.md b/CHANGES.md index efb45e530b..275f9033cc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ Deprecations: Language Improvements: +- fix(groovy) strings are not allowed inside ternary clauses (#2217) [Josh Goebel][] - fix(typescript) add `readonly` keyword (#2562) [Martin (Lhoerion)][] - fix(javascript) fix regex inside parens after a non-regex (#2530) [Josh Goebel][] - enh(typescript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][] diff --git a/src/languages/groovy.js b/src/languages/groovy.js index 8dfb00767f..20f8662d77 100644 --- a/src/languages/groovy.js +++ b/src/languages/groovy.js @@ -5,69 +5,84 @@ Website: https://groovy-lang.org */ +import * as regex from "../lib/regex"; + +function variants(variants, obj = {}) { + obj.variants = variants; + return obj; +} + export default function(hljs) { + const IDENT_RE = '[A-Za-z0-9_$]+'; + const COMMENT = variants([ + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE, + hljs.COMMENT( + '/\\*\\*', + '\\*/', + { + relevance : 0, + contains : [ + { + // eat up @'s in emails to prevent them to be recognized as doctags + begin: /\w+@/, relevance: 0 + }, { + className : 'doctag', + begin : '@[A-Za-z]+' + } + ] + } + ) + ]); + const REGEXP = { + className: 'regexp', + begin: /~?\/[^\/\n]+\//, + contains: [ + hljs.BACKSLASH_ESCAPE + ] + }; + const NUMBER = variants([ + hljs.BINARY_NUMBER_MODE, + hljs.C_NUMBER_MODE, + ]); + const STRING = variants([ + { + begin: /"""/, + end: /"""/ + }, { + begin: /'''/, + end: /'''/ + }, { + begin: "\\$/", + end: "/\\$", + relevance: 10 + }, + hljs.APOS_STRING_MODE, + hljs.QUOTE_STRING_MODE, + ], + { className: "string" } + ); + return { name: 'Groovy', keywords: { - literal : 'true false null', + built_in: '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 - 'super this abstract static volatile transient public private protected synchronized final ' + + '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' }, - contains: [ - hljs.COMMENT( - '/\\*\\*', - '\\*/', - { - relevance : 0, - contains : [ - { - // eat up @'s in emails to prevent them to be recognized as doctags - begin: /\w+@/, relevance: 0 - }, - { - className : 'doctag', - begin : '@[A-Za-z]+' - } - ] - } - ), - hljs.C_LINE_COMMENT_MODE, - hljs.C_BLOCK_COMMENT_MODE, - { - className: 'string', - begin: '"""', end: '"""' - }, - { - className: 'string', - begin: "'''", end: "'''" - }, - { - className: 'string', - begin: "\\$/", end: "/\\$", - relevance: 10 - }, - hljs.APOS_STRING_MODE, - { - className: 'regexp', - begin: /~?\/[^\/\n]+\//, - contains: [ - hljs.BACKSLASH_ESCAPE - ] - }, - hljs.QUOTE_STRING_MODE, - { - className: 'meta', - begin: "^#!/usr/bin/env", end: '$', - illegal: '\n' - }, - hljs.BINARY_NUMBER_MODE, + hljs.SHEBANG(), + COMMENT, + STRING, + REGEXP, + NUMBER, { className: 'class', beginKeywords: 'class interface trait enum', end: '{', @@ -77,25 +92,35 @@ export default function(hljs) { hljs.UNDERSCORE_TITLE_MODE ] }, - hljs.C_NUMBER_MODE, { className: 'meta', begin: '@[A-Za-z]+' }, { - // highlight map keys and named parameters as strings - className: 'string', begin: /[^\?]{0}[A-Za-z0-9_$]+ *:/ + // highlight map keys and named parameters as attrs + className: 'attr', begin: IDENT_RE + '[ \t]*:' }, { - // catch middle element of the ternary operator - // to avoid highlight it as a label, named parameter, or map key - begin: /\?/, end: /\:/ + // catch middle element of the ternary operator + // to avoid highlight it as a label, named parameter, or map key + begin: /\?/, + end: /:/, + contains: [ + COMMENT, + STRING, + REGEXP, + NUMBER, + 'self' + ] }, { // highlight labeled statements - className: 'symbol', begin: '^\\s*[A-Za-z0-9_$]+:', + className: 'symbol', + begin: '^[ \t]*' + regex.lookahead(IDENT_RE + ':'), + excludeBegin: true, + end: IDENT_RE + ':', relevance: 0 } ], illegal: /#|<\// - } + }; } diff --git a/test/markup/groovy/default.expect.txt b/test/markup/groovy/default.expect.txt new file mode 100644 index 0000000000..c546cd97d9 --- /dev/null +++ b/test/markup/groovy/default.expect.txt @@ -0,0 +1,58 @@ +#!/usr/bin/env groovy +package model + +import groovy.transform.CompileStatic +import java.util.List as MyList + +trait Distributable { + void distribute(String version) {} +} + +@CompileStatic +class Distribution implements Distributable { + double number = 1234.234 / 567 + def otherNumber = 3 / 4 + boolean archivable = condition ?: true + def ternary = a ? b : c + String name = "Guillaume" + Closure description = null + List<DownloadPackage> packages = [] + String regex = ~/.*foo.*/ + String multi = ''' + multi line string + ''' + """ + now with double quotes and ${gstring} + """ + $/ + even with dollar slashy strings + /$ + + /** + * description method + * @param cl the closure + */ + void description(Closure cl) { this.description = cl } + + void version(String name, Closure versionSpec) { + def closure = { println "hi" } as Runnable + + MyList ml = [1, 2, [a: 1, b:2,c :3]] + for (ch in "name") {} + + // single line comment + DownloadPackage pkg = new DownloadPackage(version: name) + + check that: true + + label: + // This is purposely tabbed + tabbed_label: + def clone = versionSpec.rehydrate(pkg, pkg, pkg) + /* + now clone() in a multiline comment + */ + clone() + packages.add(pkg) + + assert 4 / 2 == 2 + } +} diff --git a/test/markup/groovy/default.txt b/test/markup/groovy/default.txt new file mode 100644 index 0000000000..1ae59076ad --- /dev/null +++ b/test/markup/groovy/default.txt @@ -0,0 +1,58 @@ +#!/usr/bin/env groovy +package model + +import groovy.transform.CompileStatic +import java.util.List as MyList + +trait Distributable { + void distribute(String version) {} +} + +@CompileStatic +class Distribution implements Distributable { + double number = 1234.234 / 567 + def otherNumber = 3 / 4 + boolean archivable = condition ?: true + def ternary = a ? b : c + String name = "Guillaume" + Closure description = null + List packages = [] + String regex = ~/.*foo.*/ + String multi = ''' + multi line string + ''' + """ + now with double quotes and ${gstring} + """ + $/ + even with dollar slashy strings + /$ + + /** + * description method + * @param cl the closure + */ + void description(Closure cl) { this.description = cl } + + void version(String name, Closure versionSpec) { + def closure = { println "hi" } as Runnable + + MyList ml = [1, 2, [a: 1, b:2,c :3]] + for (ch in "name") {} + + // single line comment + DownloadPackage pkg = new DownloadPackage(version: name) + + check that: true + + label: + // This is purposely tabbed + tabbed_label: + def clone = versionSpec.rehydrate(pkg, pkg, pkg) + /* + now clone() in a multiline comment + */ + clone() + packages.add(pkg) + + assert 4 / 2 == 2 + } +} diff --git a/test/markup/groovy/oneoffs.expect.txt b/test/markup/groovy/oneoffs.expect.txt new file mode 100644 index 0000000000..bb4c7ef80d --- /dev/null +++ b/test/markup/groovy/oneoffs.expect.txt @@ -0,0 +1,3 @@ +// ternary can include quotes +def formattingMsg = label < 0 ? ('The following files need formatting:\n ' + + codeStyleFiles.join('\n ')) : 'All files are correctly formatted' diff --git a/test/markup/groovy/oneoffs.txt b/test/markup/groovy/oneoffs.txt new file mode 100644 index 0000000000..8751afc948 --- /dev/null +++ b/test/markup/groovy/oneoffs.txt @@ -0,0 +1,3 @@ +// ternary can include quotes +def formattingMsg = label < 0 ? ('The following files need formatting:\n ' + + codeStyleFiles.join('\n ')) : 'All files are correctly formatted' From cc2dc8b0ebbba90bc21ff269841f8f789e957fdc Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Fri, 22 May 2020 08:35:43 -0400 Subject: [PATCH 108/816] =?UTF-8?q?Update=20@typescript-eslint/parser=20to?= =?UTF-8?q?=20the=20latest=20version=20=F0=9F=9A=80=20(#2575)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update @typescript-eslint/parser to version 3.0.0 * chore(package): update lockfile package-lock.json Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> Co-authored-by: Josh Goebel --- package-lock.json | 68 +++++++++++++++++++++++++++++++++++++++++++---- package.json | 2 +- 2 files changed, 64 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 318acfc140..31182fd329 100644 --- a/package-lock.json +++ b/package-lock.json @@ -147,15 +147,73 @@ } }, "@typescript-eslint/parser": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.32.0.tgz", - "integrity": "sha512-swRtH835fUfm2khchiOVNchU3gVNaZNj2pY92QSx4kXan+RzaGNrwIRaCyX8uqzmK0xNPzseaUYHP8CsmrsjFw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.0.0.tgz", + "integrity": "sha512-8RRCA9KLxoFNO0mQlrLZA0reGPd/MsobxZS/yPFj+0/XgMdS8+mO8mF3BDj2ZYQj03rkayhSJtF1HAohQ3iylw==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.32.0", - "@typescript-eslint/typescript-estree": "2.32.0", + "@typescript-eslint/experimental-utils": "3.0.0", + "@typescript-eslint/typescript-estree": "3.0.0", "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.0.tgz", + "integrity": "sha512-BN0vmr9N79M9s2ctITtChRuP1+Dls0x/wlg0RXW1yQ7WJKPurg6X3Xirv61J2sjPif4F8SLsFMs5Nzte0WYoTQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.0.tgz", + "integrity": "sha512-nevQvHyNghsfLrrByzVIH4ZG3NROgJ8LZlfh3ddwPPH4CH7W4GAiSx5qu+xHuX5pWsq6q/eqMc1io840ZhAnUg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "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" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } } }, "@typescript-eslint/typescript-estree": { diff --git a/package.json b/package.json index c6f72791e3..917830cfaa 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.32.0", - "@typescript-eslint/parser": "^2.32.0", + "@typescript-eslint/parser": "^3.0.0", "clean-css": "^4.2.1", "cli-table": "^0.3.1", "colors": "^1.1.2", From a6f0a343a9c3fe99f7204b9add6393fcc36e172b Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Fri, 22 May 2020 08:36:25 -0400 Subject: [PATCH 109/816] =?UTF-8?q?Update=20@typescript-eslint/eslint-plug?= =?UTF-8?q?in=20to=20the=20latest=20version=20=F0=9F=9A=80=20(#2576)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update @typescript-eslint/eslint-plugin to version 3.0.0 * chore(package): update lockfile package-lock.json Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> Co-authored-by: Josh Goebel --- package-lock.json | 65 ++++++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 31182fd329..4df5098930 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,22 +104,79 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.32.0.tgz", - "integrity": "sha512-nb1kSUa8cd22hGgxpGdVT6/iyP7IKyrnyZEGYo+tN8iyDdXvXa+nfsX03tJVeFfhbkwR/0CDk910zPbqSflAsg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.0.0.tgz", + "integrity": "sha512-lcZ0M6jD4cqGccYOERKdMtg+VWpoq3NSnWVxpc/AwAy0zhkUYVioOUZmfNqiNH8/eBNGhCn6HXd6mKIGRgNc1Q==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.32.0", + "@typescript-eslint/experimental-utils": "3.0.0", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", + "semver": "^7.3.2", "tsutils": "^3.17.1" }, "dependencies": { + "@typescript-eslint/experimental-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.0.tgz", + "integrity": "sha512-BN0vmr9N79M9s2ctITtChRuP1+Dls0x/wlg0RXW1yQ7WJKPurg6X3Xirv61J2sjPif4F8SLsFMs5Nzte0WYoTQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.0.tgz", + "integrity": "sha512-nevQvHyNghsfLrrByzVIH4ZG3NROgJ8LZlfh3ddwPPH4CH7W4GAiSx5qu+xHuX5pWsq6q/eqMc1io840ZhAnUg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "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" + } + }, "regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true } } }, diff --git a/package.json b/package.json index 917830cfaa..6b01a26986 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "node": "*" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.32.0", + "@typescript-eslint/eslint-plugin": "^3.0.0", "@typescript-eslint/parser": "^3.0.0", "clean-css": "^4.2.1", "cli-table": "^0.3.1", From 3e9c1b1e8b10b3a5c82ab6e52700ee51f5e978b0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 22 May 2020 09:04:49 -0400 Subject: [PATCH 110/816] (parser) properly escape ' and " in HTML output (#2564) * escape quotes also in final HTML output * [style] update test coding style * update markup tests with new escaping This shouldn't be a security issue -- we've always escaped double quotes inside of HTML attribute values (where they could be used to break out of context) - and we've always used double quotes for enclosing attribute values. This just goes all the way and now properly escapes quotes everywhere. Better safe than sorry. --- src/lib/utils.js | 9 +- test/markup/abnf/default.expect.txt | 6 +- test/markup/accesslog/default.expect.txt | 10 +- test/markup/arcade/profile.expect.txt | 8 +- test/markup/arduino/default.expect.txt | 1 + test/markup/bash/escaped-quote.expect.txt | 2 +- test/markup/bash/no-numbers.expect.txt | 2 +- test/markup/bash/strings.expect.txt | 6 +- .../clojure/globals_definition.expect.txt | 18 ++-- test/markup/clojure/hint_col.expect.txt | 22 ++--- test/markup/coffeescript/function.expect.txt | 4 +- test/markup/cos/basic.expect.txt | 6 +- test/markup/cos/embedded.expect.txt | 2 +- test/markup/cpp/function-params.expect.txt | 2 +- test/markup/cpp/number-literals.expect.txt | 8 +- test/markup/cpp/preprocessor.expect.txt | 2 +- test/markup/cpp/string-literals.expect.txt | 98 +++++++++---------- .../cpp/truncated-block-comment.expect.txt | 2 +- .../cpp/truncated-raw-string.expect.txt | 6 +- test/markup/crystal/literals.expect.txt | 38 +++---- test/markup/crystal/macro.expect.txt | 6 +- test/markup/crystal/operators.expect.txt | 2 +- test/markup/csharp/functions.expect.txt | 4 +- test/markup/csharp/identifiers.expect.txt | 1 + .../csharp/string-interpolation.expect.txt | 14 +-- test/markup/css/sample.expect.txt | 8 +- test/markup/css/url.expect.txt | 8 +- .../dart/string-interpolation.expect.txt | 4 +- test/markup/diff/comments.expect.txt | 2 +- test/markup/dockerfile/default.expect.txt | 6 +- test/markup/dsconfig/default.expect.txt | 22 ++--- test/markup/ebnf/quote-symbols.expect.txt | 4 +- test/markup/ebnf/terminators.expect.txt | 6 +- test/markup/elixir/function-title.expect.txt | 2 +- test/markup/elixir/sigils.expect.txt | 16 +-- test/markup/elixir/strings.expect.txt | 8 +- .../elixir/uppercase-string-sigil.expect.txt | 8 +- test/markup/excel/comments.expect.txt | 2 +- test/markup/fortran/comments.expect.txt | 4 +- test/markup/gauss/function_refs.expect.txt | 4 +- test/markup/gauss/keywords.expect.txt | 2 +- test/markup/go/strings.expect.txt | 10 +- test/markup/golo/default.expect.txt | 4 +- test/markup/groovy/default.expect.txt | 12 +-- test/markup/groovy/oneoffs.expect.txt | 4 +- ...ession-variants-as-path-segment.expect.txt | 8 +- ...ression-variants-in-helper-name.expect.txt | 10 +- ...ck-expression-variants-in-param.expect.txt | 8 +- .../handlebars/block-parameters-as.expect.txt | 2 +- .../handlebars/block-with-param.expect.txt | 2 +- test/markup/handlebars/block.expect.txt | 2 +- test/markup/handlebars/built-ins.expect.txt | 2 +- .../combinations-with-text.expect.txt | 4 +- test/markup/handlebars/comments.expect.txt | 2 +- .../handlebars/else-variants.expect.txt | 2 +- .../handlebars/escaped-mustaches.expect.txt | 2 +- .../handlebars/expression-variants.expect.txt | 24 ++--- test/markup/handlebars/hashes.expect.txt | 2 +- .../literals-in-different-places.expect.txt | 2 +- test/markup/handlebars/literals.expect.txt | 6 +- .../markup/handlebars/partial-call.expect.txt | 2 +- .../handlebars/path-expressions.expect.txt | 2 +- test/markup/handlebars/raw-block.expect.txt | 2 +- .../handlebars/simple-expression.expect.txt | 2 +- .../handlebars/sub-expressions.expect.txt | 2 +- .../handlebars/triple-mustache.expect.txt | 2 +- test/markup/http/default.expect.txt | 4 +- test/markup/index.js | 38 +++---- test/markup/ini/array.expect.txt | 9 +- test/markup/ini/comments.expect.txt | 2 +- test/markup/ini/tables.expect.txt | 2 +- test/markup/ini/types.expect.txt | 14 +-- test/markup/java/annotations.expect.txt | 2 +- .../javascript/arrow-function.expect.txt | 1 + test/markup/javascript/class.expect.txt | 2 +- .../javascript/default-parameters.expect.txt | 2 +- .../javascript/inline-languages.expect.txt | 14 +-- test/markup/javascript/jsx.expect.txt | 8 +- test/markup/javascript/keywords.expect.txt | 2 +- test/markup/javascript/method-call.expect.txt | 1 + test/markup/javascript/modules.expect.txt | 2 +- test/markup/javascript/object-attr.expect.txt | 3 +- test/markup/json/comments.expect.txt | 14 +-- test/markup/kotlin/function.expect.txt | 2 +- test/markup/kotlin/nested_comment.expect.txt | 2 +- test/markup/kotlin/string.expect.txt | 12 +-- test/markup/ldif/schema.expect.txt | 12 +-- test/markup/less/selectors.expect.txt | 2 +- test/markup/lisp/mec.expect.txt | 2 +- test/markup/markdown/code.expect.txt | 2 +- test/markup/markdown/sections.expect.txt | 1 + test/markup/matlab/transpose.expect.txt | 58 +++++------ test/markup/maxima/example.expect.txt | 10 +- .../markup/objectivec/preprocessor.expect.txt | 2 +- .../objectivec/string-literals.expect.txt | 14 +-- test/markup/ocaml/literals.expect.txt | 8 +- test/markup/ocaml/types.expect.txt | 4 +- test/markup/pgsql/clauses2.expect.txt | 6 +- test/markup/pgsql/dollar_strings.expect.txt | 6 +- test/markup/pgsql/options.expect.txt | 4 +- test/markup/pgsql/plpgsql.expect.txt | 8 +- test/markup/pgsql/window-functions.expect.txt | 2 +- test/markup/pgsql/xml.expect.txt | 30 +++--- test/markup/pony/control-flow.expect.txt | 10 +- test/markup/pony/lambda.expect.txt | 2 +- test/markup/pony/match.expect.txt | 10 +- test/markup/pony/method.expect.txt | 2 +- test/markup/pony/prime.expect.txt | 4 +- test/markup/pony/triple-quote.expect.txt | 4 +- .../powershell/apos-herestring.expect.txt | 8 +- test/markup/powershell/classes.expect.txt | 8 +- test/markup/powershell/misc.expect.txt | 16 +-- .../powershell/quote-herestring.expect.txt | 8 +- test/markup/python-repl/sample.expect.txt | 16 +-- test/markup/python/escaped-quotes.expect.txt | 86 ++++++++-------- test/markup/python/f-strings.expect.txt | 20 ++-- .../function-header-comments.expect.txt | 4 +- test/markup/reasonml/functions.expect.txt | 8 +- test/markup/reasonml/literals.expect.txt | 10 +- test/markup/reasonml/modules.expect.txt | 8 +- .../reasonml/pattern-matching.expect.txt | 12 +-- test/markup/ruby/gemfile.expect.txt | 4 +- test/markup/ruby/heredoc.expect.txt | 2 +- test/markup/ruby/prompt.expect.txt | 16 +-- test/markup/rust/strings.expect.txt | 24 ++--- test/markup/scheme/quoted.expect.txt | 2 +- test/markup/sql/interval.expect.txt | 6 +- test/markup/sql/numeric-types.expect.txt | 2 +- test/markup/sql/string-types.expect.txt | 4 +- test/markup/sql/values-statement.expect.txt | 8 +- test/markup/stata/built_ins.expect.txt | 2 +- test/markup/swift/multiline-string.expect.txt | 4 +- test/markup/tap/yaml-block.expect.txt | 20 ++-- .../twig/filter_with_underscore.expect.txt | 2 +- test/markup/twig/template_tags.expect.txt | 4 +- test/markup/typescript/class.expect.txt | 2 +- .../typescript/decorator-factories.expect.txt | 4 +- test/markup/typescript/functions.expect.txt | 1 + .../typescript/inline-languages.expect.txt | 14 +-- test/markup/typescript/module-id.expect.txt | 8 +- .../typescript/nested-templates.expect.txt | 2 +- test/markup/verilog/misc.expect.txt | 6 +- test/markup/verilog/numbers.expect.txt | 14 +-- test/markup/vim/strings-comments.expect.txt | 8 +- .../xml/document-type-variations.expect.txt | 20 ++-- test/markup/xml/space-attributes.expect.txt | 6 +- .../markup/xml/unquoted-attributes.expect.txt | 8 +- .../markup/xquery/computed_inbuilt.expect.txt | 6 +- test/markup/xquery/direct_method.expect.txt | 8 +- test/markup/xquery/function_body.expect.txt | 2 +- .../xquery/prolog_declarations.expect.txt | 8 +- test/markup/yaml/keys.expect.txt | 8 +- test/markup/yaml/numbers.expect.txt | 1 - test/markup/yaml/string.expect.txt | 4 +- test/markup/yaml/tag.expect.txt | 4 +- test/markup/zephir/default.expect.txt | 2 +- 156 files changed, 650 insertions(+), 634 deletions(-) diff --git a/src/lib/utils.js b/src/lib/utils.js index 7993ab7cd2..3b9a0f1069 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -3,7 +3,12 @@ * @returns {string} */ export function escapeHTML(value) { - return value.replace(/&/g, '&').replace(//g, '>'); + return value + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); } /** @@ -121,7 +126,7 @@ export function mergeStreams(original, highlighted, value) { function open(node) { /** @param {Attr} attr */ function attr_str(attr) { - return ' ' + attr.nodeName + '="' + escapeHTML(attr.value).replace(/"/g, '"') + '"'; + return ' ' + attr.nodeName + '="' + escapeHTML(attr.value) + '"'; } // @ts-ignore result += '<' + tag(node) + [].map.call(node.attributes, attr_str).join('') + '>'; diff --git a/test/markup/abnf/default.expect.txt b/test/markup/abnf/default.expect.txt index 6f11816349..158d6748de 100644 --- a/test/markup/abnf/default.expect.txt +++ b/test/markup/abnf/default.expect.txt @@ -17,6 +17,6 @@ a / insensitive hex-codes = %x68.65.6C.6C.6F -literal = "string literal" -sensitive = %s"case-sensitive string" -insensitive = %i"case-insensitive string" +literal = "string literal" +sensitive = %s"case-sensitive string" +insensitive = %i"case-insensitive string" diff --git a/test/markup/accesslog/default.expect.txt b/test/markup/accesslog/default.expect.txt index 0548608e3a..022d1b0e0d 100644 --- a/test/markup/accesslog/default.expect.txt +++ b/test/markup/accesslog/default.expect.txt @@ -1,5 +1,5 @@ -20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" -127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 -192.168.2.20 - - [28/Jul/2006:10:27:10 -0300] "GET /cgi-bin/try/ HTTP/1.0" 200 3395 -127.0.0.90 - - [13/Sep/2006:07:00:53 -0700] "PROPFIND /svn/some_url/Extranet/branches/SOW-101 HTTP/1.1" 401 587 -66.249.78.17 – – [13/Jul/2015:07:18:58 -0400] "GET /robots.txt HTTP/1.1" 200 0 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" +20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" +127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 +192.168.2.20 - - [28/Jul/2006:10:27:10 -0300] "GET /cgi-bin/try/ HTTP/1.0" 200 3395 +127.0.0.90 - - [13/Sep/2006:07:00:53 -0700] "PROPFIND /svn/some_url/Extranet/branches/SOW-101 HTTP/1.1" 401 587 +66.249.78.17 – – [13/Jul/2015:07:18:58 -0400] "GET /robots.txt HTTP/1.1" 200 0 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" diff --git a/test/markup/arcade/profile.expect.txt b/test/markup/arcade/profile.expect.txt index e7ace43e6e..06047aba5b 100644 --- a/test/markup/arcade/profile.expect.txt +++ b/test/markup/arcade/profile.expect.txt @@ -2,8 +2,8 @@ Isolated test for the most recent version */ 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 myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); + var popDensity = Round( $feature.POPULATION / AreaGeodetic(Geometry($feature), "square-kilometers") ); + var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} }); + var myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); return popDensity; -} \ No newline at end of file +} diff --git a/test/markup/arduino/default.expect.txt b/test/markup/arduino/default.expect.txt index edffa907be..1e6a196047 100644 --- a/test/markup/arduino/default.expect.txt +++ b/test/markup/arduino/default.expect.txt @@ -22,3 +22,4 @@ digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } + diff --git a/test/markup/bash/escaped-quote.expect.txt b/test/markup/bash/escaped-quote.expect.txt index dec5bb849c..72b2f0c5c2 100644 --- a/test/markup/bash/escaped-quote.expect.txt +++ b/test/markup/bash/escaped-quote.expect.txt @@ -1,2 +1,2 @@ # Escaped double-quote is not a string -echo '"quoted"' | tr -d \" > text.txt +echo '"quoted"' | tr -d \" > text.txt diff --git a/test/markup/bash/no-numbers.expect.txt b/test/markup/bash/no-numbers.expect.txt index 33fc753c41..5b96c2855b 100644 --- a/test/markup/bash/no-numbers.expect.txt +++ b/test/markup/bash/no-numbers.expect.txt @@ -1,3 +1,3 @@ -# numbers aren't highlighted in bash as their semantics is +# numbers aren't highlighted in bash as their semantics is # not strictly defined for command line parameters $ tail -10 access.log diff --git a/test/markup/bash/strings.expect.txt b/test/markup/bash/strings.expect.txt index 39abcc1b1d..4b8adce812 100644 --- a/test/markup/bash/strings.expect.txt +++ b/test/markup/bash/strings.expect.txt @@ -1,3 +1,3 @@ -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -TLS_DIR="$SCRIPT_DIR/../src/main/resources/tls" -ROOT_DIR="$SCRIPT_DIR/.." +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +TLS_DIR="$SCRIPT_DIR/../src/main/resources/tls" +ROOT_DIR="$SCRIPT_DIR/.." diff --git a/test/markup/clojure/globals_definition.expect.txt b/test/markup/clojure/globals_definition.expect.txt index 5e54172d67..4cd5d183ad 100644 --- a/test/markup/clojure/globals_definition.expect.txt +++ b/test/markup/clojure/globals_definition.expect.txt @@ -4,34 +4,34 @@ ; function (defn clojure-function [args] - (let [string "multiline\nstring" - regexp #"regexp" + (let [string "multiline\nstring" + regexp #"regexp" number 100,000 booleans [false true] keyword ::the-keyword] ;; this is comment (if true (->> - (list [vector] {:map map} #{'set}))))) + (list [vector] {:map map} #{'set}))))) ; global (def some-var) ; another one -(def alternative-var "132") +(def alternative-var "132") ; defonce -(defonce ^:private another-var #"foo") +(defonce ^:private another-var #"foo") ; private function (defn- add [x y] (+ x y)) ; protocols (defprotocol Fly - "A simple protocol for flying" - (fly [this] "Method to fly")) + "A simple protocol for flying" + (fly [this] "Method to fly")) (defrecord Bird [name species] Fly - (fly [this] (str (:name this) " flies..."))) + (fly [this] (str (:name this) " flies..."))) ; multimethods (defmulti service-charge (fn [acct] [(account-level acct) (:tag acct)])) @@ -43,7 +43,7 @@ (defmacro unless [pred a b] `(if (not ~pred) ~a ~b)) -(unless false (println "Will print") (println "Will not print")) +(unless false (println "Will print") (println "Will not print")) ; types (deftype Circle [radius]) diff --git a/test/markup/clojure/hint_col.expect.txt b/test/markup/clojure/hint_col.expect.txt index fd61cae7dd..240a151400 100644 --- a/test/markup/clojure/hint_col.expect.txt +++ b/test/markup/clojure/hint_col.expect.txt @@ -6,29 +6,29 @@ ;; annotation on type (deftype ^{Deprecated true Retention RetentionPolicy/RUNTIME - javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] + 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"})]} + 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.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"})]} + 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.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"})]} + 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))) +(seq (.getAnnotations (.getField Bar "b"))) +(seq (.getAnnotations (.getMethod Bar "foo" nil))) diff --git a/test/markup/coffeescript/function.expect.txt b/test/markup/coffeescript/function.expect.txt index 4d43e641b3..dfce2c1690 100644 --- a/test/markup/coffeescript/function.expect.txt +++ b/test/markup/coffeescript/function.expect.txt @@ -5,9 +5,9 @@ npmWishlist.sha256 = (str) -> throw new Error() -str.split(" ").map((m) -> m.charCodeAt(0)) +str.split(" ").map((m) -> m.charCodeAt(0)) -fs.readFile("package.json", "utf-8", (err, content) -> +fs.readFile("package.json", "utf-8", (err, content) -> data = JSON.parse(content) data.version diff --git a/test/markup/cos/basic.expect.txt b/test/markup/cos/basic.expect.txt index e26474f10f..1a36cc7345 100644 --- a/test/markup/cos/basic.expect.txt +++ b/test/markup/cos/basic.expect.txt @@ -1,7 +1,7 @@ SET test = 1 set ^global = 2 -Write "Current date """, $ztimestamp, """, result: ", test + ^global = 3 +Write "Current date """, $ztimestamp, """, result: ", test + ^global = 3 if (^global = 2) { - do ##class(Cinema.Utils).AddShow("test") // line comment + do ##class(Cinema.Utils).AddShow("test") // line comment } -d:(^global = 2) ..thisClassMethod(1, 2, "test") +d:(^global = 2) ..thisClassMethod(1, 2, "test") diff --git a/test/markup/cos/embedded.expect.txt b/test/markup/cos/embedded.expect.txt index d070b70219..74bd3aa760 100644 --- a/test/markup/cos/embedded.expect.txt +++ b/test/markup/cos/embedded.expect.txt @@ -2,4 +2,4 @@ * Multiline comment */ &sql(SELECT * FROM Cinema.Film WHERE Length > 2) -&js<for (var i = 0; i < String("test").split("").length); ++i) { console.log(i); }> +&js<for (var i = 0; i < String("test").split("").length); ++i) { console.log(i); }> diff --git a/test/markup/cpp/function-params.expect.txt b/test/markup/cpp/function-params.expect.txt index a38804566f..b974a634a7 100644 --- a/test/markup/cpp/function-params.expect.txt +++ b/test/markup/cpp/function-params.expect.txt @@ -1,6 +1,6 @@ int f( int a = 1, - char* b = "2", // Line comment + char* b = "2", // Line comment double c = 3.0, /* Block comment */ ARRAY(int, 5) d, void* e __attribute__((unused)) diff --git a/test/markup/cpp/number-literals.expect.txt b/test/markup/cpp/number-literals.expect.txt index 09e2d5a680..e80b3293ba 100644 --- a/test/markup/cpp/number-literals.expect.txt +++ b/test/markup/cpp/number-literals.expect.txt @@ -1,6 +1,6 @@ /* digit separators */ -int number = 2'555'555'555; // digit separators -float exponentFloat = .123'456e3'000; // digit separators in floats -float suffixed = 3.000'001'234f // digit separators in suffixed numbers -char word[] = { '3', '\0' }; // make sure digit separators don't mess up chars +int number = 2'555'555'555; // digit separators +float exponentFloat = .123'456e3'000; // digit separators in floats +float suffixed = 3.000'001'234f // digit separators in suffixed numbers +char word[] = { '3', '\0' }; // make sure digit separators don't mess up chars float negative = -123.0f; // negative floating point numbers diff --git a/test/markup/cpp/preprocessor.expect.txt b/test/markup/cpp/preprocessor.expect.txt index 2a7548ebc8..ee89b732a9 100644 --- a/test/markup/cpp/preprocessor.expect.txt +++ b/test/markup/cpp/preprocessor.expect.txt @@ -12,7 +12,7 @@ # define x(v) ((v)) # define x(v) ((v)) -#if MACRO_WITH_STRING_ARG("hello \"world\"") +#if MACRO_WITH_STRING_ARG("hello \"world\"") #elif MULTI_LINE /* comment */ < \ EXPRESSION int bar; diff --git a/test/markup/cpp/string-literals.expect.txt b/test/markup/cpp/string-literals.expect.txt index d5efcbda98..814c481a11 100644 --- a/test/markup/cpp/string-literals.expect.txt +++ b/test/markup/cpp/string-literals.expect.txt @@ -1,69 +1,69 @@ // Unicode literals -auto str = "Hello regular string"; -auto utf8 = u8"Hello utf-8 string"; -auto utf16 = u"Hello utf-16 string"; -auto utf32 = U"Hello utf-32 string"; +auto str = "Hello regular string"; +auto utf8 = u8"Hello utf-8 string"; +auto utf16 = u"Hello utf-16 string"; +auto utf32 = U"Hello utf-32 string"; // Wide-character strings -auto wide_char = L"Hello wchar_t string"; -auto lr = LR"(Hello -world)"; +auto wide_char = L"Hello wchar_t string"; +auto lr = LR"(Hello +world)"; // character literals -auto wide_char = L'H'; -auto cr = '\n'; -auto chr = 'H'; -auto utf8 = u8'H'; -auto utf16 = u'H'; -auto utf32 = U'H'; -auto unicode = L'\u202e' -auto hex = '\xFF' -auto octal = '\123' +auto wide_char = L'H'; +auto cr = '\n'; +auto chr = 'H'; +auto utf8 = u8'H'; +auto utf16 = u'H'; +auto utf32 = U'H'; +auto unicode = L'\u202e' +auto hex = '\xFF' +auto octal = '\123' // Raw string literals (multiline) -auto char_multi = R"(Hello -"normal" +auto char_multi = R"(Hello +"normal" multiline -string.)"; -auto utf8_multi = u8R"(Hello -"utf-8" +string.)"; +auto utf8_multi = u8R"(Hello +"utf-8" multiline -string)"; -auto utf16_multi = uR"(Hello -"utf-16" +string)"; +auto utf16_multi = uR"(Hello +"utf-16" multiline -string)"; -auto utf32_multi = UR"(Hello -"utf-32" +string)"; +auto utf32_multi = UR"(Hello +"utf-32" multiline -string)"; +string)"; // Raw string literals with delimiter (multiline) -auto char_multi = R"blah1(Hello -"normal" +auto char_multi = R"blah1(Hello +"normal" multiline -)" -)blah" -string.)blah1"; -auto utf8_multi = u8R"blah2(Hello -"utf-8" +)" +)blah" +string.)blah1"; +auto utf8_multi = u8R"blah2(Hello +"utf-8" multiline -)" -)blah" -string)blah2"; -auto utf16_multi = uR"blah3(Hello -"utf-16" +)" +)blah" +string)blah2"; +auto utf16_multi = uR"blah3(Hello +"utf-16" multiline -)" -)blah" -string)blah3"; -auto utf32_multi = UR"blah4(Hello -"utf-32" +)" +)blah" +string)blah3"; +auto utf32_multi = UR"blah4(Hello +"utf-32" multiline -)" -)blah" -string)blah4"; +)" +)blah" +string)blah4"; // Meta strings #include <stdio> -#include "lib.h" +#include "lib.h" diff --git a/test/markup/cpp/truncated-block-comment.expect.txt b/test/markup/cpp/truncated-block-comment.expect.txt index a2f5ce048a..5d34afed47 100644 --- a/test/markup/cpp/truncated-block-comment.expect.txt +++ b/test/markup/cpp/truncated-block-comment.expect.txt @@ -1,3 +1,3 @@ /* Truncated block comment - + \ No newline at end of file diff --git a/test/markup/cpp/truncated-raw-string.expect.txt b/test/markup/cpp/truncated-raw-string.expect.txt index 8d133e8bae..8b6abd1f47 100644 --- a/test/markup/cpp/truncated-raw-string.expect.txt +++ b/test/markup/cpp/truncated-raw-string.expect.txt @@ -1,5 +1,5 @@ -R"foo( +R"foo( Truncated raw string -)nope" +)nope" Still not completed. - + \ No newline at end of file diff --git a/test/markup/crystal/literals.expect.txt b/test/markup/crystal/literals.expect.txt index 46d8aef5dd..9580ee82a3 100644 --- a/test/markup/crystal/literals.expect.txt +++ b/test/markup/crystal/literals.expect.txt @@ -46,37 +46,37 @@ 1_000_000.111_111 1_000_000.111_111e12 -'c' -'\\' -'\u{ABCD}' - -"string" -"\u{48 45 4C 4C 4F}" -"interpolated #{string}" -"interpolated #{"string"}" +'c' +'\\' +'\u{ABCD}' + +"string" +"\u{48 45 4C 4C 4F}" +"interpolated #{string}" +"interpolated #{"string"}" %(string) %q(string) %Q(string) -%(hello ("world")) -%[hello ["world"]] -%{hello {"world"}} -%<hello <"world">> -%|hello "world"| -"hello - world" -"hello \ +%(hello ("world")) +%[hello ["world"]] +%{hello {"world"}} +%<hello <"world">> +%|hello "world"| +"hello + world" +"hello \ world, \ - no newlines" + no newlines" <<-STRING Hello world STRING -<<-'HERE' +<<-'HERE' hello \n HERE :unquoted_symbol -:"quoted symbol" +:"quoted symbol" :question? :exclamation! :+ diff --git a/test/markup/crystal/macro.expect.txt b/test/markup/crystal/macro.expect.txt index 38b24477b9..6b0c9e94e3 100644 --- a/test/markup/crystal/macro.expect.txt +++ b/test/markup/crystal/macro.expect.txt @@ -1,9 +1,9 @@ -puts {{ "hello world" }} +puts {{ "hello world" }} -{% verbatim %}{{ "bla".id }}{% end %} +{% verbatim %}{{ "bla".id }}{% end %} macro foo {% verbatim %} - {{ "bla".id }} + {{ "bla".id }} {% end %} end diff --git a/test/markup/crystal/operators.expect.txt b/test/markup/crystal/operators.expect.txt index cd70109268..1b601023a2 100644 --- a/test/markup/crystal/operators.expect.txt +++ b/test/markup/crystal/operators.expect.txt @@ -31,4 +31,4 @@ []? []= / - + \ No newline at end of file diff --git a/test/markup/csharp/functions.expect.txt b/test/markup/csharp/functions.expect.txt index 7546f94d22..0451c638dd 100644 --- a/test/markup/csharp/functions.expect.txt +++ b/test/markup/csharp/functions.expect.txt @@ -10,7 +10,7 @@ void ExampleFunctionDeclaration2() ; -public string ExampleExpressionBodiedFunction1() => "dummy"; +public string ExampleExpressionBodiedFunction1() => "dummy"; public string ExampleExpressionBodiedFunction2() - => "dummy"; \ No newline at end of file + => "dummy"; \ No newline at end of file diff --git a/test/markup/csharp/identifiers.expect.txt b/test/markup/csharp/identifiers.expect.txt index 566b865c4d..62d5fc6ce5 100644 --- a/test/markup/csharp/identifiers.expect.txt +++ b/test/markup/csharp/identifiers.expect.txt @@ -1,3 +1,4 @@ var @class = new MyClass(); doSomething(@var, @foo); var a; + diff --git a/test/markup/csharp/string-interpolation.expect.txt b/test/markup/csharp/string-interpolation.expect.txt index 65e754aa1a..99ae144c87 100644 --- a/test/markup/csharp/string-interpolation.expect.txt +++ b/test/markup/csharp/string-interpolation.expect.txt @@ -1,9 +1,9 @@ -var istr = $"{{Hello}},\n{$"\"{nested}\"" + @" and " + $@"""{nested}""" /*comments*/ }"; -var ivstr = $@"{{Hello}}, +var istr = $"{{Hello}},\n{$"\"{nested}\"" + @" and " + $@"""{nested}""" /*comments*/ }"; +var ivstr = $@"{{Hello}}, { -$"\"{nested}\"" + @" +$"\"{nested}\"" + @" and -" + $@" -""{nested}"" -" -/*comments*/ }"; +" + $@" +""{nested}"" +" +/*comments*/ }"; diff --git a/test/markup/css/sample.expect.txt b/test/markup/css/sample.expect.txt index 60c5cb55a4..7fdd2c75f3 100644 --- a/test/markup/css/sample.expect.txt +++ b/test/markup/css/sample.expect.txt @@ -16,7 +16,7 @@ filter: grayscale(0.5) blur(10px); } -a[href*="example"], * [lang^=en] { +a[href*="example"], * [lang^=en] { font-size: 2em; } @@ -39,7 +39,7 @@ } @font-face { - font-family: "Open Sans"; - src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"), - url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); + font-family: "Open Sans"; + src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"), + url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); } diff --git a/test/markup/css/url.expect.txt b/test/markup/css/url.expect.txt index b9ca8ff039..04607703af 100644 --- a/test/markup/css/url.expect.txt +++ b/test/markup/css/url.expect.txt @@ -1,6 +1,6 @@ -div { background: url("foo/bar/baz.jpg") } -div { background: url('foo/bar/baz.jpg') } +div { background: url("foo/bar/baz.jpg") } +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=') } +div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") } +div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } \ No newline at end of file diff --git a/test/markup/dart/string-interpolation.expect.txt b/test/markup/dart/string-interpolation.expect.txt index e35e1e61d6..b9d8aa8f98 100644 --- a/test/markup/dart/string-interpolation.expect.txt +++ b/test/markup/dart/string-interpolation.expect.txt @@ -1,3 +1,3 @@ -'1234$identifier $true'; +'1234$identifier $true'; // comment -'1234${1234 + true + 'foo'}'; +'1234${1234 + true + 'foo'}'; diff --git a/test/markup/diff/comments.expect.txt b/test/markup/diff/comments.expect.txt index 5477ae74f9..f9a21ddced 100644 --- a/test/markup/diff/comments.expect.txt +++ b/test/markup/diff/comments.expect.txt @@ -7,4 +7,4 @@ ==== + Here too ===== -+ Here we don't anymore after five '=' next to each other ++ Here we don't anymore after five '=' next to each other diff --git a/test/markup/dockerfile/default.expect.txt b/test/markup/dockerfile/default.expect.txt index 3d7b03da7d..aa428c10cb 100644 --- a/test/markup/dockerfile/default.expect.txt +++ b/test/markup/dockerfile/default.expect.txt @@ -16,8 +16,8 @@ EXPOSE 80 -VOLUME ["/var/www/html"] +VOLUME ["/var/www/html"] -WORKDIR "/var/www/html" +WORKDIR "/var/www/html" -CMD [ "/usr/sbin/php5-fpm", "-F" ] +CMD [ "/usr/sbin/php5-fpm", "-F" ] diff --git a/test/markup/dsconfig/default.expect.txt b/test/markup/dsconfig/default.expect.txt index cfb2fbadb9..2ba24df5e9 100644 --- a/test/markup/dsconfig/default.expect.txt +++ b/test/markup/dsconfig/default.expect.txt @@ -1,24 +1,24 @@ # Quoted and unquoted properties dsconfig create-client-connection-policy \ - --policy-name "Restrictive Client Connection Policy" \ - --set "description:Restrictive Client Connection Policy" \ + --policy-name "Restrictive Client Connection Policy" \ + --set "description:Restrictive Client Connection Policy" \ --set enabled:true --set evaluation-order-index:1000 \ - --set "connection-criteria:User.0 Connection Criteria" \ + --set "connection-criteria:User.0 Connection Criteria" \ --set maximum-concurrent-connections:2 \ - --set "maximum-connection-duration:1 s" \ - --set "maximum-idle-connection-duration:1 s" \ + --set "maximum-connection-duration:1 s" \ + --set "maximum-idle-connection-duration:1 s" \ --set maximum-operation-count-per-connection:1000 # dsconfig keyword is optional create-client-connection-policy \ - --policy-name "Another Client Connection Policy" \ + --policy-name "Another Client Connection Policy" \ --set enabled:true --set evaluation-order-index:100 \ - --set 'connection-criteria:User.1 Connection Criteria' \ + --set 'connection-criteria:User.1 Connection Criteria' \ # Property without value --reset maximum-concurrent-connections # Unquoted property, quoted property value dsconfig set-access-control-handler-prop \ - --add global-aci:'(target="ldap:///cn=config")(targetattr="*")(version 3.0; acl "Allow access to the config tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ - --add global-aci:'(target="ldap:///cn=monitor")(targetattr="*")(version 3.0; acl "Allow access to the monitor tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ - --remove global-aci:'(target="ldap:///cn=alerts")(targetattr="*")(version 3.0; acl "Allow access to the alerts tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' + --add global-aci:'(target="ldap:///cn=config")(targetattr="*")(version 3.0; acl "Allow access to the config tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ + --add global-aci:'(target="ldap:///cn=monitor")(targetattr="*")(version 3.0; acl "Allow access to the monitor tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ + --remove global-aci:'(target="ldap:///cn=alerts")(targetattr="*")(version 3.0; acl "Allow access to the alerts tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' # No continuation -dsconfig delete-log-publisher --publisher-name "File-Based Error Logger" +dsconfig delete-log-publisher --publisher-name "File-Based Error Logger" diff --git a/test/markup/ebnf/quote-symbols.expect.txt b/test/markup/ebnf/quote-symbols.expect.txt index 595a99089f..ac9da0ae80 100644 --- a/test/markup/ebnf/quote-symbols.expect.txt +++ b/test/markup/ebnf/quote-symbols.expect.txt @@ -1,5 +1,5 @@ -first_quote_symbol = "'" . -second_quote_symbol = '"' . +first_quote_symbol = "'" . +second_quote_symbol = '"' . (* escaped_quote_symbol tests backticks, which does not interfere * with backslashes. It has precedent in some language diff --git a/test/markup/ebnf/terminators.expect.txt b/test/markup/ebnf/terminators.expect.txt index 72ceda2f9c..c553602ccb 100644 --- a/test/markup/ebnf/terminators.expect.txt +++ b/test/markup/ebnf/terminators.expect.txt @@ -1,3 +1,3 @@ -full-stop = "." . -semicolon = ";" ; -end-test = "end" ; (* ending production to test semicolon *) +full-stop = "." . +semicolon = ";" ; +end-test = "end" ; (* ending production to test semicolon *) diff --git a/test/markup/elixir/function-title.expect.txt b/test/markup/elixir/function-title.expect.txt index c4d01dec75..9e085be9e9 100644 --- a/test/markup/elixir/function-title.expect.txt +++ b/test/markup/elixir/function-title.expect.txt @@ -10,6 +10,6 @@ :ok end -def f!, do: IO.puts "hello world" +def f!, do: IO.puts "hello world" x = 5 diff --git a/test/markup/elixir/sigils.expect.txt b/test/markup/elixir/sigils.expect.txt index 3dc0c47266..e9e194d493 100644 --- a/test/markup/elixir/sigils.expect.txt +++ b/test/markup/elixir/sigils.expect.txt @@ -1,13 +1,13 @@ -~R'this + i\s "a" regex too' -~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s -~W(hello #{no "123" \c\d \123 interpol} world)s +~R'this + i\s "a" regex too' +~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s +~W(hello #{no "123" \c\d \123 interpol} world)s ~s{Escapes terminators \{ and \}, but no {balancing} # outside of sigil here } -~S"No escapes \s\t\n and no #{interpolation}" +~S"No escapes \s\t\n and no #{interpolation}" ~S/hello/ ~S|hello| -~S"hello" -~S'hello' +~S"hello" +~S'hello' ~S(hello) ~S[hello] ~S{hello} @@ -15,8 +15,8 @@ ~s/hello #{name}/ ~s|hello #{name}| -~s"hello #{name}" -~s'hello #{name}' +~s"hello #{name}" +~s'hello #{name}' ~s(hello #{name}) ~s[hello #{name}] ~s{hello #{name}} diff --git a/test/markup/elixir/strings.expect.txt b/test/markup/elixir/strings.expect.txt index 4a8d486358..e3c845a72c 100644 --- a/test/markup/elixir/strings.expect.txt +++ b/test/markup/elixir/strings.expect.txt @@ -1,4 +1,4 @@ -a = """test""" -b = '''test''' -c = "test" -d = 'test' +a = """test""" +b = '''test''' +c = "test" +d = 'test' diff --git a/test/markup/elixir/uppercase-string-sigil.expect.txt b/test/markup/elixir/uppercase-string-sigil.expect.txt index 44d07293d2..ab26fe85fa 100644 --- a/test/markup/elixir/uppercase-string-sigil.expect.txt +++ b/test/markup/elixir/uppercase-string-sigil.expect.txt @@ -1,17 +1,17 @@ defmodule Long.Module.Name do - @doc ~S''' + @doc ~S''' No #{interpolation} of any kind. \000 \x{ff} \n #{\x{ff}} - ''' + ''' def func(a, b \\ []), do: :ok - @doc ~S""" + @doc ~S""" No #{interpolation} of any kind. \000 \x{ff} \n #{\x{ff}} - """ + """ def func(a, b \\ []), do: :ok end diff --git a/test/markup/excel/comments.expect.txt b/test/markup/excel/comments.expect.txt index 596c4f2fa1..fbfe3c34ef 100644 --- a/test/markup/excel/comments.expect.txt +++ b/test/markup/excel/comments.expect.txt @@ -1 +1 @@ -=(N4 + N5)*0.055 + N("This is a comment.") +=(N4 + N5)*0.055 + N("This is a comment.") diff --git a/test/markup/fortran/comments.expect.txt b/test/markup/fortran/comments.expect.txt index ba78a37f63..839dac23e5 100644 --- a/test/markup/fortran/comments.expect.txt +++ b/test/markup/fortran/comments.expect.txt @@ -1,5 +1,5 @@ C -C This program in FORTRAN 77 outputs "Hello, World!". +C This program in FORTRAN 77 outputs "Hello, World!". C ==================================================== !=============================== @@ -10,4 +10,4 @@ C=2 C = 2 !correct -C ='boo' +C ='boo' diff --git a/test/markup/gauss/function_refs.expect.txt b/test/markup/gauss/function_refs.expect.txt index 795eb54279..565ff2ff75 100644 --- a/test/markup/gauss/function_refs.expect.txt +++ b/test/markup/gauss/function_refs.expect.txt @@ -1,5 +1,5 @@ k = colsf(fin); nr = floor(minc(maxbytes/(k*8*3.5)|maxvec/(k+1))); -call random_user_function_2(-10.0, "hey", /* blah */ x[0x2F]); -ols("", csvReadM("test.csv")); +call random_user_function_2(-10.0, "hey", /* blah */ x[0x2F]); +ols("", csvReadM("test.csv")); if myfn(10) == 20; diff --git a/test/markup/gauss/keywords.expect.txt b/test/markup/gauss/keywords.expect.txt index b02f6efe9d..b180d514cb 100644 --- a/test/markup/gauss/keywords.expect.txt +++ b/test/markup/gauss/keywords.expect.txt @@ -3,5 +3,5 @@ elseif i % 2 .eqv 0; external string _olsrnam; external proc indices2,indexcat; -myPlot.axes.and.for.if.endif.text = "hey"; +myPlot.axes.and.for.if.endif.text = "hey"; local f:proc; diff --git a/test/markup/go/strings.expect.txt b/test/markup/go/strings.expect.txt index b5c604552b..840af5e545 100644 --- a/test/markup/go/strings.expect.txt +++ b/test/markup/go/strings.expect.txt @@ -1,7 +1,7 @@ func main() { - str := "Hello, 世界\nHello \"world\"\nHello 'world'" - char := 'a' - char2 := '"' - char3 := '\\' - char3 := '\'' + str := "Hello, 世界\nHello \"world\"\nHello 'world'" + char := 'a' + char2 := '"' + char3 := '\\' + char3 := '\'' } diff --git a/test/markup/golo/default.expect.txt b/test/markup/golo/default.expect.txt index 749220811d..a6a64149a4 100644 --- a/test/markup/golo/default.expect.txt +++ b/test/markup/golo/default.expect.txt @@ -9,7 +9,7 @@ let a = 1 var b = 2 - println("hello") + println("hello") - let john = human("John Doe") + let john = human("John Doe") } diff --git a/test/markup/groovy/default.expect.txt b/test/markup/groovy/default.expect.txt index c546cd97d9..5962db4897 100644 --- a/test/markup/groovy/default.expect.txt +++ b/test/markup/groovy/default.expect.txt @@ -14,15 +14,15 @@ def otherNumber = 3 / 4 boolean archivable = condition ?: true def ternary = a ? b : c - String name = "Guillaume" + String name = "Guillaume" Closure description = null List<DownloadPackage> packages = [] String regex = ~/.*foo.*/ - String multi = ''' + String multi = ''' multi line string - ''' + """ + ''' + """ now with double quotes and ${gstring} - """ + $/ + """ + $/ even with dollar slashy strings /$ @@ -33,10 +33,10 @@ void description(Closure cl) { this.description = cl } void version(String name, Closure versionSpec) { - def closure = { println "hi" } as Runnable + def closure = { println "hi" } as Runnable MyList ml = [1, 2, [a: 1, b:2,c :3]] - for (ch in "name") {} + for (ch in "name") {} // single line comment DownloadPackage pkg = new DownloadPackage(version: name) diff --git a/test/markup/groovy/oneoffs.expect.txt b/test/markup/groovy/oneoffs.expect.txt index bb4c7ef80d..f64bffb33c 100644 --- a/test/markup/groovy/oneoffs.expect.txt +++ b/test/markup/groovy/oneoffs.expect.txt @@ -1,3 +1,3 @@ // ternary can include quotes -def formattingMsg = label < 0 ? ('The following files need formatting:\n ' + - codeStyleFiles.join('\n ')) : 'All files are correctly formatted' +def formattingMsg = label < 0 ? ('The following files need formatting:\n ' + + codeStyleFiles.join('\n ')) : 'All files are correctly formatted' diff --git a/test/markup/handlebars/block-expression-variants-as-path-segment.expect.txt b/test/markup/handlebars/block-expression-variants-as-path-segment.expect.txt index c1a252d87c..332957dc2d 100644 --- a/test/markup/handlebars/block-expression-variants-as-path-segment.expect.txt +++ b/test/markup/handlebars/block-expression-variants-as-path-segment.expect.txt @@ -1,9 +1,9 @@ -text {{#abc abcd.[lite"'ral}}segment] }}a{{/abc}} +text {{#abc abcd.[lite"'ral}}segment] }}a{{/abc}} -text {{#abc abcd."lite]'ral}}segment" }}a{{/abc}} +text {{#abc abcd."lite]'ral}}segment" }}a{{/abc}} -text {{#abc abcd.'lite]"ral}}segment' }}a{{/abc}} +text {{#abc abcd.'lite]"ral}}segment' }}a{{/abc}} text - + \ No newline at end of file diff --git a/test/markup/handlebars/block-expression-variants-in-helper-name.expect.txt b/test/markup/handlebars/block-expression-variants-in-helper-name.expect.txt index 09c34f21f3..2172512371 100644 --- a/test/markup/handlebars/block-expression-variants-in-helper-name.expect.txt +++ b/test/markup/handlebars/block-expression-variants-in-helper-name.expect.txt @@ -1,14 +1,14 @@ text {{#[ab}}c] param }}a{{/[ab}}c]}} -text {{#'ab}}c' param}}a{{/'ab}}c'}} +text {{#'ab}}c' param}}a{{/'ab}}c'}} -text {{#"ab}}c" param}}a{{/"ab}}c"}} +text {{#"ab}}c" param}}a{{/"ab}}c"}} -text {{#"" param}}a{{/""}} +text {{#"" param}}a{{/""}} -text {{#'' param}}a{{/''}} +text {{#'' param}}a{{/''}} text {{#[] param}}a{{/[]}} text - + \ No newline at end of file diff --git a/test/markup/handlebars/block-expression-variants-in-param.expect.txt b/test/markup/handlebars/block-expression-variants-in-param.expect.txt index 1d6250a0a8..567f7affe5 100644 --- a/test/markup/handlebars/block-expression-variants-in-param.expect.txt +++ b/test/markup/handlebars/block-expression-variants-in-param.expect.txt @@ -1,8 +1,8 @@ -text {{#abc "lite]'ral}}segment" }}a{{/abc}} +text {{#abc "lite]'ral}}segment" }}a{{/abc}} -text {{#abc 'lite]"ral}}segment' }}a{{/abc}} +text {{#abc 'lite]"ral}}segment' }}a{{/abc}} -text {{#abc [lite"'ral}}segment] }}a{{/abc}} +text {{#abc [lite"'ral}}segment] }}a{{/abc}} text - + \ No newline at end of file diff --git a/test/markup/handlebars/block-parameters-as.expect.txt b/test/markup/handlebars/block-parameters-as.expect.txt index 87547011c7..9bf2c6b69d 100644 --- a/test/markup/handlebars/block-parameters-as.expect.txt +++ b/test/markup/handlebars/block-parameters-as.expect.txt @@ -1,4 +1,4 @@ {{#each filter as | value index|}} {{/each}} {{#with as as | as |}} {{/with}} - + \ No newline at end of file diff --git a/test/markup/handlebars/block-with-param.expect.txt b/test/markup/handlebars/block-with-param.expect.txt index accf7824eb..5cfa7737dc 100644 --- a/test/markup/handlebars/block-with-param.expect.txt +++ b/test/markup/handlebars/block-with-param.expect.txt @@ -1,2 +1,2 @@ {{#blockHelper param1 param2}}block content{{/blockHelper}} - + \ No newline at end of file diff --git a/test/markup/handlebars/block.expect.txt b/test/markup/handlebars/block.expect.txt index 52de3bf769..1937d53164 100644 --- a/test/markup/handlebars/block.expect.txt +++ b/test/markup/handlebars/block.expect.txt @@ -1,2 +1,2 @@ {{#block}}block content{{/block}} - +
\ No newline at end of file diff --git a/test/markup/handlebars/built-ins.expect.txt b/test/markup/handlebars/built-ins.expect.txt index 06b6df66a8..357bb36eaf 100644 --- a/test/markup/handlebars/built-ins.expect.txt +++ b/test/markup/handlebars/built-ins.expect.txt @@ -9,4 +9,4 @@
{{lookup abc}} {{log test}} - + \ No newline at end of file diff --git a/test/markup/handlebars/combinations-with-text.expect.txt b/test/markup/handlebars/combinations-with-text.expect.txt index 383bea58a6..d866457688 100644 --- a/test/markup/handlebars/combinations-with-text.expect.txt +++ b/test/markup/handlebars/combinations-with-text.expect.txt @@ -1,6 +1,6 @@ some text -{{#custom (nested (helper 'a{{bc' 1)) key=value as | blockParam |}} some {{blockParam}} text {{/custom}} +{{#custom (nested (helper 'a{{bc' 1)) key=value as | blockParam |}} some {{blockParam}} text {{/custom}} some text - + \ No newline at end of file diff --git a/test/markup/handlebars/comments.expect.txt b/test/markup/handlebars/comments.expect.txt index e8f3741766..af06f3b104 100644 --- a/test/markup/handlebars/comments.expect.txt +++ b/test/markup/handlebars/comments.expect.txt @@ -1,4 +1,4 @@ {{!-- a comment {{expression}} --}} {{expression}} {{! a simple comment }} - + \ No newline at end of file diff --git a/test/markup/handlebars/else-variants.expect.txt b/test/markup/handlebars/else-variants.expect.txt index 55bc49d22c..78bb20062d 100644 --- a/test/markup/handlebars/else-variants.expect.txt +++ b/test/markup/handlebars/else-variants.expect.txt @@ -8,4 +8,4 @@ \{{else}} is not a keyword if escaped - + \ No newline at end of file diff --git a/test/markup/handlebars/escaped-mustaches.expect.txt b/test/markup/handlebars/escaped-mustaches.expect.txt index d56ec49a6a..b75c3d9cbb 100644 --- a/test/markup/handlebars/escaped-mustaches.expect.txt +++ b/test/markup/handlebars/escaped-mustaches.expect.txt @@ -19,4 +19,4 @@ \\\\{{expression}} \\\{{! comment }} - + \ No newline at end of file diff --git a/test/markup/handlebars/expression-variants.expect.txt b/test/markup/handlebars/expression-variants.expect.txt index dd1c2d9814..414dd4e377 100644 --- a/test/markup/handlebars/expression-variants.expect.txt +++ b/test/markup/handlebars/expression-variants.expect.txt @@ -1,27 +1,27 @@ text -{{ "lite]'ral}}segment" }} text +{{ "lite]'ral}}segment" }} text -{{ 'lite]"ral}}segment' }} text +{{ 'lite]"ral}}segment' }} text -{{ [lite"'ral}}segment] }} text +{{ [lite"'ral}}segment] }} text -{{ abc "lite]'ral}}segment" }} text +{{ abc "lite]'ral}}segment" }} text -{{ abc 'lite]"ral}}segment' }} text +{{ abc 'lite]"ral}}segment' }} text -{{ abc [lite"'ral}}segment] }} text +{{ abc [lite"'ral}}segment] }} text -{{ abcd.[lite"'ral}}segment] }} text +{{ abcd.[lite"'ral}}segment] }} text -{{ abcd."lite]'ral}}segment" }} text +{{ abcd."lite]'ral}}segment" }} text -{{ abcd.'lite]"ral}}segment' }} text +{{ abcd.'lite]"ral}}segment' }} text -{{ abcd.''}} text +{{ abcd.''}} text -{{ abcd."" }} text +{{ abcd."" }} text {{ abcd.[] }} text - + \ No newline at end of file diff --git a/test/markup/handlebars/hashes.expect.txt b/test/markup/handlebars/hashes.expect.txt index ddf626e066..5a6ca0dfae 100644 --- a/test/markup/handlebars/hashes.expect.txt +++ b/test/markup/handlebars/hashes.expect.txt @@ -9,4 +9,4 @@ {{{{#helper key=value}}}} {{{{/helper}}}} {{helper (subExpression key=value)}} - + \ No newline at end of file diff --git a/test/markup/handlebars/literals-in-different-places.expect.txt b/test/markup/handlebars/literals-in-different-places.expect.txt index a82bd9f8d7..2d43b9b3c9 100644 --- a/test/markup/handlebars/literals-in-different-places.expect.txt +++ b/test/markup/handlebars/literals-in-different-places.expect.txt @@ -11,4 +11,4 @@ {{helper (helper true false)}} {{helper a=true b=false}} - + \ No newline at end of file diff --git a/test/markup/handlebars/literals.expect.txt b/test/markup/handlebars/literals.expect.txt index 65cfda721f..484f4cad9c 100644 --- a/test/markup/handlebars/literals.expect.txt +++ b/test/markup/handlebars/literals.expect.txt @@ -6,9 +6,9 @@ {{helper undefined}} -{{helper 'string'}} +{{helper 'string'}} -{{helper "string"}} +{{helper "string"}} {{helper [not a string literal but a variable]}} - + \ No newline at end of file diff --git a/test/markup/handlebars/partial-call.expect.txt b/test/markup/handlebars/partial-call.expect.txt index 506dfef8fc..4ff92a6fb4 100644 --- a/test/markup/handlebars/partial-call.expect.txt +++ b/test/markup/handlebars/partial-call.expect.txt @@ -1,2 +1,2 @@ {{> partial}} - + \ No newline at end of file diff --git a/test/markup/handlebars/path-expressions.expect.txt b/test/markup/handlebars/path-expressions.expect.txt index b5307b1830..9ebaf62401 100644 --- a/test/markup/handlebars/path-expressions.expect.txt +++ b/test/markup/handlebars/path-expressions.expect.txt @@ -7,4 +7,4 @@ {{{{#path.expression}}}} {{{{/path.expression}}}} {{with.in.a.path.expression}} is not a built-in - + \ No newline at end of file diff --git a/test/markup/handlebars/raw-block.expect.txt b/test/markup/handlebars/raw-block.expect.txt index b5d94e8a34..abbd3f46cf 100644 --- a/test/markup/handlebars/raw-block.expect.txt +++ b/test/markup/handlebars/raw-block.expect.txt @@ -1,2 +1,2 @@ {{{{#raw}}}} {{verbatim}} content {{{{/raw}}}} {{var}} - + \ No newline at end of file diff --git a/test/markup/handlebars/simple-expression.expect.txt b/test/markup/handlebars/simple-expression.expect.txt index 41d5cc869f..a18900dbae 100644 --- a/test/markup/handlebars/simple-expression.expect.txt +++ b/test/markup/handlebars/simple-expression.expect.txt @@ -1,2 +1,2 @@ {{abc}} - + \ No newline at end of file diff --git a/test/markup/handlebars/sub-expressions.expect.txt b/test/markup/handlebars/sub-expressions.expect.txt index 6b386b9c3c..47d00dfdc8 100644 --- a/test/markup/handlebars/sub-expressions.expect.txt +++ b/test/markup/handlebars/sub-expressions.expect.txt @@ -11,4 +11,4 @@ {{helper key=(subExpression 1 2)}} {{helper (subExpression (canBeNested 1 2) anotherParam)}} - + \ No newline at end of file diff --git a/test/markup/handlebars/triple-mustache.expect.txt b/test/markup/handlebars/triple-mustache.expect.txt index 3512548e3f..1787f8d7ae 100644 --- a/test/markup/handlebars/triple-mustache.expect.txt +++ b/test/markup/handlebars/triple-mustache.expect.txt @@ -1,2 +1,2 @@ {{{raw}}} - + \ No newline at end of file diff --git a/test/markup/http/default.expect.txt b/test/markup/http/default.expect.txt index dafe8dc9d4..626a341e41 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} - +{"status": "ok", "extended": true} + \ No newline at end of file diff --git a/test/markup/index.js b/test/markup/index.js index b43ff81dde..28138ffa6b 100644 --- a/test/markup/index.js +++ b/test/markup/index.js @@ -1,10 +1,10 @@ 'use strict'; -const fs = require('fs').promises; -const glob = require('glob'); -const hljs = require('../../build'); -const path = require('path'); -const utility = require('../utility'); +const fs = require('fs').promises; +const glob = require('glob'); +const hljs = require('../../build'); +const path = require('path'); +const utility = require('../utility'); hljs.debugMode(); @@ -15,20 +15,24 @@ function testLanguage(language, {testDir}) { const where = testDir ? path.join(testDir, '*.expect.txt') : utility.buildPath('markup', language, '*.expect.txt'); - const filePath = where, - filenames = glob.sync(filePath); + const filePath = where; + const filenames = glob.sync(filePath); filenames.forEach(function(filename) { - const testName = path.basename(filename, '.expect.txt'), - sourceName = filename.replace(/\.expect/, ''); + const testName = path.basename(filename, '.expect.txt'); + const sourceName = filename.replace(/\.expect/, ''); it(`should markup ${testName}`, function(done) { - const sourceFile = fs.readFile(sourceName, 'utf-8'), - expectedFile = fs.readFile(filename, 'utf-8'); + const sourceFile = fs.readFile(sourceName, 'utf-8'); + const expectedFile = fs.readFile(filename, 'utf-8'); Promise.all([sourceFile, expectedFile]).then(function([source, expected]) { const actual = hljs.highlight(language, source).value; + // Uncomment this for major changes that rewrite the test expectations + // which will then need to be manually compared by hand of course + // require('fs').writeFileSync(filename, actual); + actual.trim().should.equal(expected.trim()); done(); }).catch(function(err) { return done(err) }); @@ -37,22 +41,22 @@ function testLanguage(language, {testDir}) { }); } -describe('highlight() markup', async () => { +describe('highlight() markup', async() => { before(async function() { const markupPath = utility.buildPath('markup'); if (!process.env.ONLY_EXTRA) { - let languages = await fs.readdir(markupPath); + const languages = await fs.readdir(markupPath); languages.forEach(testLanguage); } - let thirdPartyPackages = await getThirdPartyPackages(); + const thirdPartyPackages = await getThirdPartyPackages(); thirdPartyPackages.forEach( (pkg) => pkg.names.forEach( - (name, idx) => testLanguage(name, {testDir: pkg.markupTestPaths[idx]}) + (name, idx) => testLanguage(name, { testDir: pkg.markupTestPaths[idx] }) ) ); - }) + }); - it("adding dynamic tests...", async function() {} ); // this is required to work + it("adding dynamic tests...", async function() {}); // this is required to work }); diff --git a/test/markup/ini/array.expect.txt b/test/markup/ini/array.expect.txt index 31bc35db02..0a48e00c1b 100644 --- a/test/markup/ini/array.expect.txt +++ b/test/markup/ini/array.expect.txt @@ -1,9 +1,10 @@ -moo=["foo"] + +moo=["foo"] KNOWN_PEERS = [ - "finland.some-host.com:11625", - "germany.some-host.com:11625", - "hongkong.some-host.com:11625", + "finland.some-host.com:11625", + "germany.some-host.com:11625", + "hongkong.some-host.com:11625", 32, true ] diff --git a/test/markup/ini/comments.expect.txt b/test/markup/ini/comments.expect.txt index 41bebbb647..8cc54c85dd 100644 --- a/test/markup/ini/comments.expect.txt +++ b/test/markup/ini/comments.expect.txt @@ -1,5 +1,5 @@ # Comment ; ini-style comment -x = "abc" # Comment on same line +x = "abc" # Comment on same line y = 123 ; Comment on same line [table] ; Comment on same line diff --git a/test/markup/ini/tables.expect.txt b/test/markup/ini/tables.expect.txt index f7c245ffba..e5c72b7ddb 100644 --- a/test/markup/ini/tables.expect.txt +++ b/test/markup/ini/tables.expect.txt @@ -1,4 +1,4 @@ [table] [[array]] [dotted.table.name] -[target.'cfg(unix)'] +[target.'cfg(unix)'] diff --git a/test/markup/ini/types.expect.txt b/test/markup/ini/types.expect.txt index 7a508b6a8b..72fb831a16 100644 --- a/test/markup/ini/types.expect.txt +++ b/test/markup/ini/types.expect.txt @@ -3,12 +3,12 @@ f = 7e+12 f = 2e3 f = -1.234e-12 -basic = "string" -multi_basic = """multiple -lines""" -literal = 'string' -multi_literal = '''multiple -lines''' +basic = "string" +multi_basic = """multiple +lines""" +literal = 'string' +multi_literal = '''multiple +lines''' b = true b = false b = on @@ -17,4 +17,4 @@ lines''' b = no dotted.key = 1 array = [1, 2, 3] -inline = {name = "foo", id = 123} +inline = {name = "foo", id = 123} diff --git a/test/markup/java/annotations.expect.txt b/test/markup/java/annotations.expect.txt index 2c9d541e22..771657d382 100644 --- a/test/markup/java/annotations.expect.txt +++ b/test/markup/java/annotations.expect.txt @@ -8,5 +8,5 @@ } class Example { - void foo(@SuppressWarnings("unused") int bar) { } + void foo(@SuppressWarnings("unused") int bar) { } } diff --git a/test/markup/javascript/arrow-function.expect.txt b/test/markup/javascript/arrow-function.expect.txt index 9683eb3982..b9ad0135fa 100644 --- a/test/markup/javascript/arrow-function.expect.txt +++ b/test/markup/javascript/arrow-function.expect.txt @@ -11,3 +11,4 @@ f(x => x const bad = ((a, b) => [...a, b]); const array = [1, 2, 3].reduce((acc, next) => [...acc, next], []); sides.every((length,width=(3+2+(4/5))) => length > 0 ); + diff --git a/test/markup/javascript/class.expect.txt b/test/markup/javascript/class.expect.txt index c631c8f819..edc3e79e3b 100644 --- a/test/markup/javascript/class.expect.txt +++ b/test/markup/javascript/class.expect.txt @@ -2,7 +2,7 @@ constructor(speed, cost) { super(speed); - var c = Symbol('cost'); + var c = Symbol('cost'); this[c] = cost; this.intro = `This is a car runs at diff --git a/test/markup/javascript/default-parameters.expect.txt b/test/markup/javascript/default-parameters.expect.txt index d433ced456..1c8cfe96e7 100644 --- a/test/markup/javascript/default-parameters.expect.txt +++ b/test/markup/javascript/default-parameters.expect.txt @@ -1 +1 @@ -function visibleTodoFilter(state = 'watch', action) {} +function visibleTodoFilter(state = 'watch', action) {} diff --git a/test/markup/javascript/inline-languages.expect.txt b/test/markup/javascript/inline-languages.expect.txt index 5f38b24334..370f041a57 100644 --- a/test/markup/javascript/inline-languages.expect.txt +++ b/test/markup/javascript/inline-languages.expect.txt @@ -1,15 +1,15 @@ let foo = true; -`hello ${foo ? `Mr ${name}` : 'there'}`; +`hello ${foo ? `Mr ${name}` : 'there'}`; foo = false; -html`<div id="foo">Hello world</div>`; +html`<div id="foo">Hello world</div>`; -html`<div id="foo">Hello times ${10} <span id="bar">world</span></div>`; +html`<div id="foo">Hello times ${10} <span id="bar">world</span></div>`; html` - <ul id="list"> - ${repeat(['a', 'b', 'c'], (v) => { - return html`<li class="item">${v}</li>`; + <ul id="list"> + ${repeat(['a', 'b', 'c'], (v) => { + return html`<li class="item">${v}</li>`; }} </ul> `; @@ -20,5 +20,5 @@ css` } `; -// Ensure that we're back in JavaScript mode. +// Ensure that we're back in JavaScript mode. var foo = 10; diff --git a/test/markup/javascript/jsx.expect.txt b/test/markup/javascript/jsx.expect.txt index 0f17aa4dd0..9c0501eeca 100644 --- a/test/markup/javascript/jsx.expect.txt +++ b/test/markup/javascript/jsx.expect.txt @@ -6,18 +6,18 @@ var x = 5; -return (<node attr="value"></node>); +return (<node attr="value"></node>); const n = () => <X /> -const m = () => <X x="" /> +const m = () => <X x="" /> class App extends Component { render() { return ( <BrowserRouter> <div> - <Route path="/about" component={About} /> - <Route path="/contact" component={Contact} /> + <Route path="/about" component={About} /> + <Route path="/contact" component={Contact} /> </div> </BrowserRouter> ); diff --git a/test/markup/javascript/keywords.expect.txt b/test/markup/javascript/keywords.expect.txt index 66edf9fc60..35f70a2546 100644 --- a/test/markup/javascript/keywords.expect.txt +++ b/test/markup/javascript/keywords.expect.txt @@ -2,7 +2,7 @@ try { if (cls.search(/\bno\-highlight\b/) != -1) return process(block, true, 0x0F) + - ' class=""'; + ' class=""'; } catch (e) { /* handle exception */ } diff --git a/test/markup/javascript/method-call.expect.txt b/test/markup/javascript/method-call.expect.txt index c4f40657b0..8e118f6446 100644 --- a/test/markup/javascript/method-call.expect.txt +++ b/test/markup/javascript/method-call.expect.txt @@ -4,3 +4,4 @@ x = [ hljs.COMMENT(/\{%\s*comment\s*%}/, /\{%\s*endcomment\s*%}/), hljs.COMMENT(/\{#/, /#}/), ] + diff --git a/test/markup/javascript/modules.expect.txt b/test/markup/javascript/modules.expect.txt index 0f839093f8..6f031f7000 100644 --- a/test/markup/javascript/modules.expect.txt +++ b/test/markup/javascript/modules.expect.txt @@ -5,4 +5,4 @@ export function something() {}; //------ main.js ------ -import _, { each, something as otherthing } from 'underscore'; +import _, { each, something as otherthing } from 'underscore'; diff --git a/test/markup/javascript/object-attr.expect.txt b/test/markup/javascript/object-attr.expect.txt index 54e9d7301f..f927f9d8cc 100644 --- a/test/markup/javascript/object-attr.expect.txt +++ b/test/markup/javascript/object-attr.expect.txt @@ -2,7 +2,7 @@ key: value, // with comment key2: value, key2clone: value, - 'key-3': value, + 'key-3': value, key4: false ? undefined : true, key5: value, /* with a multiline comment */ key6: value, @@ -12,3 +12,4 @@ comment */ key10: value, } + diff --git a/test/markup/json/comments.expect.txt b/test/markup/json/comments.expect.txt index 33d39ec94b..e3ca89c7a3 100644 --- a/test/markup/json/comments.expect.txt +++ b/test/markup/json/comments.expect.txt @@ -1,17 +1,17 @@ /* multi-line comment before */ [ { - "title": "apples", // yum - "count": [12000, 20000], /* so many? */ - "description": {"text": "...", "sensitive": false} + "title": "apples", // yum + "count": [12000, 20000], /* so many? */ + "description": {"text": "...", "sensitive": false} }, { - "title": "oranges", - "count": [17500, null], - "description": {"text": "...", "sensitive": false} + "title": "oranges", + "count": [17500, null], + "description": {"text": "...", "sensitive": false} } // { - // "title" : "brocolli" + // "title" : "brocolli" // } ] /* multi-line diff --git a/test/markup/kotlin/function.expect.txt b/test/markup/kotlin/function.expect.txt index 779d000875..325495fb5e 100644 --- a/test/markup/kotlin/function.expect.txt +++ b/test/markup/kotlin/function.expect.txt @@ -2,7 +2,7 @@ fun /* b1 */ b(/*b2*/ a : Int /*b3*/) /*b4*/ = a // b5 -fun <T> c() : String = "1" +fun <T> c() : String = "1" inline fun <reified T> d() { return } diff --git a/test/markup/kotlin/nested_comment.expect.txt b/test/markup/kotlin/nested_comment.expect.txt index 63aca9d91b..4082f5a899 100644 --- a/test/markup/kotlin/nested_comment.expect.txt +++ b/test/markup/kotlin/nested_comment.expect.txt @@ -2,7 +2,7 @@ /* multiline nested comment LEVEL 1 */ - println("on kotlin this is a commented code in comment LEVEL 0") + println("on kotlin this is a commented code in comment LEVEL 0") /* another multiline nested comment LEVEL 1 */ diff --git a/test/markup/kotlin/string.expect.txt b/test/markup/kotlin/string.expect.txt index 395266540e..419f0b5b28 100644 --- a/test/markup/kotlin/string.expect.txt +++ b/test/markup/kotlin/string.expect.txt @@ -1,8 +1,8 @@ -"astring" +"astring" expression -"a ${ "string" } ${'c'} b" -"a ${ "string $var ${subs}" } b" -""" ${ +"a ${ "string" } ${'c'} b" +"a ${ "string $var ${subs}" } b" +""" ${ ${subst} -} """ -"""f="true"""" +} """ +"""f="true"""" diff --git a/test/markup/ldif/schema.expect.txt b/test/markup/ldif/schema.expect.txt index 022980609e..87dd954868 100644 --- a/test/markup/ldif/schema.expect.txt +++ b/test/markup/ldif/schema.expect.txt @@ -3,13 +3,13 @@ objectClass: ldapSubentry objectClass: subschema # Single-valued JSON attribute -attributeTypes: ( example-json1-oid NAME 'json1' +attributeTypes: ( example-json1-oid NAME 'json1' EQUALITY jsonObjectExactMatch SYNTAX 1.3.6.1.4.1.30221.2.3.4 - SINGLE-VALUE X-ORIGIN 'custom attribute' ) + SINGLE-VALUE X-ORIGIN 'custom attribute' ) # Multi-valued JSON attribute -attributeTypes: ( example-mjson1-oid NAME 'mjson1' +attributeTypes: ( example-mjson1-oid NAME 'mjson1' EQUALITY jsonObjectExactMatch SYNTAX 1.3.6.1.4.1.30221.2.3.4 - X-ORIGIN 'custom attribute' ) -objectClasses: ( example-application-oc-oid NAME 'example-application-oc' + X-ORIGIN 'custom attribute' ) +objectClasses: ( example-application-oc-oid NAME 'example-application-oc' SUP top AUXILIARY MAY ( json1 $ mjson1 ) - X-ORIGIN 'custom auxiliary object class' ) + X-ORIGIN 'custom auxiliary object class' ) diff --git a/test/markup/less/selectors.expect.txt b/test/markup/less/selectors.expect.txt index 425530e590..735d2ab9bf 100644 --- a/test/markup/less/selectors.expect.txt +++ b/test/markup/less/selectors.expect.txt @@ -4,5 +4,5 @@ #bar {} &#bar {} &:hover {} - height: ~"@{height}px"; + height: ~"@{height}px"; } diff --git a/test/markup/lisp/mec.expect.txt b/test/markup/lisp/mec.expect.txt index a1e680d5c0..f474848804 100644 --- a/test/markup/lisp/mec.expect.txt +++ b/test/markup/lisp/mec.expect.txt @@ -1,4 +1,4 @@ ; MEC: Multiple Escape Characters. See https://github.com/highlightjs/highlight.js/issues/615 (|spaces and newlines| x) -(x '|quoted|) +(x '|quoted|) diff --git a/test/markup/markdown/code.expect.txt b/test/markup/markdown/code.expect.txt index c50bd78a60..bac2ba0f75 100644 --- a/test/markup/markdown/code.expect.txt +++ b/test/markup/markdown/code.expect.txt @@ -8,7 +8,7 @@ var code = true; ````md ``` -a = 'This is a code block in python' +a = 'This is a code block in python' ``` ```` diff --git a/test/markup/markdown/sections.expect.txt b/test/markup/markdown/sections.expect.txt index 36093ec8a7..99dbdb5bce 100644 --- a/test/markup/markdown/sections.expect.txt +++ b/test/markup/markdown/sections.expect.txt @@ -9,3 +9,4 @@ =========== # *hello world* or [google](link) + diff --git a/test/markup/matlab/transpose.expect.txt b/test/markup/matlab/transpose.expect.txt index 26fe7f778e..996c83bdac 100644 --- a/test/markup/matlab/transpose.expect.txt +++ b/test/markup/matlab/transpose.expect.txt @@ -1,40 +1,40 @@ -% This use of ' is for transpose: -mat2x2 = [1 2; 3 4]'; % transpose of a matrix -cell2x2 = {1 2; 3 4}'; % transpose of a cell -v=mat2x2'; % transpose of a variable -v2 = (v')'; % two transpose operations -foo = 1.'; % transpose of scalar 1. +% This use of ' is for transpose: +mat2x2 = [1 2; 3 4]'; % transpose of a matrix +cell2x2 = {1 2; 3 4}'; % transpose of a cell +v=mat2x2'; % transpose of a variable +v2 = (v')'; % two transpose operations +foo = 1.'; % transpose of scalar 1. -% Nonconjugate transpose uses .' -mat2x2 = [1 2; 3 4].'; % of a matrix -cell2x2 = {1 2; 3 4}.'; % of a cell -v=mat2x2.'; % of a variable -v2 = (v.').'; % two operations -foo = 1..'; % of scalar 1. -bar = v.''.'.''; % mix of transpose operations +% Nonconjugate transpose uses .' +mat2x2 = [1 2; 3 4].'; % of a matrix +cell2x2 = {1 2; 3 4}.'; % of a cell +v=mat2x2.'; % of a variable +v2 = (v.').'; % two operations +foo = 1..'; % of scalar 1. +bar = v.''.'.''; % mix of transpose operations % single quote strings: -sq1 = 'a single quote string'; +sq1 = 'a single quote string'; sq2 = ... -' abcd '; % single quote string starting at column 1 -sq3 = ['a','bc']; % array of single quote strings -sq4 = {'a','bc'}; % cell of single quote strings +' abcd '; % single quote string starting at column 1 +sq3 = ['a','bc']; % array of single quote strings +sq4 = {'a','bc'}; % cell of single quote strings % double quote strings -dq1 = "a double string"; +dq1 = "a double string"; dq2 = ... -" abcd "; % double quote string starting at column 1 -dq3 = ["a","bc"]; % array of double quote strings +" abcd "; % double quote string starting at column 1 +dq3 = ["a","bc"]; % array of double quote strings % Mixture of strings and transpose -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''''']; +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''''']; -s2 = "abc\"def""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 +s2 = "abc\"def""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 -b = true' + false'; % boolean constants +b = true' + false'; % boolean constants diff --git a/test/markup/maxima/example.expect.txt b/test/markup/maxima/example.expect.txt index 0e238902c0..666fccf820 100644 --- a/test/markup/maxima/example.expect.txt +++ b/test/markup/maxima/example.expect.txt @@ -1,6 +1,6 @@ /* Maxima computer algebra system */ -print ("mumble"); +print ("mumble"); /* this /* this is @@ -27,10 +27,10 @@ foo and bar or/* strings */ -s1 : "\"now\" is"; -s2 : "the 'time' for all good men"; -print (s1, s2, "to come to the aid", - "of their country"); +s1 : "\"now\" is"; +s2 : "the 'time' for all good men"; +print (s1, s2, "to come to the aid", + "of their country"); /* expressions */ diff --git a/test/markup/objectivec/preprocessor.expect.txt b/test/markup/objectivec/preprocessor.expect.txt index 9002811ef6..98c6d3dc92 100644 --- a/test/markup/objectivec/preprocessor.expect.txt +++ b/test/markup/objectivec/preprocessor.expect.txt @@ -12,7 +12,7 @@ TYPE1 foo(void) # define x(v) ((v)) # define x(v) ((v)) -#if MACRO_WITH_STRING_ARG("hello \"world\"") +#if MACRO_WITH_STRING_ARG("hello \"world\"") #elif MULTI_LINE /* comment */ < \ EXPRESSION int bar; diff --git a/test/markup/objectivec/string-literals.expect.txt b/test/markup/objectivec/string-literals.expect.txt index 1accd83881..a59d6c08c1 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"; -NSString *nsstr = @"Obj-C \"quoted\" string\n"; -char c = 'c'; -char c2 = '"'; -char c3 = '\''; -char c4 = '\n'; -int multibyte_char = 'abcd'; +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'; diff --git a/test/markup/ocaml/literals.expect.txt b/test/markup/ocaml/literals.expect.txt index d0c95beeb8..c3ef57cf87 100644 --- a/test/markup/ocaml/literals.expect.txt +++ b/test/markup/ocaml/literals.expect.txt @@ -23,7 +23,7 @@ let a = [||] let () = ignore (b) -let c = 'a' -let c = '\xFF' -let c = '\128' -let c = '\n' +let c = 'a' +let c = '\xFF' +let c = '\128' +let c = '\n' diff --git a/test/markup/ocaml/types.expect.txt b/test/markup/ocaml/types.expect.txt index 1c28405f2c..440987354c 100644 --- a/test/markup/ocaml/types.expect.txt +++ b/test/markup/ocaml/types.expect.txt @@ -1,6 +1,6 @@ (* type variables *) -type 'a t = 'a list -let f (a : 'a list) : 'a = List.hd a +type 'a t = 'a list +let f (a : 'a list) : 'a = List.hd a (* polymorphic variants *) type t = [ `A | `B ] diff --git a/test/markup/pgsql/clauses2.expect.txt b/test/markup/pgsql/clauses2.expect.txt index 9988ed9150..ab74104fd2 100644 --- a/test/markup/pgsql/clauses2.expect.txt +++ b/test/markup/pgsql/clauses2.expect.txt @@ -15,7 +15,7 @@ CALLED ON NULL INPUT, RETURNS NULL ON NULL INPUT, COLLATE, CONCURRENTLY, -CONNECTION '..', +CONNECTION '..', CONSTRAINT, COST 100, CLUSTER ON, @@ -43,7 +43,7 @@ FOR ROW, FOR EACH ROW, FOR STATEMENT, FOR EACH STATEMENT, FOR UPDATE, FOR NO KEY UPDATE, FOR SHARE, FOR KEY SHARE, FROM, -FROM '..', FROM PROGRAM, FROM STDIN, +FROM '..', FROM PROGRAM, FROM STDIN, FROM SQL WITH FUNCTION, TO SQL WITH FUNCTION, FROM ( .. ), -- select FUNCTION, FUNCTIONS, @@ -130,7 +130,7 @@ TABLESAMPLE, TEMPORARY, TEMP, -- create sequence/table/view, discard TO GROUP, PUBLIC WITH GRANT OPTION, -TO '..', TO PROGRAM, TO STDOUT, +TO '..', TO PROGRAM, TO STDOUT, TRANSFORM FOR TYPE, TRUSTED, TYPE, diff --git a/test/markup/pgsql/dollar_strings.expect.txt b/test/markup/pgsql/dollar_strings.expect.txt index 841d2cff6f..52f584761a 100644 --- a/test/markup/pgsql/dollar_strings.expect.txt +++ b/test/markup/pgsql/dollar_strings.expect.txt @@ -1,9 +1,9 @@ CREATE OR REPLACE FUNCTION hello_world(param_your_name text) RETURNS text AS $$ -SELECT 'Hello world. My name is ' || param_your_name || '.'; +SELECT 'Hello world. My name is ' || param_your_name || '.'; $$ language sql STRICT; -SELECT sql_expression($sql$SELECT hello_world($phrase$Regina's elephant's dog$phrase$) - || $phrase$ I made a cat's meow today.$phrase$ $sql$); +SELECT sql_expression($sql$SELECT hello_world($phrase$Regina's elephant's dog$phrase$) + || $phrase$ I made a cat's meow today.$phrase$ $sql$); diff --git a/test/markup/pgsql/options.expect.txt b/test/markup/pgsql/options.expect.txt index d9b44140e4..5eace979e3 100644 --- a/test/markup/pgsql/options.expect.txt +++ b/test/markup/pgsql/options.expect.txt @@ -4,10 +4,10 @@ -- alter/create role SUPERUSER, NOSUPERUSER, CREATEDB, NOCREATEDB, CREATEROLE, NOCREATEROLE, INHERIT, NOINHERIT, LOGIN, NOLOGIN, REPLICATION, NOREPLICATION, BYPASSRLS, NOBYPASSRLS, CONNECTION LIMIT 100, - ENCRYPTED PASSWORD, UNENCRYPTED PASSWORD, VALID UNTIL '2020-01-01', + ENCRYPTED PASSWORD, UNENCRYPTED PASSWORD, VALID UNTIL '2020-01-01', IN ROLE, IN GROUP, ROLE, ADMIN, USER, SYSID; -- copy - FORMAT, OIDS, FREEZE, DELIMITER, NULL '..', HEADER, QUOTE, ESCAPE, FORCE_QUOTE, + FORMAT, OIDS, FREEZE, DELIMITER, NULL '..', HEADER, QUOTE, ESCAPE, FORCE_QUOTE, FORCE_NOT_NULL, FORCE_NULL, ENCODING; -- create aggregate BASETYPE=, SFUNC=, STYPE=, SSPACE=, FINALFUNC=, FINALFUNC_EXTRA=, diff --git a/test/markup/pgsql/plpgsql.expect.txt b/test/markup/pgsql/plpgsql.expect.txt index 5b1c494801..25ab9586d1 100644 --- a/test/markup/pgsql/plpgsql.expect.txt +++ b/test/markup/pgsql/plpgsql.expect.txt @@ -15,7 +15,7 @@ myfield tablename.columnname%TYPE; BEGIN PERFORM pg_sleep(1); - RAISE NOTICE 'Quantity here is %', quantity; + RAISE NOTICE 'Quantity here is %', quantity; END; SELECT * INTO myrec FROM emp WHERE empname = myname; @@ -23,7 +23,7 @@ IF NOT FOUND THEN EXIT <<outer_block>>; ELSIF quantity < 0 THEN - ASSERT a > b, 'Bad luck'; + ASSERT a > b, 'Bad luck'; END IF; FOR r IN SELECT * FROM foo LOOP @@ -44,7 +44,7 @@ END CASE; END LOOP; - EXECUTE 'SELECT count(*) FROM mytable WHERE inserted_by = $1' INTO c USING checked_user; + EXECUTE 'SELECT count(*) FROM mytable WHERE inserted_by = $1' INTO c USING checked_user; OPEN curs1 SCROLL FOR SELECT * FROM foo WHERE key = mykey; FETCH LAST FROM curs1 INTO x, y; @@ -56,6 +56,6 @@ EXCEPTION WHEN NO_DATA_FOUND THEN GET DIAGNOSTICS integer_var = ROW_COUNT; - WHEN SQLSTATE '22012' THEN + WHEN SQLSTATE '22012' THEN NULL; END; diff --git a/test/markup/pgsql/window-functions.expect.txt b/test/markup/pgsql/window-functions.expect.txt index ef85a332cc..dda290ca0d 100644 --- a/test/markup/pgsql/window-functions.expect.txt +++ b/test/markup/pgsql/window-functions.expect.txt @@ -25,7 +25,7 @@ -- examples -SELECT string_agg(empno, ',' ORDER BY a) FROM empsalary; +SELECT string_agg(empno, ',' ORDER BY a) FROM empsalary; SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY income) FROM households; SELECT count(*) FILTER (WHERE i < 5) FROM generate_series(1,10) AS s(i); SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM empsalary; diff --git a/test/markup/pgsql/xml.expect.txt b/test/markup/pgsql/xml.expect.txt index 93ca3f6136..4f76b3d4a7 100644 --- a/test/markup/pgsql/xml.expect.txt +++ b/test/markup/pgsql/xml.expect.txt @@ -1,29 +1,29 @@ -- xml -XMLPARSE (DOCUMENT '...' PRESERVE WHITESPACE) -XMLPARSE (CONTENT '...' STRIP WHITESPACE) -XMLSERIALIZE ( DOCUMENT '...' AS text ) -XMLSERIALIZE ( CONTENT '...' AS text ) +XMLPARSE (DOCUMENT '...' PRESERVE WHITESPACE) +XMLPARSE (CONTENT '...' STRIP WHITESPACE) +XMLSERIALIZE ( DOCUMENT '...' AS text ) +XMLSERIALIZE ( CONTENT '...' AS text ) SET XML OPTION DOCUMENT; SET XML OPTION CONTENT; -SELECT xmlcomment('...'); -SELECT xmlconcat('...', '...'); -SELECT xmlelement(name foo, xmlattributes('...' as bar)); -SELECT xmlforest('...' AS foo, 123 AS bar); -SELECT xmlpi(name php, '...'); -SELECT xmlroot(xmlparse(document '...'), version '...', standalone yes); +SELECT xmlcomment('...'); +SELECT xmlconcat('...', '...'); +SELECT xmlelement(name foo, xmlattributes('...' as bar)); +SELECT xmlforest('...' AS foo, 123 AS bar); +SELECT xmlpi(name php, '...'); +SELECT xmlroot(xmlparse(document '...'), version '...', standalone yes); SELECT xmlagg(x ORDER BY y DESC) FROM test; -SELECT xmlexists('...' PASSING BY REF '...'); +SELECT xmlexists('...' PASSING BY REF '...'); -SELECT xpath('...', '...', ARRAY[ARRAY['...', '...']]); -SELECT xpath_exists('...', '...', ARRAY[ARRAY['...', '...']]); +SELECT xpath('...', '...', ARRAY[ARRAY['...', '...']]); +SELECT xpath_exists('...', '...', ARRAY[ARRAY['...', '...']]); -SELECT XMLTABLE('...' PASSING data COLUMNS id int PATH '...' DEFAULT '...', ordinality FOR ORDINALITY) ; +SELECT XMLTABLE('...' PASSING data COLUMNS id int PATH '...' DEFAULT '...', ordinality FOR ORDINALITY) ; -SELECT XMLTABLE(XMLNAMESPACES('...' AS x, '...' AS "B"), '...' PASSING (SELECT data FROM xmldata) COLUMNS foo int PATH '...'); +SELECT XMLTABLE(XMLNAMESPACES('...' AS x, '...' AS "B"), '...' PASSING (SELECT data FROM xmldata) COLUMNS foo int PATH '...'); foo IS DOCUMENT foo IS NOT DOCUMENT diff --git a/test/markup/pony/control-flow.expect.txt b/test/markup/pony/control-flow.expect.txt index 55e6d245fe..82f0187b62 100644 --- a/test/markup/pony/control-flow.expect.txt +++ b/test/markup/pony/control-flow.expect.txt @@ -1,9 +1,9 @@ if a == b and b == a then - env.out.print("they are the same") + env.out.print("they are the same") elseif a > b or b < a then - env.out.print("a is bigger") + env.out.print("a is bigger") else - env.out.print("b bigger") + env.out.print("b bigger") end while count <= 10 do @@ -11,11 +11,11 @@ count = count + 1 end -for name in ["Bob"; "Fred"; "Sarah"].values() do +for name in ["Bob"; "Fred"; "Sarah"].values() do env.out.print(name) end repeat - env.out.print("hello!") + env.out.print("hello!") counter = counter + 1 until counter > 7 end \ No newline at end of file diff --git a/test/markup/pony/lambda.expect.txt b/test/markup/pony/lambda.expect.txt index 543b1e1baf..044982ffcf 100644 --- a/test/markup/pony/lambda.expect.txt +++ b/test/markup/pony/lambda.expect.txt @@ -1 +1 @@ -{(foo: I32)(bar): String => (foo + bar).string()} +{(foo: I32)(bar): String => (foo + bar).string()} \ No newline at end of file diff --git a/test/markup/pony/match.expect.txt b/test/markup/pony/match.expect.txt index 44f23e37c2..55800ddcae 100644 --- a/test/markup/pony/match.expect.txt +++ b/test/markup/pony/match.expect.txt @@ -1,8 +1,8 @@ match foo -| true => "it's true" -| "bar" => "it's bar" -| let x: I32 if x > 3 => "it's greater than 3" -| let x: I32 => "it's less than or equal to 3" +| true => "it's true" +| "bar" => "it's bar" +| let x: I32 if x > 3 => "it's greater than 3" +| let x: I32 => "it's less than or equal to 3" else -"I don't know what it is" +"I don't know what it is" end \ No newline at end of file diff --git a/test/markup/pony/method.expect.txt b/test/markup/pony/method.expect.txt index f4418b570e..f6a788a14e 100644 --- a/test/markup/pony/method.expect.txt +++ b/test/markup/pony/method.expect.txt @@ -1,5 +1,5 @@ fun foo(bar: String): String => - bar + "baz" + bar + "baz" new create(hunger: I32) => _hunger = hunger diff --git a/test/markup/pony/prime.expect.txt b/test/markup/pony/prime.expect.txt index 1e4cbc89b2..c85a44f318 100644 --- a/test/markup/pony/prime.expect.txt +++ b/test/markup/pony/prime.expect.txt @@ -1,2 +1,2 @@ -new create(name': String) => - name = name' + 'a' \ No newline at end of file +new create(name': String) => + name = name' + 'a' diff --git a/test/markup/pony/triple-quote.expect.txt b/test/markup/pony/triple-quote.expect.txt index 9d862f4b93..806fe01d35 100644 --- a/test/markup/pony/triple-quote.expect.txt +++ b/test/markup/pony/triple-quote.expect.txt @@ -1,5 +1,5 @@ -""" +""" A triple quoted string * Goes several lines * Keeps formatting -""" \ No newline at end of file +""" \ No newline at end of file diff --git a/test/markup/powershell/apos-herestring.expect.txt b/test/markup/powershell/apos-herestring.expect.txt index 8323231d05..b0f9c0154f 100644 --- a/test/markup/powershell/apos-herestring.expect.txt +++ b/test/markup/powershell/apos-herestring.expect.txt @@ -1,11 +1,11 @@ -@' The wild cat jumped over the $height-tall fence. +@' The wild cat jumped over the $height-tall fence. He did so with grace. -'@ +'@ This SHOULDNT be a part of the above strings span. -@' The wild cat jumped over the $height-tall fence. +@' The wild cat jumped over the $height-tall fence. He did so with grace. -break-end-of-string'@ +break-end-of-string'@ This SHOULD be a part of the above strings span. \ No newline at end of file diff --git a/test/markup/powershell/classes.expect.txt b/test/markup/powershell/classes.expect.txt index c1adb1ff57..694ebec75b 100644 --- a/test/markup/powershell/classes.expect.txt +++ b/test/markup/powershell/classes.expect.txt @@ -4,7 +4,7 @@ [string]$VendorSku [string]ToString(){ - return ("{0}|{1}|{2}" -f $this.Brand, $this.Model, $this.VendorSku) + return ("{0}|{1}|{2}" -f $this.Brand, $this.Model, $this.VendorSku) } } @@ -47,9 +47,9 @@ $rack = [Rack]::new() $surface = [Device]::new() -$surface.Brand = "Microsoft" -$surface.Model = "Surface Pro 4" -$surface.VendorSku = "5072641000" +$surface.Brand = "Microsoft" +$surface.Model = "Surface Pro 4" +$surface.VendorSku = "5072641000" $rack.AddDevice($surface, 2) diff --git a/test/markup/powershell/misc.expect.txt b/test/markup/powershell/misc.expect.txt index e1e3070b0c..cfe5a438de 100644 --- a/test/markup/powershell/misc.expect.txt +++ b/test/markup/powershell/misc.expect.txt @@ -14,16 +14,16 @@ ogg = 15 } -"def" -notin "abc", "def" -"Sunday" -notmatch "rain" -"Good Dog" -match "Dog" +"def" -notin "abc", "def" +"Sunday" -notmatch "rain" +"Good Dog" -match "Dog" 2 -eq 2 -"abc" -ne "def" +"abc" -ne "def" $hash = @{ - SomeKey = 'SomeValue' - SomeKey2 = 'SomeValue2' - SomeKey3 = 'SomeValue3' + SomeKey = 'SomeValue' + SomeKey2 = 'SomeValue2' + SomeKey3 = 'SomeValue3' } $client = New-Object System.Net.WebClient @@ -32,4 +32,4 @@ $notepad = Get-Process notepad $notepad.Kill() -'this is rocket science'.Replace('rocket', 'rock') +'this is rocket science'.Replace('rocket', 'rock') diff --git a/test/markup/powershell/quote-herestring.expect.txt b/test/markup/powershell/quote-herestring.expect.txt index 309501508c..4de6a6b6ad 100644 --- a/test/markup/powershell/quote-herestring.expect.txt +++ b/test/markup/powershell/quote-herestring.expect.txt @@ -1,11 +1,11 @@ -@" The wild cat jumped over the $height-tall fence. +@" The wild cat jumped over the $height-tall fence. He did so with grace. -"@ +"@ This SHOULDNT be a part of the above strings span. -@" The wild cat jumped over the $height-tall fence. +@" The wild cat jumped over the $height-tall fence. He did so with grace. -break-end-of-string"@ +break-end-of-string"@ This SHOULD be a part of the above strings span. \ No newline at end of file diff --git a/test/markup/python-repl/sample.expect.txt b/test/markup/python-repl/sample.expect.txt index 6693b43cf9..b4d5b45928 100644 --- a/test/markup/python-repl/sample.expect.txt +++ b/test/markup/python-repl/sample.expect.txt @@ -1,16 +1,16 @@ ->>> v = "foo = 42" +>>> v = "foo = 42" >>> v -"foo = 42" +"foo = 42" >>> print(v) foo = 42 ->>> print(repr(v).rstrip('"')) -"foo = 42 ->>> print(repr(v).lstrip('"')) -foo = 42" +>>> print(repr(v).rstrip('"')) +"foo = 42 +>>> print(repr(v).lstrip('"')) +foo = 42" ->>> """ +>>> """ ... abc -... """ +... """ >>> def test(): ... pass >>> diff --git a/test/markup/python/escaped-quotes.expect.txt b/test/markup/python/escaped-quotes.expect.txt index baabb66e26..9afa43acc8 100644 --- a/test/markup/python/escaped-quotes.expect.txt +++ b/test/markup/python/escaped-quotes.expect.txt @@ -1,43 +1,43 @@ -'''text \''' text''' -u'''text \''' text''' -b'''text \''' text''' -r'''text \''' text''' -ur'''text \''' text''' -br'''text \''' text''' - -"""text \""" text""" -u"""text \""" text""" -b"""text \""" text""" -r"""text \""" text""" -ur"""text \""" text""" -br"""text \""" text""" - -f'''text \''' text''' -fr'''text \''' text''' -rf'''text \''' text''' - -f"""text \""" text""" -fr"""text \""" text""" -rf"""text \""" text""" - -u'text \' text' -r'text \' text' -ur'text \' text' - -u"text \" text" -r"text \" text" -ur"text \" text" - -b'text \' text' -br'text \' text' - -b"text \" text" -br"text \" text" - -f'text \' text' -fr'text \' text' -rf'text \' text' - -f"text \" text" -fr"text \" text" -rf"text \" text" \ No newline at end of file +'''text \''' text''' +u'''text \''' text''' +b'''text \''' text''' +r'''text \''' text''' +ur'''text \''' text''' +br'''text \''' text''' + +"""text \""" text""" +u"""text \""" text""" +b"""text \""" text""" +r"""text \""" text""" +ur"""text \""" text""" +br"""text \""" text""" + +f'''text \''' text''' +fr'''text \''' text''' +rf'''text \''' text''' + +f"""text \""" text""" +fr"""text \""" text""" +rf"""text \""" text""" + +u'text \' text' +r'text \' text' +ur'text \' text' + +u"text \" text" +r"text \" text" +ur"text \" text" + +b'text \' text' +br'text \' text' + +b"text \" text" +br"text \" text" + +f'text \' text' +fr'text \' text' +rf'text \' text' + +f"text \" text" +fr"text \" text" +rf"text \" text" \ No newline at end of file diff --git a/test/markup/python/f-strings.expect.txt b/test/markup/python/f-strings.expect.txt index 8d9bcdac41..904a3a4a38 100644 --- a/test/markup/python/f-strings.expect.txt +++ b/test/markup/python/f-strings.expect.txt @@ -1,13 +1,13 @@ -f'{name}' -f"{name + 5}" ->>> f""" +f'{name}' +f"{name + 5}" +>>> f""" ... { ... name ... } -... """ -rf"{name}" -fr"{name}" -f"{name + f'{name}'}" -f"{{ }}" -if"text"=="text": - "good" +... """ +rf"{name}" +fr"{name}" +f"{name + f'{name}'}" +f"{{ }}" +if"text"=="text": + "good" diff --git a/test/markup/python/function-header-comments.expect.txt b/test/markup/python/function-header-comments.expect.txt index 4ebe4aaad6..061a1a4742 100644 --- a/test/markup/python/function-header-comments.expect.txt +++ b/test/markup/python/function-header-comments.expect.txt @@ -4,7 +4,7 @@ pass -class Foo(collections.namedtuple('Test'), ( - 'name', # comment +class Foo(collections.namedtuple('Test'), ( + 'name', # comment )): pass diff --git a/test/markup/reasonml/functions.expect.txt b/test/markup/reasonml/functions.expect.txt index bd4ad81b5a..ff3fd1674c 100644 --- a/test/markup/reasonml/functions.expect.txt +++ b/test/markup/reasonml/functions.expect.txt @@ -1,7 +1,7 @@ /* This is a simple function */ -let greet = (name) => "Hello World"; +let greet = (name) => "Hello World"; -let body = `Plain("uploaded " ++ cacheServiceConfig.desc ++ "configuration data into cache on S3"); +let body = `Plain("uploaded " ++ cacheServiceConfig.desc ++ "configuration data into cache on S3"); let getCacheConfigByEnv = ( @@ -11,12 +11,12 @@ switch (cacheServiceConfig) { | Some(config) => config | None => - raise(InvalidEnvironment("Caching Service Coinfiguration is missing")) + raise(InvalidEnvironment("Caching Service Coinfiguration is missing")) }; let readCacheServiceConfigAndDecode = (configJson) => switch (configJson |> Js.Json.decodeObject) { - | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) + | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) | Some(data) => data |> Js.Dict.map((. json) => CachingServiceConfig.decode(json)) }; \ No newline at end of file diff --git a/test/markup/reasonml/literals.expect.txt b/test/markup/reasonml/literals.expect.txt index ac88232475..0f10a165bc 100644 --- a/test/markup/reasonml/literals.expect.txt +++ b/test/markup/reasonml/literals.expect.txt @@ -33,9 +33,9 @@ let b = [item1, item2, ...theRest]; let () = ignore(b); -let str = "a" ++ "b"; +let str = "a" ++ "b"; -let c = 'a'; -let c = '\xFF'; -let c = '\128'; -let c = '\n'; \ No newline at end of file +let c = 'a'; +let c = '\xFF'; +let c = '\128'; +let c = '\n'; \ No newline at end of file diff --git a/test/markup/reasonml/modules.expect.txt b/test/markup/reasonml/modules.expect.txt index cff5a61ae8..b0215be612 100644 --- a/test/markup/reasonml/modules.expect.txt +++ b/test/markup/reasonml/modules.expect.txt @@ -1,9 +1,9 @@ let decode = json => Json.Decode.{ - query: json |> field("query", string), - cacheKey: json |> field("cacheKey", string), - desc: json |> field("desc", string), - lambda: json |> field("lambda", string), + query: json |> field("query", string), + cacheKey: json |> field("cacheKey", string), + desc: json |> field("desc", string), + lambda: json |> field("lambda", string), }; Some.Bucket.Of.( diff --git a/test/markup/reasonml/pattern-matching.expect.txt b/test/markup/reasonml/pattern-matching.expect.txt index 8ce0a3d46d..ab30ca00dd 100644 --- a/test/markup/reasonml/pattern-matching.expect.txt +++ b/test/markup/reasonml/pattern-matching.expect.txt @@ -1,20 +1,20 @@ let message = switch (person1) { - | School.Teacher => "Hello teacher!" - | School.Director => "Hello director!" + | School.Teacher => "Hello teacher!" + | School.Director => "Hello director!" }; let message = School.( switch (person1) { - | Teacher => "Hello teacher!" - | Director => "Hello director!" + | Teacher => "Hello teacher!" + | Director => "Hello director!" } ); let readCacheServiceConfigAndDecode = (configJson) => switch (configJson |> Js.Json.decodeObject) { - | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) + | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) | Some(data) => data |> Js.Dict.map((. json) => CachingServiceConfig.decode(json)) - }; \ No newline at end of file + }; diff --git a/test/markup/ruby/gemfile.expect.txt b/test/markup/ruby/gemfile.expect.txt index 6051fc8b09..3bab8807ce 100644 --- a/test/markup/ruby/gemfile.expect.txt +++ b/test/markup/ruby/gemfile.expect.txt @@ -1,3 +1,3 @@ -gem "gem_name1", ">= 4.1" +gem "gem_name1", ">= 4.1" -gem "gem_name2", "~> 4.1" +gem "gem_name2", "~> 4.1" diff --git a/test/markup/ruby/heredoc.expect.txt b/test/markup/ruby/heredoc.expect.txt index df3433066b..d03b1d5c46 100644 --- a/test/markup/ruby/heredoc.expect.txt +++ b/test/markup/ruby/heredoc.expect.txt @@ -12,4 +12,4 @@ <h4>#{bar}</h4> </div> FOO -end +end \ No newline at end of file diff --git a/test/markup/ruby/prompt.expect.txt b/test/markup/ruby/prompt.expect.txt index b4634e61e0..0fff8272a8 100644 --- a/test/markup/ruby/prompt.expect.txt +++ b/test/markup/ruby/prompt.expect.txt @@ -1,11 +1,11 @@ -2.0.0p0 :001 > ['some'] - => ["some"] +2.0.0p0 :001 > ['some'] + => ["some"] 2.0.0p0 :002 > if true -2.0.0p0 :003?> "yop" +2.0.0p0 :003?> "yop" 2.0.0p0 :004?> end - => "yop" + => "yop" -jruby-1.7.16 :001 > "RVM-Format" +jruby-1.7.16 :001 > "RVM-Format" >> obj = OpenStruct.new :integer => 987, :symbol => :so_great => #<OpenStruct integer=987, symbol=:so_great> @@ -14,10 +14,10 @@ >> {1 => obj, 2 => obj} => {1=>#<OpenStruct integer=987, symbol=:so_great>, 2=>#<OpenStruct integer=987, symbol=:so_great>} >> if 10 > 20 ->> "YEAH" +>> "YEAH" >> else -?> "NO" +?> "NO" >> end -=> "NO" +=> "NO" irb(main):002:0> test = 1 diff --git a/test/markup/rust/strings.expect.txt b/test/markup/rust/strings.expect.txt index c36dd7cbff..3303abfcd2 100644 --- a/test/markup/rust/strings.expect.txt +++ b/test/markup/rust/strings.expect.txt @@ -1,14 +1,14 @@ -'a'; -'\n'; -'\x1A'; -'\u12AS'; -'\U1234ASDF'; -b'a'; +'a'; +'\n'; +'\x1A'; +'\u12AS'; +'\U1234ASDF'; +b'a'; -"hello"; -b"hello"; +"hello"; +b"hello"; -r"hello"; -r###"world"###; -r##" "### -"# "##; +r"hello"; +r###"world"###; +r##" "### +"# "##; diff --git a/test/markup/scheme/quoted.expect.txt b/test/markup/scheme/quoted.expect.txt index a5bb8a86b9..750425a5c0 100644 --- a/test/markup/scheme/quoted.expect.txt +++ b/test/markup/scheme/quoted.expect.txt @@ -1 +1 @@ -(scheme 'a '(a quoted (list)) `(quoted)) +(scheme 'a '(a quoted (list)) `(quoted)) diff --git a/test/markup/sql/interval.expect.txt b/test/markup/sql/interval.expect.txt index 77073bf2a9..fa32487be7 100644 --- a/test/markup/sql/interval.expect.txt +++ b/test/markup/sql/interval.expect.txt @@ -6,12 +6,12 @@ + INTERVAL 10 HOURS + interval 30 MINUTES - INTERVAL 20 SECOND AS past_timestamp -FROM VALUES ("dummy"); +FROM VALUES ("dummy"); WITH ts AS ( - SELECT CURRENT_TIMESTAMP AS now FROM VALUES ('dummy') + SELECT CURRENT_TIMESTAMP AS now FROM VALUES ('dummy') ) SELECT now - INTERVAL 1 DAY - INTERVAL 2 HOURS - INTERVAL 3 MINUTES - INTERVAL 4 SECONDS AS LONG_VERSION, - now - INTERVAL '1 2:3:4.100' DAY TO SECOND AS SHORT_VERSION + now - INTERVAL '1 2:3:4.100' DAY TO SECOND AS SHORT_VERSION FROM ts; diff --git a/test/markup/sql/numeric-types.expect.txt b/test/markup/sql/numeric-types.expect.txt index 2f5e0350e3..4098cd8c0c 100644 --- a/test/markup/sql/numeric-types.expect.txt +++ b/test/markup/sql/numeric-types.expect.txt @@ -1 +1 @@ -SELECT CAST(32768 AS TINYINT) FROM VALUES('dummy'); +SELECT CAST(32768 AS TINYINT) FROM VALUES('dummy'); diff --git a/test/markup/sql/string-types.expect.txt b/test/markup/sql/string-types.expect.txt index 340887eb60..97db6ddee4 100644 --- a/test/markup/sql/string-types.expect.txt +++ b/test/markup/sql/string-types.expect.txt @@ -1,5 +1,5 @@ -SELECT '\'; +SELECT '\'; -SELECT "\"; +SELECT "\"; SELECT `\`; diff --git a/test/markup/sql/values-statement.expect.txt b/test/markup/sql/values-statement.expect.txt index 91a0d6f3f6..8676dafc32 100644 --- a/test/markup/sql/values-statement.expect.txt +++ b/test/markup/sql/values-statement.expect.txt @@ -1,7 +1,7 @@ VALUES 1, 2 , 3; VALUES - (1, 'Spock'), - (2,'Kirk') , - (3, 'McCoy'), - (4,'Scotty'); + (1, 'Spock'), + (2,'Kirk') , + (3, 'McCoy'), + (4,'Scotty'); diff --git a/test/markup/stata/built_ins.expect.txt b/test/markup/stata/built_ins.expect.txt index c151c54fa3..caff6ae2f0 100644 --- a/test/markup/stata/built_ins.expect.txt +++ b/test/markup/stata/built_ins.expect.txt @@ -1,3 +1,3 @@ -local b1 = ln(`or') +local b1 = ln(`or') generate logit1 = log( pgty1 / ( 1 - pgty1)) generate logit2 = log( pgty2 / ( 1 - pgty2)) diff --git a/test/markup/swift/multiline-string.expect.txt b/test/markup/swift/multiline-string.expect.txt index 452c44be45..67880ae8cf 100644 --- a/test/markup/swift/multiline-string.expect.txt +++ b/test/markup/swift/multiline-string.expect.txt @@ -1,3 +1,3 @@ -var string = """ +var string = """ var a = not actually code -""" \ No newline at end of file +""" \ No newline at end of file diff --git a/test/markup/tap/yaml-block.expect.txt b/test/markup/tap/yaml-block.expect.txt index 056ad79100..ff15b82cd6 100644 --- a/test/markup/tap/yaml-block.expect.txt +++ b/test/markup/tap/yaml-block.expect.txt @@ -8,19 +8,19 @@ ok ok --- - message: "Board layout" + message: "Board layout" severity: comment dump: board: - - ' 16G 05C ' - - ' G N C C C G ' - - ' G C + ' - - '10C 01G 03C ' - - 'R N G G A G C C C ' - - ' R G C + ' - - ' 01G 17C 00C ' - - ' G A G G N R R N R ' - - ' G R G ' + - ' 16G 05C ' + - ' G N C C C G ' + - ' G C + ' + - '10C 01G 03C ' + - 'R N G G A G C C C ' + - ' R G C + ' + - ' 01G 17C 00C ' + - ' G A G G N R R N R ' + - ' G R G ' ... ok - board has 7 tiles + starter tile 1..9 diff --git a/test/markup/twig/filter_with_underscore.expect.txt b/test/markup/twig/filter_with_underscore.expect.txt index ec4ddb6c45..72c93fd877 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 }} +{{ "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 5016887343..56c6c07980 100644 --- a/test/markup/twig/template_tags.expect.txt +++ b/test/markup/twig/template_tags.expect.txt @@ -3,10 +3,10 @@ &lt;div&gt; {{ article.title|upper() }} - {# outputs 'WELCOME' #} + {# outputs 'WELCOME' #} &lt;/div&gt; {% endfor %} {% endif %} {% set user = json_encode(user) %} - + \ No newline at end of file diff --git a/test/markup/typescript/class.expect.txt b/test/markup/typescript/class.expect.txt index 41894432d7..b85c55bf67 100644 --- a/test/markup/typescript/class.expect.txt +++ b/test/markup/typescript/class.expect.txt @@ -2,7 +2,7 @@ constructor(speed, cost) { super(speed); - var c = Symbol('cost'); + var c = Symbol('cost'); this[c] = cost; this.intro = `This is a car runs at diff --git a/test/markup/typescript/decorator-factories.expect.txt b/test/markup/typescript/decorator-factories.expect.txt index 08582b39b0..d9532d9117 100644 --- a/test/markup/typescript/decorator-factories.expect.txt +++ b/test/markup/typescript/decorator-factories.expect.txt @@ -1,4 +1,4 @@ -@foo('foo') +@foo('foo') export class MyClass { @baz(123) private myAttribute: string; @@ -8,6 +8,6 @@ @bar() private myMethod(@bar() z) { - console.log('Hello world.'); + console.log('Hello world.'); } } \ No newline at end of file diff --git a/test/markup/typescript/functions.expect.txt b/test/markup/typescript/functions.expect.txt index d805a30c87..5c2595c296 100644 --- a/test/markup/typescript/functions.expect.txt +++ b/test/markup/typescript/functions.expect.txt @@ -23,3 +23,4 @@ const array = [1, 2, 3].reduce<number[]>((acc, next) => [...acc, next], []); const bad = ((a=2, b=5) => [...a, b]); sides.every((length,width=(3+2+(4/5))) => length > 0 ); + diff --git a/test/markup/typescript/inline-languages.expect.txt b/test/markup/typescript/inline-languages.expect.txt index da28efe79f..27e2c8f3cb 100644 --- a/test/markup/typescript/inline-languages.expect.txt +++ b/test/markup/typescript/inline-languages.expect.txt @@ -1,15 +1,15 @@ let foo = true; -`hello ${foo ? `Mr ${name}` : 'there'}`; +`hello ${foo ? `Mr ${name}` : 'there'}`; foo = false; -html`<div id="foo">Hello world</div>`; +html`<div id="foo">Hello world</div>`; -html`<div id="foo">Hello times ${10} <span id="bar">world</span></div>`; +html`<div id="foo">Hello times ${10} <span id="bar">world</span></div>`; html` - <ul id="list"> - ${repeat(['a', 'b', 'c'], (v) => { - return html`<li class="item">${v}</li>`; + <ul id="list"> + ${repeat(['a', 'b', 'c'], (v) => { + return html`<li class="item">${v}</li>`; }} </ul> `; @@ -20,5 +20,5 @@ css` } `; -// Ensure that we're back in TypeScript mode. +// Ensure that we're back in TypeScript mode. var foo = 10; diff --git a/test/markup/typescript/module-id.expect.txt b/test/markup/typescript/module-id.expect.txt index ae1092f68c..b7582e6559 100644 --- a/test/markup/typescript/module-id.expect.txt +++ b/test/markup/typescript/module-id.expect.txt @@ -1,7 +1,7 @@ @Component({ - selector: 'my-example', + selector: 'my-example', directives: [SomeDirective], - templateUrl: './my-example.component.html', + templateUrl: './my-example.component.html', moduleId: module.id, styles: [` .my-example { @@ -10,5 +10,5 @@ `] }) export class MyExampleComponent { - someProp: string = "blah"; -} + someProp: string = "blah"; +} \ No newline at end of file diff --git a/test/markup/typescript/nested-templates.expect.txt b/test/markup/typescript/nested-templates.expect.txt index fde5752e01..5f573b49ee 100644 --- a/test/markup/typescript/nested-templates.expect.txt +++ b/test/markup/typescript/nested-templates.expect.txt @@ -1,3 +1,3 @@ let foo = true; -`hello ${foo ? `Mr ${name}` : 'there'}`; +`hello ${foo ? `Mr ${name}` : 'there'}`; foo = false; diff --git a/test/markup/verilog/misc.expect.txt b/test/markup/verilog/misc.expect.txt index e665ae1b5c..6f94b4d856 100644 --- a/test/markup/verilog/misc.expect.txt +++ b/test/markup/verilog/misc.expect.txt @@ -23,12 +23,12 @@ // Simple gated up-counter with async clear always @(posedge clk or negedge arst_n) begin - if (arst_n == 1'b0) begin - q <= {WIDTH {1'b0}}; + if (arst_n == 1'b0) begin + q <= {WIDTH {1'b0}}; end else begin q <= q; - if (ce == 1'b1) begin + if (ce == 1'b1) begin q <= q + 1; end end diff --git a/test/markup/verilog/numbers.expect.txt b/test/markup/verilog/numbers.expect.txt index d29935fab9..10508320b8 100644 --- a/test/markup/verilog/numbers.expect.txt +++ b/test/markup/verilog/numbers.expect.txt @@ -1,8 +1,8 @@ -a = 'hff; -A = 'HFF; -b = 8'h33; -B = 8'H33; +a = 'hff; +A = 'HFF; +b = 8'h33; +B = 8'H33; c = 12; -d = 'o755; -e = 8'b1001_0001; -f = 8'b1111zzzx; +d = 'o755; +e = 8'b1001_0001; +f = 8'b1111zzzx; diff --git a/test/markup/vim/strings-comments.expect.txt b/test/markup/vim/strings-comments.expect.txt index 77ba698f36..525bb4adda 100644 --- a/test/markup/vim/strings-comments.expect.txt +++ b/test/markup/vim/strings-comments.expect.txt @@ -1,4 +1,4 @@ -" comment -let one = "string" " comment -let two = "crazy -\ string with a \" quote" +" comment +let one = "string" " comment +let two = "crazy +\ string with a \" quote" diff --git a/test/markup/xml/document-type-variations.expect.txt b/test/markup/xml/document-type-variations.expect.txt index 82c1cd5180..74b8ee225a 100644 --- a/test/markup/xml/document-type-variations.expect.txt +++ b/test/markup/xml/document-type-variations.expect.txt @@ -1,17 +1,17 @@ -<!DOCTYPE svg PUBLIC " -//W3C//DTD SVG 1.1 Basic//EN " ' http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd ' > -<!DOCTYPE svg PUBLIC"-//W3C//DTD SVG 1.1 Basic//EN"'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd'> +<!DOCTYPE svg PUBLIC " -//W3C//DTD SVG 1.1 Basic//EN " ' http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd ' > +<!DOCTYPE svg PUBLIC"-//W3C//DTD SVG 1.1 Basic//EN"'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd'> <!DOCTYPE note [ -<!ENTITY nbsp '&#xA0;'> -<!ENTITY pound '&#xA3;'> -<!ENTITY writer_person " Writer: Donald Duck. "> -<!ENTITY copyright "Copyright: Walt Disney Company."> +<!ENTITY nbsp '&#xA0;'> +<!ENTITY pound '&#xA3;'> +<!ENTITY writer_person " Writer: Donald Duck. "> +<!ENTITY copyright "Copyright: Walt Disney Company."> ]> -<!ENTITY nbsp ' &#xA0; '> -<!ENTITY pound '&#xA3;'> -<!ENTITY writer_person " Writer: Donald Duck. "> -<!ENTITY copyright "Copyright: Walt Disney Company."> +<!ENTITY nbsp ' &#xA0; '> +<!ENTITY pound '&#xA3;'> +<!ENTITY writer_person " Writer: Donald Duck. "> +<!ENTITY copyright "Copyright: Walt Disney Company."> <!DOCTYPE bookstore [ <!ELEMENT bookstore (book*)> diff --git a/test/markup/xml/space-attributes.expect.txt b/test/markup/xml/space-attributes.expect.txt index 560fc8716c..da323ab055 100644 --- a/test/markup/xml/space-attributes.expect.txt +++ b/test/markup/xml/space-attributes.expect.txt @@ -1,3 +1,3 @@ -<img src ="/pics/foo.jpg"> -<img src= "/pics/foo.jpg"> -<img src = "/pics/foo.jpg"> +<img src ="/pics/foo.jpg"> +<img src= "/pics/foo.jpg"> +<img src = "/pics/foo.jpg"> diff --git a/test/markup/xml/unquoted-attributes.expect.txt b/test/markup/xml/unquoted-attributes.expect.txt index 621a51f6fc..98d69e8a02 100644 --- a/test/markup/xml/unquoted-attributes.expect.txt +++ b/test/markup/xml/unquoted-attributes.expect.txt @@ -1,9 +1,9 @@ -<img src="/pics/foo.jpg"> -<img src='/pics/foo.jpg'> +<img src="/pics/foo.jpg"> +<img src='/pics/foo.jpg'> <img src=/pics/foo.jpg> <img src=/pics/> <img src=/pics /> -<img alt=''/> +<img alt=''/> <img alt/> -<img alt=''> +<img alt=''> <img alt> diff --git a/test/markup/xquery/computed_inbuilt.expect.txt b/test/markup/xquery/computed_inbuilt.expect.txt index a902c95d5a..a6633178aa 100644 --- a/test/markup/xquery/computed_inbuilt.expect.txt +++ b/test/markup/xquery/computed_inbuilt.expect.txt @@ -1,9 +1,9 @@ -xquery version "3.1"; +xquery version "3.1"; let $root := element {fn:node-name($e)} {$e/@*, 2 * fn:data($e)} for $node in root($root) return - element root { root ($node)/text(), attribute root {'root'}, -element not-root{attribute type{"root"}, root($root)} + element root { root ($node)/text(), attribute root {'root'}, +element not-root{attribute type{"root"}, root($root)} } diff --git a/test/markup/xquery/direct_method.expect.txt b/test/markup/xquery/direct_method.expect.txt index 34b756fdd1..591d9f5faf 100644 --- a/test/markup/xquery/direct_method.expect.txt +++ b/test/markup/xquery/direct_method.expect.txt @@ -1,12 +1,12 @@ -xquery version "3.1"; -let $var := <root n="x1">"rooting" out 1 or 2 root causes</root> +xquery version "3.1"; +let $var := <root n="x1">"rooting" out 1 or 2 root causes</root> return - <result name="test"> + <result name="test"> disable highlight for a name such as root { for $name in $var return $name as xs:string } return to unhighlighted order of things. - <test type="{$name}">"rooting" out root causes</test> + <test type="{$name}">"rooting" out root causes</test> </result> diff --git a/test/markup/xquery/function_body.expect.txt b/test/markup/xquery/function_body.expect.txt index a8eb56b69b..fa97b46f3f 100644 --- a/test/markup/xquery/function_body.expect.txt +++ b/test/markup/xquery/function_body.expect.txt @@ -2,7 +2,7 @@ for $n in $node return element div { switch($n) - case 'abc' return 'OK' + case 'abc' return 'OK' default return 2 } }; diff --git a/test/markup/xquery/prolog_declarations.expect.txt b/test/markup/xquery/prolog_declarations.expect.txt index 08f101c7b3..3aed0b60eb 100644 --- a/test/markup/xquery/prolog_declarations.expect.txt +++ b/test/markup/xquery/prolog_declarations.expect.txt @@ -1,18 +1,18 @@ -xquery version "3.1"; +xquery version "3.1"; (:~ : @author Duncan Paterson : @version 1.0:) -module namespace app="http://none"; +module namespace app="http://none"; -import module namespace config="http://config" at "config.xqm"; (: schema :) +import module namespace config="http://config" at "config.xqm"; (: schema :) declare copy-namespaces no-preserve, inherit; (: switch to preserve, no-inherit:) declare %private variable $app:maxItems := 12; -declare context item := doc("catalog.xml"); +declare context item := doc("catalog.xml"); declare %templates:wrap-all function app:helloworld($node as node(), $model as map(*), $name as xs:string?) { if ($name) then diff --git a/test/markup/yaml/keys.expect.txt b/test/markup/yaml/keys.expect.txt index e5fb704eee..4d996f5894 100644 --- a/test/markup/yaml/keys.expect.txt +++ b/test/markup/yaml/keys.expect.txt @@ -7,11 +7,11 @@ some key: another key: value -"some key": - "another key": value +"some key": + "another key": value -'some key': - 'another key': value +'some key': + 'another key': value some-key: another-key: value diff --git a/test/markup/yaml/numbers.expect.txt b/test/markup/yaml/numbers.expect.txt index eefd3eaea6..2454a1fc4c 100644 --- a/test/markup/yaml/numbers.expect.txt +++ b/test/markup/yaml/numbers.expect.txt @@ -8,4 +8,3 @@ space: 2001-12-14 21:59:43.10 -5 nozone: 2001-12-15 2:59:43.10 date: 2002-12-14 - diff --git a/test/markup/yaml/string.expect.txt b/test/markup/yaml/string.expect.txt index 4980e5c938..84899f239b 100644 --- a/test/markup/yaml/string.expect.txt +++ b/test/markup/yaml/string.expect.txt @@ -1,6 +1,6 @@ key: value -key: 'some value' -key: "some value" +key: 'some value' +key: "some value" key: | multi-string value diff --git a/test/markup/yaml/tag.expect.txt b/test/markup/yaml/tag.expect.txt index 87168452e3..d777a9b7ac 100644 --- a/test/markup/yaml/tag.expect.txt +++ b/test/markup/yaml/tag.expect.txt @@ -1,7 +1,7 @@ key: !!builtintagname test key: !localtagname test -key: "!notatag" -key: '!!notatageither' +key: "!notatag" +key: '!!notatageither' key: !!python/dict test key: !!python/name:module.name test key: !foo2.bar test diff --git a/test/markup/zephir/default.expect.txt b/test/markup/zephir/default.expect.txt index 099d29299a..afd8b2e3fc 100644 --- a/test/markup/zephir/default.expect.txt +++ b/test/markup/zephir/default.expect.txt @@ -28,7 +28,7 @@ // See fn is allowed like shortcut public fn method2() -> <Test> { - call_user_func(function() { echo "hello"; }); + call_user_func(function() { echo "hello"; }); [1, 2, 3, 4, 5]->walk( From 3ff516994fc799f58220e21b5bec5c1e69041d19 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 22 May 2020 09:06:44 -0400 Subject: [PATCH 111/816] (docs) add changelog entry for last PR --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 275f9033cc..3009eaf442 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Parser Engine: +- (parser) Now escapes quotes in text content when escaping HTML (#2564) [Josh Goebel][] - (parser) Adds `keywords.$pattern` key to grammar definitions (#2519) [Josh Goebel][] - (parser) Adds SHEBANG utility mode [Josh Goebel][] - (parser) Adds `registerAliases` method (#2540) [Taufik Nurrohman][] From f30dbf774a1cb4c9644b6e97b0b853812e434038 Mon Sep 17 00:00:00 2001 From: Jim Mason Date: Wed, 27 May 2020 04:16:47 +0100 Subject: [PATCH 112/816] add nnfx theme (#2571) --- AUTHORS.txt | 1 + CHANGES.md | 5 +++ src/styles/nnfx.css | 106 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 src/styles/nnfx.css diff --git a/AUTHORS.txt b/AUTHORS.txt index 799acc064a..bb8025bd75 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -286,3 +286,4 @@ Contributors: - G8t Guy - Samia Ali - Alexandre Grison +- Jim Mason diff --git a/CHANGES.md b/CHANGES.md index 3009eaf442..9390783d22 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ ## Version 10.1.0 (in progress) +New themes: + +- *NNFX* by [Jim Mason][] + Parser Engine: - (parser) Now escapes quotes in text content when escaping HTML (#2564) [Josh Goebel][] @@ -53,6 +57,7 @@ Language Improvements: [Sergey Prokhorov]: https://github.com/seriyps [Nils Knappmeier]: https://github.com/nknapp [Martin (Lhoerion)]: https://github.com/Lhoerion +[Jim Mason]: https://github.com/RocketMan ## Version 10.0.2 diff --git a/src/styles/nnfx.css b/src/styles/nnfx.css new file mode 100644 index 0000000000..e7beaa518a --- /dev/null +++ b/src/styles/nnfx.css @@ -0,0 +1,106 @@ +/** + * nnfx - a theme inspired by Netscape Navigator/Firefox + * + * @version 1.0.0 + * @author (c) 2020 Jim Mason + * @license https://creativecommons.org/licenses/by-sa/4.0 CC BY-SA 4.0 + */ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #fff; + color: #000; +} + +.xml .hljs-meta { + font-weight: bold; + font-style: italic; + color: #48b; +} + +.hljs-comment, +.hljs-quote { + font-style: italic; + color: #070; +} + +.hljs-name, +.hljs-keyword { + color: #808; +} + +.hljs-name, +.hljs-attr { + font-weight: bold; +} + +.hljs-string { + font-weight: normal; +} + +.hljs-variable, +.hljs-template-variable { + color: #477; +} + +.hljs-code, +.hljs-string, +.hljs-meta-string, +.hljs-number, +.hljs-regexp, +.hljs-link { + color: #00f; +} + +.hljs-title, +.hljs-symbol, +.hljs-bullet, +.hljs-built_in, +.hljs-builtin-name { + color: #f40; +} + +.hljs-section, +.hljs-meta { + color: #642; +} + +.hljs-class .hljs-title, +.hljs-type { + color: #639; +} + +.hljs-function .hljs-title, +.hljs-attr, +.hljs-subst { + color: #000; +} + +.hljs-formula { + background-color: #eee; + font-style: italic; +} + +.hljs-addition { + background-color: #beb; +} + +.hljs-deletion { + background-color: #fbb; +} + +.hljs-selector-id, +.hljs-selector-class { + color: #964; +} + +.hljs-doctag, +.hljs-strong { + font-weight: bold; +} + +.hljs-emphasis { + font-style: italic; +} From 87a338b0a1e99976fe5c0c8f6ec7cb224765719e Mon Sep 17 00:00:00 2001 From: lioshi Date: Fri, 29 May 2020 17:21:58 +0200 Subject: [PATCH 113/816] (themes) Add new lioshi theme (#2581) --- AUTHORS.txt | 1 + CHANGES.md | 2 + src/styles/lioshi.css | 88 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 src/styles/lioshi.css diff --git a/AUTHORS.txt b/AUTHORS.txt index bb8025bd75..131f873ad8 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -287,3 +287,4 @@ Contributors: - Samia Ali - Alexandre Grison - Jim Mason +- lioshi diff --git a/CHANGES.md b/CHANGES.md index 9390783d22..09c82dbdd2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ New themes: - *NNFX* by [Jim Mason][] +- *lioshi* by [lioshi][] Parser Engine: @@ -58,6 +59,7 @@ Language Improvements: [Nils Knappmeier]: https://github.com/nknapp [Martin (Lhoerion)]: https://github.com/Lhoerion [Jim Mason]: https://github.com/RocketMan +[lioshi]: https://github.com/lioshi ## Version 10.0.2 diff --git a/src/styles/lioshi.css b/src/styles/lioshi.css new file mode 100644 index 0000000000..594ac21556 --- /dev/null +++ b/src/styles/lioshi.css @@ -0,0 +1,88 @@ +/* lioshi Theme */ +/* Original theme - https://github.com/lioshi/vscode-lioshi-theme */ + +/* Comment */ +.hljs-comment { + color: #8d8d8d; +} + +/* quote */ +.hljs-quote { + color: #b3c7d8; +} + +/* Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-deletion { + color: #cc6666; +} + +/* Orange */ +.hljs-number, +.hljs-built_in, +.hljs-builtin-name, +.hljs-literal, +.hljs-type, +.hljs-subst +.hljs-link { + color: #de935f; +} + +/* Yellow */ +.hljs-attribute { + color: #f0c674; +} + +/* Green */ +.hljs-string, +.hljs-bullet, +.hljs-params, +.hljs-addition { + color: #b5bd68; +} + +/* Blue */ +.hljs-title, +.hljs-meta, +.hljs-section { + color: #81a2be; +} + +/* Purple */ +.hljs-selector-tag, +.hljs-keyword, +.hljs-function, +.hljs-class { + color: #be94bb; +} + +/* Purple light */ +.hljs-symbol { + color: #dbc4d9; +} + +.hljs { + display: block; + overflow-x: auto; + background: #303030; + color: #c5c8c6; + padding: 0.5em; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + + + + From debfdf7cc9822a49e7f033b2c286ef025ce8d3c8 Mon Sep 17 00:00:00 2001 From: BMatheas <65114274+BMatheas@users.noreply.github.com> Date: Mon, 1 Jun 2020 01:57:54 +0200 Subject: [PATCH 114/816] Added Cisco Command Line to SUPPORTED_LANGUAGES.md (#2583) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index f770664596..482595f134 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -41,6 +41,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | CSS | css | | | Cap’n Proto | capnproto, capnp | | | Chaos | chaos, kaos | [highlightjs-chaos](https://github.com/chaos-lang/highlightjs-chaos) | +| Cisco CLI | cisco | [highlightjs-cisco-cli](https://github.com/BMatheas/highlightjs-cisco-cli) | | Clojure | clojure, clj | | | CoffeeScript | coffeescript, coffee, cson, iced | | | CpcdosC+ | cpc | [highlightjs-cpcdos](https://github.com/SPinti-Software/highlightjs-cpcdos) | From c4c9772a45bc5d91046efa89d3901849bac99f1b Mon Sep 17 00:00:00 2001 From: Jim Mason Date: Mon, 1 Jun 2020 19:42:15 +0100 Subject: [PATCH 115/816] (themes) add `nnfx-dark` theme (#2584) --- CHANGES.md | 2 +- src/styles/nnfx-dark.css | 106 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 src/styles/nnfx-dark.css diff --git a/CHANGES.md b/CHANGES.md index 09c82dbdd2..655d4dec8d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ New themes: -- *NNFX* by [Jim Mason][] +- *NNFX* and *NNFX-dark* by [Jim Mason][] - *lioshi* by [lioshi][] Parser Engine: diff --git a/src/styles/nnfx-dark.css b/src/styles/nnfx-dark.css new file mode 100644 index 0000000000..0751ee5d99 --- /dev/null +++ b/src/styles/nnfx-dark.css @@ -0,0 +1,106 @@ +/** + * nnfx dark - a theme inspired by Netscape Navigator/Firefox + * + * @version 1.0.0 + * @author (c) 2020 Jim Mason + * @license https://creativecommons.org/licenses/by-sa/4.0 CC BY-SA 4.0 + */ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #333; + color: #fff; +} + +.xml .hljs-meta { + font-weight: bold; + font-style: italic; + color: #69f; +} + +.hljs-comment, +.hljs-quote { + font-style: italic; + color: #9c6; +} + +.hljs-name, +.hljs-keyword { + color: #a7a; +} + +.hljs-name, +.hljs-attr { + font-weight: bold; +} + +.hljs-string { + font-weight: normal; +} + +.hljs-variable, +.hljs-template-variable { + color: #588; +} + +.hljs-code, +.hljs-string, +.hljs-meta-string, +.hljs-number, +.hljs-regexp, +.hljs-link { + color: #bce; +} + +.hljs-title, +.hljs-symbol, +.hljs-bullet, +.hljs-built_in, +.hljs-builtin-name { + color: #d40; +} + +.hljs-section, +.hljs-meta { + color: #a85; +} + +.hljs-class .hljs-title, +.hljs-type { + color: #96c; +} + +.hljs-function .hljs-title, +.hljs-attr, +.hljs-subst { + color: #fff; +} + +.hljs-formula { + background-color: #eee; + font-style: italic; +} + +.hljs-addition { + background-color: #797; +} + +.hljs-deletion { + background-color: #c99; +} + +.hljs-selector-id, +.hljs-selector-class { + color: #964; +} + +.hljs-doctag, +.hljs-strong { + font-weight: bold; +} + +.hljs-emphasis { + font-style: italic; +} From 1bfe83475bd09566b73fdc69992a37eb294365a5 Mon Sep 17 00:00:00 2001 From: Pavel Evstigneev Date: Mon, 8 Jun 2020 21:10:14 +0700 Subject: [PATCH 116/816] enh(protobuf) Support multiline comments (#2597) --- CHANGES.md | 2 ++ src/languages/protobuf.js | 1 + test/markup/protobuf/message-message.expect.txt | 6 ++++++ test/markup/protobuf/message-message.txt | 6 ++++++ 4 files changed, 15 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 655d4dec8d..dce2373af4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -47,6 +47,7 @@ Language Improvements: - enh(dart) Add `late` and `required` keywords, and `Never` built-in type (#2550) [Sam Rawlins][] - enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][] - enh(handlebars) Support for sub-expressions, path-expressions, hashes, block-parameters and literals (#2344) [Nils Knappmeier][] +- enh(protobuf) Support multiline comments (#2597) [Pavel Evstigneev][] [Josh Goebel]: https://github.com/yyyc514 [Peter Plantinga]: https://github.com/pplantinga @@ -60,6 +61,7 @@ Language Improvements: [Martin (Lhoerion)]: https://github.com/Lhoerion [Jim Mason]: https://github.com/RocketMan [lioshi]: https://github.com/lioshi +[Pavel Evstigneev]: https://github.com/Paxa ## Version 10.0.2 diff --git a/src/languages/protobuf.js b/src/languages/protobuf.js index bb73c78a81..d4bf4e1353 100644 --- a/src/languages/protobuf.js +++ b/src/languages/protobuf.js @@ -19,6 +19,7 @@ export default function(hljs) { hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE, hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE, { className: 'class', beginKeywords: 'message enum service', end: /\{/, diff --git a/test/markup/protobuf/message-message.expect.txt b/test/markup/protobuf/message-message.expect.txt index a2d827b6b2..ff5e780ebf 100644 --- a/test/markup/protobuf/message-message.expect.txt +++ b/test/markup/protobuf/message-message.expect.txt @@ -1,3 +1,4 @@ +// A Container message message Container { message Message { required int64 id = 1; @@ -5,3 +6,8 @@ repeated Message messages = 1; optional int32 number = 2; } + +/* + test multiline + comment +*/ \ No newline at end of file diff --git a/test/markup/protobuf/message-message.txt b/test/markup/protobuf/message-message.txt index c4b66670cc..050e2d3809 100644 --- a/test/markup/protobuf/message-message.txt +++ b/test/markup/protobuf/message-message.txt @@ -1,3 +1,4 @@ +// A Container message message Container { message Message { required int64 id = 1; @@ -5,3 +6,8 @@ message Container { repeated Message messages = 1; optional int32 number = 2; } + +/* + test multiline + comment +*/ From d8189c603d63b261d427a39b835707593d86af6f Mon Sep 17 00:00:00 2001 From: 0xflotus <0xflotus@gmail.com> Date: Mon, 8 Jun 2020 16:30:00 +0200 Subject: [PATCH 117/816] enh(java) added support for hexadecimal floating point literals (#2509) - Added support for many additional types of floating point literals - Added related tests There still may be a few gaps, but this is a pretty large improvement. Co-authored-by: Josh Goebel --- src/languages/java.js | 72 +++++++++++++++++++---------- src/lib/regex.js | 20 ++++++++ test/markup/java/numbers.expect.txt | 26 +++++++++++ test/markup/java/numbers.txt | 26 +++++++++++ 4 files changed, 119 insertions(+), 25 deletions(-) diff --git a/src/languages/java.js b/src/languages/java.js index f349a76ad0..45b314c1a3 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -5,11 +5,12 @@ Category: common, enterprise Website: https://www.java.com/ */ +import * as regex from "../lib/regex"; + export default function(hljs) { var JAVA_IDENT_RE = '[\u00C0-\u02B8a-zA-Z_$][\u00C0-\u02B8a-zA-Z_$0-9]*'; var GENERIC_IDENT_RE = JAVA_IDENT_RE + '(<' + JAVA_IDENT_RE + '(\\s*,\\s*' + JAVA_IDENT_RE + ')*>)?'; - var KEYWORDS = - 'false synchronized int abstract float private char boolean var static null if const ' + + var KEYWORDS = 'false synchronized int abstract float private char boolean var static null if const ' + 'for true while long strictfp finally protected import native final void ' + 'enum else break transient catch instanceof byte super volatile case assert short ' + 'package default double public try this switch continue throws protected public private ' + @@ -18,32 +19,53 @@ export default function(hljs) { var ANNOTATION = { className: 'meta', begin: '@' + JAVA_IDENT_RE, - contains:[ + contains: [ { begin: /\(/, end: /\)/, contains: ["self"] // allow nested () inside our annotation }, ] - } - // https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html - var JAVA_NUMBER_RE = '\\b' + - '(' + - '0[bB]([01]+[01_]+[01]+|[01]+)' + // 0b... - '|' + - '0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)' + // 0x... - '|' + - '(' + - '([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?' + - '|' + - '\\.([\\d]+[\\d_]+[\\d]+|[\\d]+)' + - ')' + - '([eE][-+]?\\d+)?' + // octal, decimal, float - ')' + - '[lLfF]?'; + }; + /** + * A given sequence, possibly with underscores + * @type {(s: string | RegExp) => string} */ + var SEQUENCE_ALLOWING_UNDERSCORES = (seq) => regex.concat('[', seq, ']+([', seq, '_]*[', seq, ']+)?'); var JAVA_NUMBER_MODE = { className: 'number', - begin: JAVA_NUMBER_RE, + variants: [ + { begin: `\\b(0[bB]${SEQUENCE_ALLOWING_UNDERSCORES('01')})[lL]?` }, // binary + { begin: `\\b(0${SEQUENCE_ALLOWING_UNDERSCORES('0-7')})[dDfFlL]?` }, // octal + { + begin: regex.concat( + /\b0[xX]/, + regex.either( + regex.concat(SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9'), /\./, SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9')), + regex.concat(SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9'), /\.?/), + regex.concat(/\./, SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9')), + ), + /([pP][+-]?(\d+))?/, + /[fFdDlL]?/ // decimal & fp mixed for simplicity + ) + }, + // scientific notation + { begin: regex.concat( + /\b/, + regex.either( + regex.concat(/\d*\./, SEQUENCE_ALLOWING_UNDERSCORES("\\d")), // .3, 3.3, 3.3_3 + SEQUENCE_ALLOWING_UNDERSCORES("\\d") // 3, 3_3 + ), + /[eE][+-]?[\d]+[dDfF]?/) + }, + // decimal & fp mixed for simplicity + { begin: regex.concat( + /\b/, + SEQUENCE_ALLOWING_UNDERSCORES(/\d/), + regex.optional(/\.?/), + regex.optional(SEQUENCE_ALLOWING_UNDERSCORES(/\d/)), + /[dDfFlL]?/) + } + ], relevance: 0 }; @@ -57,15 +79,15 @@ export default function(hljs) { '/\\*\\*', '\\*/', { - relevance : 0, - contains : [ + relevance: 0, + contains: [ { // eat up @'s in emails to prevent them to be recognized as doctags begin: /\w+@/, relevance: 0 }, { - className : 'doctag', - begin : '@[A-Za-z]+' + className: 'doctag', + begin: '@[A-Za-z]+' } ] } @@ -80,7 +102,7 @@ export default function(hljs) { keywords: 'class interface', illegal: /[:"\[\]]/, contains: [ - {beginKeywords: 'extends implements'}, + { beginKeywords: 'extends implements' }, hljs.UNDERSCORE_TITLE_MODE ] }, diff --git a/src/lib/regex.js b/src/lib/regex.js index 6f2a5967d9..53a9158ac7 100644 --- a/src/lib/regex.js +++ b/src/lib/regex.js @@ -25,6 +25,14 @@ export function lookahead(re) { return concat('(?=', re, ')'); } +/** + * @param {RegExp | string } re + * @returns {string} + */ +export function optional(re) { + return concat('(', re, ')?'); +} + /** * @param {...(RegExp | string) } args * @returns {string} @@ -34,6 +42,18 @@ export function concat(...args) { return joined; } +/** + * Any of the passed expresssions may match + * + * Creates a huge this | this | that | that match + * @param {(RegExp | string)[] } args + * @returns {string} + */ +export function either(...args) { + const joined = '(' + args.map((x) => source(x)).join("|") + ")"; + return joined; +} + /** * @param {RegExp} re * @returns {number} diff --git a/test/markup/java/numbers.expect.txt b/test/markup/java/numbers.expect.txt index 713579cf6f..7ba247f209 100644 --- a/test/markup/java/numbers.expect.txt +++ b/test/markup/java/numbers.expect.txt @@ -7,3 +7,29 @@ byte nybbles = 0b0010_0101; long bytes = 0b11010010_01101001_10010100_10010010; int n = 1234 + Contacts._ID; +float f = 0x1.4p2f; +double d = 0x.ep-6; +int octal = 0777; +float f = 2e3f; +double d = 1.2e4D; +a = 0x4fa6p2; +b = 0x.4p2; +c = 0xa.ffp3f; +d = 0x1.0p2F; +e = 0x1.0p2f; +f = 0x1p1; +g = 0x.3p4d; +h = 0x1.2ep5D; +i = 0x1.p2; +int i = 23; +byte mask = 0x0f; +int i = 4; +byte mask = 0xa; +float f = 5.4; +float f = 2e3; +int n = 0b1; +float f = 3.; +f = 3_3.; +// TODO: in the future +// float f = .2; +// f = .2_022; diff --git a/test/markup/java/numbers.txt b/test/markup/java/numbers.txt index f68a40c7ad..e31545f70e 100644 --- a/test/markup/java/numbers.txt +++ b/test/markup/java/numbers.txt @@ -7,3 +7,29 @@ long maxLong = 0x7fff_ffff_ffff_ffffL; byte nybbles = 0b0010_0101; long bytes = 0b11010010_01101001_10010100_10010010; int n = 1234 + Contacts._ID; +float f = 0x1.4p2f; +double d = 0x.ep-6; +int octal = 0777; +float f = 2e3f; +double d = 1.2e4D; +a = 0x4fa6p2; +b = 0x.4p2; +c = 0xa.ffp3f; +d = 0x1.0p2F; +e = 0x1.0p2f; +f = 0x1p1; +g = 0x.3p4d; +h = 0x1.2ep5D; +i = 0x1.p2; +int i = 23; +byte mask = 0x0f; +int i = 4; +byte mask = 0xa; +float f = 5.4; +float f = 2e3; +int n = 0b1; +float f = 3.; +f = 3_3.; +// TODO: in the future +// float f = .2; +// f = .2_022; From adb813c7221971d0094a779762ed0e2af639f556 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 8 Jun 2020 10:51:16 -0400 Subject: [PATCH 118/816] (chore) Update issue templates (#2574) Co-authored-by: Vladimir Jimenez --- .github/ISSUE_TEMPLATE/language-request.md | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/language-request.md diff --git a/.github/ISSUE_TEMPLATE/language-request.md b/.github/ISSUE_TEMPLATE/language-request.md new file mode 100644 index 0000000000..f8d55e1335 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/language-request.md @@ -0,0 +1,42 @@ +--- +name: Language request +about: I really wish Highlight.js could highlight ... +title: PLEASE read the below carefully. +labels: '' +assignees: '' + +--- + +First let us say that we'd also love it if Highlight.js could highlight whichever language you're about to request support for! And there is a chance you can help make that happen! But first... + +...PLEASE READ THE FOLLOWING... + + Highlight.js does not have a fundamental plan for implementing new languages + - i.e., the core team doesn't usually develop new languages. The core team + instead focuses on parser development, bugs, and supporting the existing + languages. They also currently does not have time to review, merge and + maintain any additional languages (fixing bugs, dealing with issues, etc). + + Instead, the project works by encouraging 3rd party language grammars from + contributors willing to help develop and maintain them. We're also happy to + host those 3rd party language grammars at the ``highlightjs`` GitHub + organization - no matter how obscure or weird. Or you're wlecome to host it + yourself - we're still happy to link to it. + + This means that *there's no point in requesting a new language without also + providing a 3rd party implementation* (we'll simply close "Please support + language Xyz" issues with a link to this explanation). If you'd like to see + a particular language available but cannot implement it, the best way to + make it happen is to find another developer interested in doing so. + + For more info on actually developing a language see our :doc:`language-guide`, + and for information on how to properly package your 3rd party language module + see :doc:`language-contribution`. + +If you are interested in contributing a 3rd party language grammar you can start with: + +- https://highlightjs.readthedocs.io/en/latest/language-contribution.html + +--- + +You actually don't need to create this issue at all unless you have a specific question about the 3rd party language grammar creation process - which we'd be glad to answer. From 1936dbd59dcd4de7391a9ea0413a68906fb04c14 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 10 Jun 2020 11:17:48 -0400 Subject: [PATCH 119/816] enh(toml)(ini) Improve parsing of complex keys (#2595) Fixes: https://github.com/highlightjs/highlight.js/issues/2594 --- CHANGES.md | 2 ++ src/languages/ini.js | 15 ++++++++++++++- test/markup/ini/keys.expect.txt | 32 ++++++++++++++++++++++++++++++++ test/markup/ini/keys.txt | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 test/markup/ini/keys.expect.txt create mode 100644 test/markup/ini/keys.txt diff --git a/CHANGES.md b/CHANGES.md index dce2373af4..75e435d373 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -48,6 +48,7 @@ Language Improvements: - enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][] - enh(handlebars) Support for sub-expressions, path-expressions, hashes, block-parameters and literals (#2344) [Nils Knappmeier][] - enh(protobuf) Support multiline comments (#2597) [Pavel Evstigneev][] +- fix(toml) Improve key parsing (#2595) [Antoine du Hamel][] [Josh Goebel]: https://github.com/yyyc514 [Peter Plantinga]: https://github.com/pplantinga @@ -62,6 +63,7 @@ Language Improvements: [Jim Mason]: https://github.com/RocketMan [lioshi]: https://github.com/lioshi [Pavel Evstigneev]: https://github.com/Paxa +[Antoine du Hamel]: https://github.com/aduh95 ## Version 10.0.2 diff --git a/src/languages/ini.js b/src/languages/ini.js index 73c19409b2..0f4aaf527f 100644 --- a/src/languages/ini.js +++ b/src/languages/ini.js @@ -1,3 +1,5 @@ +import * as regex from '../lib/regex'; + /* Language: TOML, also INI Description: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. @@ -54,6 +56,17 @@ export default function(hljs) { relevance:0 }; + var BARE_KEY = /[A-Za-z0-9_-]+/; + var QUOTED_KEY_DOUBLE_QUOTE = /"(\\"|[^"])*"/; + var QUOTED_KEY_SINGLE_QUOTE = /'[^']*'/; + var ANY_KEY = regex.either( + BARE_KEY, QUOTED_KEY_DOUBLE_QUOTE, QUOTED_KEY_SINGLE_QUOTE + ); + var DOTTED_KEY = regex.concat( + ANY_KEY, '(\\s*\\.\\s*', ANY_KEY, ')*', + regex.lookahead(/\s*=\s*[^#\s]/) + ); + return { name: 'TOML, also INI', aliases: ['toml'], @@ -66,7 +79,7 @@ export default function(hljs) { begin: /\[+/, end: /\]+/ }, { - begin: /^[a-z0-9\[\]_\.-]+(?=\s*=\s*)/, + begin: DOTTED_KEY, className: 'attr', starts: { end: /$/, diff --git a/test/markup/ini/keys.expect.txt b/test/markup/ini/keys.expect.txt new file mode 100644 index 0000000000..b80c964599 --- /dev/null +++ b/test/markup/ini/keys.expect.txt @@ -0,0 +1,32 @@ +# Bare keys: +key = "value" +bare_key = "value" +bare-key = "value" +1234 = "value" + +# Quoted keys: +"127.0.0.1" = "value" +"character encoding" = "value" +"ʎǝʞ" = "value" +'key2' = "value" +'quoted "value"' = "value" + +"key \"containing\" backslash" = 6 +'key \"containing" backslash\' = 6 + +# empty quoted key is allowed +"" = "blank" # VALID but discouraged +'' = 'blank' # VALID but discouraged + +# Dotted keys: +name = "Orange" +physical.color = "orange" +physical.shape = "round" +site."google.com" = true +3.14159 = "pi" + +# Whitespace around dot-separated parts is ignored: +hello . world = "!" + +# Whitespace is ignored around key names and values + hello = "World!" diff --git a/test/markup/ini/keys.txt b/test/markup/ini/keys.txt new file mode 100644 index 0000000000..5fdbe52b0e --- /dev/null +++ b/test/markup/ini/keys.txt @@ -0,0 +1,32 @@ +# Bare keys: +key = "value" +bare_key = "value" +bare-key = "value" +1234 = "value" + +# Quoted keys: +"127.0.0.1" = "value" +"character encoding" = "value" +"ʎǝʞ" = "value" +'key2' = "value" +'quoted "value"' = "value" + +"key \"containing\" backslash" = 6 +'key \"containing" backslash\' = 6 + +# empty quoted key is allowed +"" = "blank" # VALID but discouraged +'' = 'blank' # VALID but discouraged + +# Dotted keys: +name = "Orange" +physical.color = "orange" +physical.shape = "round" +site."google.com" = true +3.14159 = "pi" + +# Whitespace around dot-separated parts is ignored: +hello . world = "!" + +# Whitespace is ignored around key names and values + hello = "World!" From a010c151328b8944a7a03e5335956de8baf63295 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 11 Jun 2020 18:35:38 -0400 Subject: [PATCH 120/816] (chore) add `.js` extension to import statements (#2601) Adds file extensions to all import specifiers in ./src/ files. This is useful to run the files straight from source with a web browser , Node.js ESM or Deno. - Also add eslint rules regarding extensions for imports --- .eslintrc.js | 10 ++++++++++ src/highlight.js | 14 +++++++------- src/languages/coffeescript.js | 2 +- src/languages/groovy.js | 2 +- src/languages/handlebars.js | 2 +- src/languages/htmlbars.js | 2 +- src/languages/ini.js | 2 +- src/languages/java.js | 2 +- src/languages/javascript.js | 4 ++-- src/languages/livescript.js | 2 +- src/languages/typescript.js | 2 +- src/lib/html_renderer.js | 2 +- src/lib/mode_compiler.js | 4 ++-- src/lib/modes.js | 4 ++-- src/lib/token_tree.js | 2 +- 15 files changed, 33 insertions(+), 23 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e531d00a73..1561b367b1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -36,12 +36,22 @@ module.exports = { "indent": ["error", 2, {"VariableDeclarator":2}], // seems like a good idea not to use explicit undefined "no-undefined": "error", + // ensure import specifier contains file extension + "import/extensions": ["error", "always"], // TODO maybe "camelcase": "off", // TODO: turn on later "init-declarations": ["error","always"] }, "overrides": [ + { + "files": ["src/**/*.js"], + "rules": { + // make sure there is no Node.js specific API slipping into the source files + "import/no-nodejs-modules": "error", + "import/no-commonjs": "error", + } + }, { "files": ["src/languages/*.js"], "rules": { diff --git a/src/highlight.js b/src/highlight.js index fbcca7a24d..ea4d4d0cb7 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -3,13 +3,13 @@ Syntax highlighting with language autodetection. https://highlightjs.org/ */ -import deepFreeze from './vendor/deep_freeze'; -import Response from './lib/response'; -import TokenTreeEmitter from './lib/token_tree'; -import * as regex from './lib/regex'; -import * as utils from './lib/utils'; -import * as MODES from './lib/modes'; -import { compileLanguage } from './lib/mode_compiler'; +import deepFreeze from './vendor/deep_freeze.js'; +import Response from './lib/response.js'; +import TokenTreeEmitter from './lib/token_tree.js'; +import * as regex from './lib/regex.js'; +import * as utils from './lib/utils.js'; +import * as MODES from './lib/modes.js'; +import { compileLanguage } from './lib/mode_compiler.js'; import * as packageJSON from '../package.json'; const escape = utils.escapeHTML; diff --git a/src/languages/coffeescript.js b/src/languages/coffeescript.js index 458ce3872a..2d6a8f5094 100644 --- a/src/languages/coffeescript.js +++ b/src/languages/coffeescript.js @@ -7,7 +7,7 @@ Category: common, scripting Website: https://coffeescript.org */ -import * as ECMAScript from "./lib/ecmascript"; +import * as ECMAScript from './lib/ecmascript.js'; /** @type LanguageFn */ export default function(hljs) { diff --git a/src/languages/groovy.js b/src/languages/groovy.js index 20f8662d77..014019e72e 100644 --- a/src/languages/groovy.js +++ b/src/languages/groovy.js @@ -5,7 +5,7 @@ Website: https://groovy-lang.org */ -import * as regex from "../lib/regex"; +import * as regex from '../lib/regex.js'; function variants(variants, obj = {}) { obj.variants = variants; diff --git a/src/languages/handlebars.js b/src/languages/handlebars.js index 8578982470..eba95ab210 100644 --- a/src/languages/handlebars.js +++ b/src/languages/handlebars.js @@ -7,7 +7,7 @@ Website: https://handlebarsjs.com Category: template */ -import * as regex from '../lib/regex' +import * as regex from '../lib/regex.js' export default function(hljs) { const BUILT_INS = { diff --git a/src/languages/htmlbars.js b/src/languages/htmlbars.js index df09b5357d..caca6d4dad 100644 --- a/src/languages/htmlbars.js +++ b/src/languages/htmlbars.js @@ -19,7 +19,7 @@ TODO: Remove in version 11.0. */ // compile time dependency on handlebars -import handlebars from "./handlebars" +import handlebars from "./handlebars.js" export default function(hljs) { const definition = handlebars(hljs) diff --git a/src/languages/ini.js b/src/languages/ini.js index 0f4aaf527f..fd7377da86 100644 --- a/src/languages/ini.js +++ b/src/languages/ini.js @@ -1,4 +1,4 @@ -import * as regex from '../lib/regex'; +import * as regex from '../lib/regex.js'; /* Language: TOML, also INI diff --git a/src/languages/java.js b/src/languages/java.js index 45b314c1a3..a73e9bf5c6 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -5,7 +5,7 @@ Category: common, enterprise Website: https://www.java.com/ */ -import * as regex from "../lib/regex"; +import * as regex from '../lib/regex.js'; export default function(hljs) { var JAVA_IDENT_RE = '[\u00C0-\u02B8a-zA-Z_$][\u00C0-\u02B8a-zA-Z_$0-9]*'; diff --git a/src/languages/javascript.js b/src/languages/javascript.js index c8334357bc..bc7a4a5349 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -5,8 +5,8 @@ Category: common, scripting Website: https://developer.mozilla.org/en-US/docs/Web/JavaScript */ -import * as ECMAScript from "./lib/ecmascript"; -import * as regex from "../lib/regex"; +import * as ECMAScript from './lib/ecmascript.js'; +import * as regex from '../lib/regex.js'; export default function(hljs) { var IDENT_RE = ECMAScript.IDENT_RE; diff --git a/src/languages/livescript.js b/src/languages/livescript.js index 4f1f072a90..a200bcde8b 100644 --- a/src/languages/livescript.js +++ b/src/languages/livescript.js @@ -8,7 +8,7 @@ Website: https://livescript.net Category: scripting */ -import * as ECMAScript from "./lib/ecmascript"; +import * as ECMAScript from './lib/ecmascript.js'; export default function(hljs) { var LIVESCRIPT_BUILT_INS = [ diff --git a/src/languages/typescript.js b/src/languages/typescript.js index e44ee9a86f..537d243679 100644 --- a/src/languages/typescript.js +++ b/src/languages/typescript.js @@ -7,7 +7,7 @@ Website: https://www.typescriptlang.org Category: common, scripting */ -import * as ECMAScript from "./lib/ecmascript"; +import * as ECMAScript from './lib/ecmascript.js'; export default function(hljs) { var IDENT_RE = ECMAScript.IDENT_RE; diff --git a/src/lib/html_renderer.js b/src/lib/html_renderer.js index 9e98a07ab4..e2a437bc67 100644 --- a/src/lib/html_renderer.js +++ b/src/lib/html_renderer.js @@ -1,4 +1,4 @@ -import { escapeHTML } from './utils'; +import { escapeHTML } from './utils.js'; /** * @typedef {object} Renderer diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js index 063283b173..7608d6a156 100644 --- a/src/lib/mode_compiler.js +++ b/src/lib/mode_compiler.js @@ -1,5 +1,5 @@ -import * as regex from './regex'; -import { inherit } from './utils'; +import * as regex from './regex.js'; +import { inherit } from './utils.js'; // keywords that should have no default relevance value var COMMON_KEYWORDS = 'of and for in not or if then'.split(' '); diff --git a/src/lib/modes.js b/src/lib/modes.js index 33d18a9105..f493f073cb 100644 --- a/src/lib/modes.js +++ b/src/lib/modes.js @@ -1,5 +1,5 @@ -import { inherit } from './utils'; -import * as regex from './regex'; +import { inherit } from './utils.js'; +import * as regex from './regex.js'; // Common regexps export const IDENT_RE = '[a-zA-Z]\\w*'; diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js index 6e2fba63b2..b748d6b3df 100644 --- a/src/lib/token_tree.js +++ b/src/lib/token_tree.js @@ -1,4 +1,4 @@ -import HTMLRenderer from './html_renderer'; +import HTMLRenderer from './html_renderer.js'; /** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} | string} Node */ /** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} } DataNode */ From b4046ce996340147fe75e3e419c4378781de4f3a Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Thu, 11 Jun 2020 15:45:24 -0700 Subject: [PATCH 121/816] enh(dart) highlight built-in nullable types (#2598) * Dart: allow built-in nullable types with trailing ? to be highlighted --- CHANGES.md | 2 +- src/languages/dart.js | 64 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 75e435d373..54c2439e17 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,7 +44,7 @@ Language Improvements: - fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][] - fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][] - fix(swift) `@objcMembers` was being partially highlighted (#2543) [Nick Randall][] -- enh(dart) Add `late` and `required` keywords, and `Never` built-in type (#2550) [Sam Rawlins][] +- enh(dart) Add `late` and `required` keywords, the `Never` built-in type, and nullable built-in types (#2550) [Sam Rawlins][] - enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][] - enh(handlebars) Support for sub-expressions, path-expressions, hashes, block-parameters and literals (#2344) [Nils Knappmeier][] - enh(protobuf) Support multiline comments (#2597) [Pavel Evstigneev][] diff --git a/src/languages/dart.js b/src/languages/dart.js index 25a05b63f1..08808da60f 100644 --- a/src/languages/dart.js +++ b/src/languages/dart.js @@ -8,23 +8,23 @@ Category: scripting */ export default function(hljs) { - var SUBST = { + const SUBST = { className: 'subst', variants: [{ begin: '\\$[A-Za-z0-9_]+' }], }; - var BRACED_SUBST = { + const BRACED_SUBST = { className: 'subst', variants: [{ begin: '\\${', end: '}' - }, ], + }], keywords: 'true false null this is new super', }; - var STRING = { + const STRING = { className: 'string', variants: [{ begin: 'r\'\'\'', @@ -72,17 +72,59 @@ export default function(hljs) { hljs.C_NUMBER_MODE, STRING ]; - var KEYWORDS = { + const BUILT_IN_TYPES = [ + // dart:core + 'Comparable', + 'DateTime', + 'Duration', + 'Function', + 'Iterable', + 'Iterator', + 'List', + 'Map', + 'Match', + 'Object', + 'Pattern', + 'RegExp', + 'Set', + 'Stopwatch', + 'String', + 'StringBuffer', + 'StringSink', + 'Symbol', + 'Type', + 'Uri', + 'bool', + 'double', + 'int', + 'num', + // dart:html + 'Element', + 'ElementList', + ]; + const NULLABLE_BUILT_IN_TYPES = BUILT_IN_TYPES.map((e) => `${e}?`); + + const KEYWORDS = { keyword: 'abstract as assert async await break case catch class const continue covariant default deferred do ' + 'dynamic else enum export extends extension external factory false final finally for Function get hide if ' + 'implements import in inferface is late library mixin new null on operator part required rethrow return set ' + 'show static super switch sync this throw true try typedef var void while with yield', built_in: - // dart:core - 'Comparable DateTime Duration Function Iterable Iterator List Map Match Never Null Object Pattern RegExp ' + - 'Set Stopwatch String StringBuffer StringSink Symbol Type Uri bool double dynamic int num print ' + - // dart:html - 'Element ElementList document querySelector querySelectorAll window' + BUILT_IN_TYPES + .concat(NULLABLE_BUILT_IN_TYPES) + .concat([ + // dart:core + 'Never', + 'Null', + 'dynamic', + 'print', + // dart:html + 'document', + 'querySelector', + 'querySelectorAll', + 'window', + ]).join(' '), + $pattern: /[A-Za-z][A-Za-z0-9_]*\??/ }; return { @@ -130,5 +172,5 @@ export default function(hljs) { begin: '=>' // No markup, just a relevance booster } ] - } + }; } From 014343e8d57f35ac6b01c619d9a3d8989de39dfe Mon Sep 17 00:00:00 2001 From: TupikovVladimir Date: Fri, 12 Jun 2020 01:46:27 +0300 Subject: [PATCH 122/816] enh(csharp) highlight generics in more cases (#2599) --- src/languages/csharp.js | 14 ++++++++++---- test/markup/csharp/generic_modifiers.expect.txt | 11 ++++++++--- test/markup/csharp/generic_modifiers.txt | 4 ++++ test/markup/csharp/titles.expect.txt | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/languages/csharp.js b/src/languages/csharp.js index a68c265d17..8c20e37db9 100644 --- a/src/languages/csharp.js +++ b/src/languages/csharp.js @@ -91,7 +91,10 @@ export default function(hljs) { var GENERIC_MODIFIER = { begin: "<", end: ">", - keywords: "in out" + contains: [ + { beginKeywords: "in out"}, + TITLE_MODE + ] }; var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '(\\s*,\\s*' + hljs.IDENT_RE + ')*>)?(\\[\\])?'; var AT_IDENTIFIER = { @@ -177,13 +180,16 @@ export default function(hljs) { }, { className: 'function', - begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true, + begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*(\\<.+\\>)?\\s*\\(', returnBegin: true, end: /\s*[{;=]/, excludeEnd: true, keywords: KEYWORDS, contains: [ { - begin: hljs.IDENT_RE + '\\s*\\(', returnBegin: true, - contains: [hljs.TITLE_MODE], + begin: hljs.IDENT_RE + '\\s*(\\<.+\\>)?\\s*\\(', returnBegin: true, + contains: [ + hljs.TITLE_MODE, + GENERIC_MODIFIER + ], relevance: 0 }, { diff --git a/test/markup/csharp/generic_modifiers.expect.txt b/test/markup/csharp/generic_modifiers.expect.txt index bf6d8c3fba..6e0a0ef4dc 100644 --- a/test/markup/csharp/generic_modifiers.expect.txt +++ b/test/markup/csharp/generic_modifiers.expect.txt @@ -1,7 +1,12 @@ -interface IObserver<in T>; +interface IObserver<in T>; {} -interface IObservable<out T>; +interface IObservable<out T>; {} -public delegate void DContravariant<in A>(A argument); +public delegate void DContravariant<in A>(A argument); + +public delegate A DCovariant<out A>(); + +void MethodWithGenericParameter<T>() + \ No newline at end of file diff --git a/test/markup/csharp/generic_modifiers.txt b/test/markup/csharp/generic_modifiers.txt index 0af70e5c53..71273e85b2 100644 --- a/test/markup/csharp/generic_modifiers.txt +++ b/test/markup/csharp/generic_modifiers.txt @@ -5,3 +5,7 @@ interface IObservable; {} public delegate void DContravariant(A argument); + +public delegate A DCovariant(); + +void MethodWithGenericParameter() diff --git a/test/markup/csharp/titles.expect.txt b/test/markup/csharp/titles.expect.txt index be471a6db1..46fa652d17 100644 --- a/test/markup/csharp/titles.expect.txt +++ b/test/markup/csharp/titles.expect.txt @@ -16,6 +16,6 @@ } } - public class TesterA<R, S> where R : class where S : IComparable + public class TesterA<R, S> where R : class where S : IComparable {} } From dfeb3a131fbb59f91f20894f471866667ca276c7 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 11 Jun 2020 19:07:17 -0400 Subject: [PATCH 123/816] (chore) fix tiny style issues, add linting npm task - fixes tiny style issues - adds `npm run lint` for linting the main library source (not languages which are still much messier) --- package.json | 1 + src/highlight.js | 2 +- src/lib/html_renderer.js | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6b01a26986..7c52f56d03 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "types": "./types/index.d.ts", "scripts": { "mocha": "mocha", + "lint": "eslint -c .eslintrc.js src/*.js src/lib/*.js", "build_and_test": "npm run build && npm run test", "build": "node ./tools/build.js -t node", "build-cdn": "node ./tools/build.js -t cdn", diff --git a/src/highlight.js b/src/highlight.js index ea4d4d0cb7..8f59f1ae9c 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -684,7 +684,7 @@ const HLJS = function(hljs) { language: result.language, // TODO: remove with version 11.0 re: result.relevance, - relavance: result.relevance, + relavance: result.relevance }; if (result.second_best) { element.second_best = { diff --git a/src/lib/html_renderer.js b/src/lib/html_renderer.js index e2a437bc67..831b3e0a40 100644 --- a/src/lib/html_renderer.js +++ b/src/lib/html_renderer.js @@ -84,5 +84,4 @@ export default class HTMLRenderer { span(className) { this.buffer += ``; } - } From c6dec5e0d90af7a01275b0362b035c9f1ea598b0 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 11 Jun 2020 19:16:31 -0400 Subject: [PATCH 124/816] (chore) bump dev dependencies --- package-lock.json | 860 +++++++++++++++++++++++++--------------------- package.json | 8 +- 2 files changed, 466 insertions(+), 402 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4df5098930..7d59b7e594 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "highlight.js", - "version": "10.0.0", + "version": "10.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -180,29 +180,6 @@ } } }, - "@typescript-eslint/experimental-utils": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.32.0.tgz", - "integrity": "sha512-oDWuB2q5AXsQ/mLq2N4qtWiBASWXPf7KhqXgeGH4QsyVKx+km8F6Vfqd3bspJQyhyCqxcbLO/jKJuIV3DzHZ6A==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.32.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - }, - "dependencies": { - "eslint-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", - "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - } - } - }, "@typescript-eslint/parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.0.0.tgz", @@ -273,43 +250,6 @@ } } }, - "@typescript-eslint/typescript-estree": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.32.0.tgz", - "integrity": "sha512-hQpbWM/Y2iq6jB9FHYJBqa3h1R9IEGodOtajhb261cVHt9cz30AKjXM6WP7LxJdEPPlyJ9rPTZVgBUgZgiyPgw==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "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" - } - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true - } - } - }, "abab": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", @@ -323,27 +263,19 @@ "dev": true }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", "dev": true }, "acorn-globals": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", - "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", "dev": true, "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - }, - "dependencies": { - "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==", - "dev": true - } + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" } }, "acorn-jsx": { @@ -353,9 +285,9 @@ "dev": true }, "acorn-walk": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.1.1.tgz", + "integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==", "dev": true }, "aggregate-error": { @@ -369,21 +301,21 @@ } }, "ajv": { - "version": "6.9.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz", - "integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==", + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", "dev": true, "requires": { - "fast-deep-equal": "^2.0.1", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-escapes": { @@ -570,6 +502,27 @@ } } }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -595,9 +548,9 @@ "dev": true }, "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", + "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", "dev": true }, "balanced-match": { @@ -641,9 +594,9 @@ } }, "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, "browser-stdout": { @@ -705,25 +658,25 @@ "dev": true }, "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", "dev": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.1", + "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" + "readdirp": "~3.3.0" }, "dependencies": { "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -839,9 +792,9 @@ "dev": true }, "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" @@ -901,9 +854,9 @@ "dev": true }, "cssstyle": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.0.0.tgz", - "integrity": "sha512-QXSAu2WBsSRXCPjvI43Y40m6fMevvyRm8JVAuF9ksQz5jha4pWP1wpaK7Yu5oLFc6+XAY+hj8YhefyXcBB53gg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", "dev": true, "requires": { "cssom": "~0.3.6" @@ -924,14 +877,6 @@ "dev": true, "requires": { "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } } }, "data-urls": { @@ -1018,9 +963,9 @@ "dev": true }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "dir-glob": { @@ -1048,6 +993,14 @@ "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 + } } }, "ecc-jsbn": { @@ -1096,23 +1049,71 @@ } }, "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", "dev": true, "requires": { - "es-to-primitive": "^1.2.0", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + } + } + }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", + "dev": true + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "dev": true, + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } } }, "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { "is-callable": "^1.1.4", @@ -1127,9 +1128,9 @@ "dev": true }, "escodegen": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.13.0.tgz", - "integrity": "sha512-eYk2dCkxR07DsHA/X2hRBj0CFAZeri/LyDMc0C8JT1Hqi6JnVpMhJ7XFITbb0+yZS3lVkaPL2oCkZ3AVmeVbMw==", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.2.tgz", + "integrity": "sha512-InuOIiKk8wwuOFg6x9BQXbzjrQhtyXh46K9bqVTPzSo2FnyMBaYGBMC6PhQy7yxxil9vIedFBweQBMK74/7o8A==", "dev": true, "requires": { "esprima": "^4.0.1", @@ -1532,9 +1533,9 @@ "dev": true }, "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-glob": { @@ -1645,12 +1646,21 @@ } }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "dependencies": { + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } } }, "flat": { @@ -1660,14 +1670,6 @@ "dev": true, "requires": { "is-buffer": "~2.0.3" - }, - "dependencies": { - "is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", - "dev": true - } } }, "flat-cache": { @@ -1753,14 +1755,6 @@ "dev": true, "requires": { "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } } }, "glob": { @@ -1833,15 +1827,16 @@ "dev": true }, "handlebars": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", - "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", "dev": true, "requires": { + "minimist": "^1.2.5", "neo-async": "^2.6.0", - "optimist": "^0.6.1", "source-map": "^0.6.1", - "uglify-js": "^3.1.4" + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" } }, "har-schema": { @@ -1894,9 +1889,9 @@ "dev": true }, "html-encoding-sniffer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.0.tgz", - "integrity": "sha512-Y9prnPKkM7FXxQevZ5UH8Z6aVTY0ede1tHquck5UxGmKWDshxXh95gSa2xXYjS8AsGO5iOvrCI5+GttRKnLdNA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", "dev": true, "requires": { "whatwg-encoding": "^1.0.5" @@ -2089,6 +2084,12 @@ "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", "dev": true }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -2104,10 +2105,16 @@ "binary-extensions": "^2.0.0" } }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", "dev": true }, "is-date-object": { @@ -2137,6 +2144,12 @@ "is-extglob": "^2.1.1" } }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2155,6 +2168,12 @@ "integrity": "sha512-CKstxrctq1kUesU6WhtZDbYKzzYBuRH0UYInAVrkc/EYdB9ltbfE0gOoayG9nhohG6447sOOVGhHqsdmBvkbNg==", "dev": true }, + "is-potential-custom-element-name": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz", + "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", + "dev": true + }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -2179,14 +2198,28 @@ } }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", "dev": true, "requires": { - "has": "^1.0.1" + "has-symbols": "^1.0.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + } } }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -2226,6 +2259,22 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==", + "dev": true + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "dev": true, + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, "js-beautify": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.10.2.tgz", @@ -2262,49 +2311,37 @@ "dev": true }, "jsdom": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.0.1.tgz", - "integrity": "sha512-wKJe/APzq+ak9i+2ybWE20lDIhF9AkGKSZf8UsjPN39acatFB6oA7K397kQvHVikds0yQono2h6J7UjbPtPOWw==", + "version": "16.2.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.2.2.tgz", + "integrity": "sha512-pDFQbcYtKBHxRaP55zGXCJWgFHkDAYbKcsXEK/3Icu9nKYZkutUXfLBwbD+09XDutkYSHcgfQLZ0qvpAAm9mvg==", "dev": true, "requires": { "abab": "^2.0.3", - "acorn": "^7.1.0", - "acorn-globals": "^4.3.2", + "acorn": "^7.1.1", + "acorn-globals": "^6.0.0", "cssom": "^0.4.4", - "cssstyle": "^2.0.0", + "cssstyle": "^2.2.0", "data-urls": "^2.0.0", "decimal.js": "^10.2.0", "domexception": "^2.0.1", - "escodegen": "^1.12.1", - "html-encoding-sniffer": "^2.0.0", + "escodegen": "^1.14.1", + "html-encoding-sniffer": "^2.0.1", + "is-potential-custom-element-name": "^1.0.0", "nwsapi": "^2.2.0", "parse5": "5.1.1", - "request": "^2.88.0", + "request": "^2.88.2", "request-promise-native": "^1.0.8", - "saxes": "^4.0.2", - "symbol-tree": "^3.2.2", + "saxes": "^5.0.0", + "symbol-tree": "^3.2.4", "tough-cookie": "^3.0.1", - "w3c-hr-time": "^1.0.1", + "w3c-hr-time": "^1.0.2", "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^5.0.0", + "webidl-conversions": "^6.0.0", "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", "whatwg-url": "^8.0.0", - "ws": "^7.2.1", + "ws": "^7.2.3", "xml-name-validator": "^3.0.0" - }, - "dependencies": { - "tough-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", - "dev": true, - "requires": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - } } }, "json-schema": { @@ -2341,14 +2378,6 @@ "extsprintf": "1.3.0", "json-schema": "0.2.3", "verror": "1.10.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } } }, "levn": { @@ -2374,13 +2403,12 @@ } }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "lodash": { @@ -2396,12 +2424,12 @@ "dev": true }, "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", "dev": true, "requires": { - "chalk": "^2.0.1" + "chalk": "^2.4.2" } }, "lru-cache": { @@ -2430,18 +2458,18 @@ "dev": true }, "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { - "mime-db": "~1.38.0" + "mime-db": "1.44.0" } }, "mimic-fn": { @@ -2459,52 +2487,51 @@ "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "minimist": "^1.2.5" } }, "mocha": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.0.1.tgz", - "integrity": "sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", + "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", "dev": true, "requires": { - "ansi-colors": "3.2.3", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", + "chokidar": "3.3.1", "debug": "3.2.6", - "diff": "3.5.0", + "diff": "4.0.2", "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "find-up": "4.1.0", + "glob": "7.1.6", "growl": "1.10.5", "he": "1.2.0", "js-yaml": "3.13.1", - "log-symbols": "2.2.0", + "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", + "ms": "2.1.2", "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", + "promise.allsettled": "1.0.2", + "serialize-javascript": "3.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", "wide-align": "1.1.3", - "yargs": "13.3.0", - "yargs-parser": "13.1.1", + "workerpool": "6.0.0", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", "yargs-unparser": "1.6.0" }, "dependencies": { @@ -2518,9 +2545,9 @@ } }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -2531,11 +2558,26 @@ "path-is-absolute": "^1.0.0" } }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } } } }, @@ -2569,16 +2611,6 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - } - }, "nopt": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", @@ -2643,16 +2675,6 @@ "object-keys": "^1.0.11" } }, - "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, "object.values": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", @@ -2736,24 +2758,6 @@ "mimic-fn": "^2.1.0" } }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - } - } - }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -2791,21 +2795,21 @@ } }, "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { "p-try": "^2.0.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" } }, "p-map": { @@ -2961,6 +2965,19 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "dev": true, + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } + }, "proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", @@ -2974,9 +2991,9 @@ "dev": true }, "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, "punycode": { @@ -3069,12 +3086,12 @@ } }, "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", "dev": true, "requires": { - "picomatch": "^2.0.4" + "picomatch": "^2.0.7" } }, "regexpp": { @@ -3084,9 +3101,9 @@ "dev": true }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -3096,7 +3113,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -3106,9 +3123,21 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" + }, + "dependencies": { + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + } } }, "request-promise-core": { @@ -3129,6 +3158,18 @@ "request-promise-core": "1.1.3", "stealthy-require": "^1.1.1", "tough-cookie": "^2.3.3" + }, + "dependencies": { + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + } } }, "require-directory": { @@ -3259,9 +3300,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, "safer-buffer": { @@ -3271,9 +3312,9 @@ "dev": true }, "saxes": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-4.0.2.tgz", - "integrity": "sha512-EZOTeQ4bgkOaGCDaTKux+LaRNcLNbdbvMH7R3/yjEEULPEmqvkFbFub6DJhJTub2iGMT93CfpZ5LTdKZmAbVeQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", "dev": true, "requires": { "xmlchars": "^2.2.0" @@ -3285,6 +3326,12 @@ "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true }, + "serialize-javascript": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", + "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==", + "dev": true + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -3464,23 +3511,6 @@ "jsbn": "~0.1.0", "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" - }, - "dependencies": { - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } } }, "stealthy-require": { @@ -3775,12 +3805,20 @@ "dev": true }, "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" + }, + "dependencies": { + "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 + } } }, "symbol-tree": { @@ -3906,27 +3944,20 @@ } }, "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", + "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", "dev": true, "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" } }, "tr46": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.0.tgz", - "integrity": "sha512-LrErSqfhdUw73AC/eXV2fEmNkvgSYxfm5lvxnLvuVgoVDknvD28Pa5FeDGc8RuVouDxUD3GnHHFv7xnBp7As5w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", + "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", "dev": true, "requires": { "punycode": "^2.1.1" @@ -3984,20 +4015,19 @@ "dev": true }, "uglify-js": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.2.tgz", - "integrity": "sha512-+gh/xFte41GPrgSMJ/oJVq15zYmqr74pY9VoM69UzMzq9NFk4YDylclb1/bhEzZSaUQjbW5RvniHeq1cdtRYjw==", + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", + "integrity": "sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA==", "dev": true, "optional": true, "requires": { - "commander": "2.20.0", - "source-map": "~0.6.1" + "commander": "~2.20.3" }, "dependencies": { "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "optional": true } @@ -4013,9 +4043,9 @@ } }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "v8-compile-cache": { @@ -4043,23 +4073,15 @@ "assert-plus": "^1.0.0", "core-util-is": "1.0.2", "extsprintf": "^1.2.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } } }, "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "dev": true, "requires": { - "browser-process-hrtime": "^0.1.2" + "browser-process-hrtime": "^1.0.0" } }, "w3c-xmlserializer": { @@ -4072,9 +4094,9 @@ } }, "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", "dev": true }, "whatwg-encoding": { @@ -4093,14 +4115,22 @@ "dev": true }, "whatwg-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.0.0.tgz", - "integrity": "sha512-41ou2Dugpij8/LPO5Pq64K5q++MnRCBpEHvQr26/mArEKTkCV5aoXIqyhuYtE0pkqScXwhf2JP57rkRTYM29lQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.1.0.tgz", + "integrity": "sha512-vEIkwNi9Hqt4TV9RdnaBPNt+E2Sgmo3gePebCRgZ1R7g6d23+53zCTnuB0amKI4AXq6VM8jj2DUAa0S1vjJxkw==", "dev": true, "requires": { "lodash.sortby": "^4.7.0", - "tr46": "^2.0.0", + "tr46": "^2.0.2", "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 + } } }, "which": { @@ -4134,9 +4164,15 @@ "dev": true }, "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==", "dev": true }, "wrap-ansi": { @@ -4194,9 +4230,9 @@ } }, "ws": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz", - "integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz", + "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", "dev": true }, "xml-name-validator": { @@ -4224,9 +4260,9 @@ "dev": true }, "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, "requires": { "cliui": "^5.0.0", @@ -4238,7 +4274,7 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" + "yargs-parser": "^13.1.2" }, "dependencies": { "ansi-regex": { @@ -4247,6 +4283,34 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -4270,9 +4334,9 @@ } }, "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "requires": { "camelcase": "^5.0.0", diff --git a/package.json b/package.json index 7c52f56d03..def1216b97 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "10.0.0", + "version": "10.1.0", "author": { "name": "Ivan Sagalaev", "email": "maniac@softwaremaniacs.org" @@ -54,11 +54,11 @@ "eslint-plugin-standard": "^4.0.1", "glob": "^7.1.4", "glob-promise": "^3.4.0", - "handlebars": "^4.5.3", + "handlebars": "^4.7.6", "js-beautify": "^1.10.2", - "jsdom": "^16.0.1", + "jsdom": "^16.2.2", "lodash": "^4.17.15", - "mocha": "^7.0.1", + "mocha": "^8.0.1", "rollup": "^2.0.0", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-json": "^4.0.0", From 84f7fa3c8d9742a2f890a406ac2cebf88830d139 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 11 Jun 2020 19:22:33 -0400 Subject: [PATCH 125/816] (chore) upgrade some dev stuff to newer versions --- package-lock.json | 734 ++++++++++++++++++---------------------------- package.json | 16 +- 2 files changed, 289 insertions(+), 461 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7d59b7e594..1e222dd86d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,27 +5,27 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.10.1" } }, "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", "dev": true }, "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.1", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } @@ -91,6 +91,12 @@ "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", "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=", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -104,74 +110,18 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.0.0.tgz", - "integrity": "sha512-lcZ0M6jD4cqGccYOERKdMtg+VWpoq3NSnWVxpc/AwAy0zhkUYVioOUZmfNqiNH8/eBNGhCn6HXd6mKIGRgNc1Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.2.0.tgz", + "integrity": "sha512-t9RTk/GyYilIXt6BmZurhBzuMT9kLKw3fQoJtK9ayv0tXTlznXEAnx07sCLXdkN3/tZDep1s1CEV95CWuARYWA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "3.0.0", + "@typescript-eslint/experimental-utils": "3.2.0", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", "semver": "^7.3.2", "tsutils": "^3.17.1" }, "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.0.tgz", - "integrity": "sha512-BN0vmr9N79M9s2ctITtChRuP1+Dls0x/wlg0RXW1yQ7WJKPurg6X3Xirv61J2sjPif4F8SLsFMs5Nzte0WYoTQ==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/typescript-estree": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.0.tgz", - "integrity": "sha512-nevQvHyNghsfLrrByzVIH4ZG3NROgJ8LZlfh3ddwPPH4CH7W4GAiSx5qu+xHuX5pWsq6q/eqMc1io840ZhAnUg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "eslint-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", - "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "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" - } - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - }, "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", @@ -180,68 +130,45 @@ } } }, + "@typescript-eslint/experimental-utils": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.2.0.tgz", + "integrity": "sha512-UbJBsk+xO9dIFKtj16+m42EvUvsjZbbgQ2O5xSTSfVT1Z3yGkL90DVu0Hd3029FZ5/uBgl+F3Vo8FAcEcqc6aQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "3.2.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, "@typescript-eslint/parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.0.0.tgz", - "integrity": "sha512-8RRCA9KLxoFNO0mQlrLZA0reGPd/MsobxZS/yPFj+0/XgMdS8+mO8mF3BDj2ZYQj03rkayhSJtF1HAohQ3iylw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.2.0.tgz", + "integrity": "sha512-Vhu+wwdevDLVDjK1lIcoD6ZbuOa93fzqszkaO3iCnmrScmKwyW/AGkzc2UvfE5TCoCXqq7Jyt6SOXjsIlpqF4A==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.0.0", - "@typescript-eslint/typescript-estree": "3.0.0", + "@typescript-eslint/experimental-utils": "3.2.0", + "@typescript-eslint/typescript-estree": "3.2.0", "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.2.0.tgz", + "integrity": "sha512-uh+Y2QO7dxNrdLw7mVnjUqkwO/InxEqwN0wF+Za6eo3coxls9aH9kQ/5rSvW2GcNanebRTmsT5w1/92lAOb1bA==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" }, "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.0.tgz", - "integrity": "sha512-BN0vmr9N79M9s2ctITtChRuP1+Dls0x/wlg0RXW1yQ7WJKPurg6X3Xirv61J2sjPif4F8SLsFMs5Nzte0WYoTQ==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/typescript-estree": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.0.tgz", - "integrity": "sha512-nevQvHyNghsfLrrByzVIH4ZG3NROgJ8LZlfh3ddwPPH4CH7W4GAiSx5qu+xHuX5pWsq6q/eqMc1io840ZhAnUg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "eslint-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", - "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "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" - } - }, "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", @@ -378,59 +305,6 @@ "define-properties": "^1.1.3", "es-abstract": "^1.17.0", "is-string": "^1.0.5" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true - }, - "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", - "dev": true - }, - "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - } } }, "array-union": { @@ -447,59 +321,6 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true - }, - "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", - "dev": true - }, - "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - } } }, "array.prototype.map": { @@ -685,9 +506,9 @@ } }, "clean-css": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz", - "integrity": "sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", + "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", "dev": true, "requires": { "source-map": "~0.6.0" @@ -801,9 +622,9 @@ } }, "commander": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.0.0.tgz", - "integrity": "sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "dev": true }, "concat-map": { @@ -835,16 +656,14 @@ "dev": true }, "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "cssom": { @@ -1026,9 +845,9 @@ }, "dependencies": { "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true } } @@ -1141,22 +960,22 @@ } }, "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.2.0.tgz", + "integrity": "sha512-B3BtEyaDKC5MlfDa2Ha8/D6DsS4fju95zs0hjS3HdGazw+LNayai38A25qMppK37wWGWNYSPOR6oYzlz5MHsRQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", @@ -1169,44 +988,76 @@ "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", + "levn": "^0.4.1", "lodash": "^4.17.14", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { - "ajv": { - "version": "6.12.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", - "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, - "ansi-regex": { + "chalk": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "eslint-scope": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-visitor-keys": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.2.0.tgz", + "integrity": "sha512-WFb4ihckKil6hu3Dp798xdzSfddwKKU3+nGniKF6HfeW6OLd2OUDEPP7TcHtB5+QXOKg2s6B2DaMPE1Nn/kxKQ==", "dev": true }, "ignore": { @@ -1215,19 +1066,58 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" } } } @@ -1320,23 +1210,24 @@ } }, "eslint-plugin-import": { - "version": "2.20.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz", - "integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==", + "version": "2.21.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.21.2.tgz", + "integrity": "sha512-FEmxeGI6yaz+SnEB6YgNHlQK1Bs2DKLM+YF+vuTk5H8J9CLbJLtlPvRFgZZ2+sXiKAlN5dpdlrWOjK8ZoZJpQA==", "dev": true, "requires": { - "array-includes": "^3.0.3", - "array.prototype.flat": "^1.2.1", + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", "contains-path": "^0.1.0", "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.2", - "eslint-module-utils": "^2.4.1", + "eslint-import-resolver-node": "^0.3.3", + "eslint-module-utils": "^2.6.0", "has": "^1.0.3", "minimatch": "^3.0.4", - "object.values": "^1.1.0", + "object.values": "^1.1.1", "read-pkg-up": "^2.0.0", - "resolve": "^1.12.0" + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" }, "dependencies": { "debug": { @@ -1363,6 +1254,15 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } } } }, @@ -1420,9 +1320,9 @@ } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" @@ -1441,20 +1341,20 @@ "dev": true }, "espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", "dev": true, "requires": { - "acorn": "^7.1.1", + "acorn": "^7.2.0", "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^1.2.0" }, "dependencies": { - "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "eslint-visitor-keys": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.2.0.tgz", + "integrity": "sha512-WFb4ihckKil6hu3Dp798xdzSfddwKKU3+nGniKF6HfeW6OLd2OUDEPP7TcHtB5+QXOKg2s6B2DaMPE1Nn/kxKQ==", "dev": true } } @@ -1758,9 +1658,9 @@ } }, "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1815,9 +1715,9 @@ } }, "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "growl": { @@ -2035,12 +1935,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "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 - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2066,15 +1960,6 @@ "requires": { "ansi-regex": "^5.0.0" } - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, @@ -2174,12 +2059,6 @@ "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", "dev": true }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-reference": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", @@ -2276,16 +2155,24 @@ } }, "js-beautify": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.10.2.tgz", - "integrity": "sha512-ZtBYyNUYJIsBWERnQP0rPN9KjkrDfJcMjuVGcvXOUJrD1zmOGwhRwQ4msG+HJ+Ni/FA7+sRQEMYVzdTQDvnzvQ==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.11.0.tgz", + "integrity": "sha512-a26B+Cx7USQGSWnz9YxgJNMmML/QG2nqIaL7VVYPCXbqiKz8PN0waSNvroMtvAK6tY7g/wPdNWGEP+JTNIBr6A==", "dev": true, "requires": { "config-chain": "^1.1.12", "editorconfig": "^0.15.3", "glob": "^7.1.3", - "mkdirp": "~0.5.1", - "nopt": "~4.0.1" + "mkdirp": "~1.0.3", + "nopt": "^4.0.3" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } } }, "js-tokens": { @@ -2368,6 +2255,15 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -2605,16 +2501,10 @@ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", "dev": true, "requires": { "abbrev": "1", @@ -2685,59 +2575,6 @@ "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true - }, - "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", - "dev": true - }, - "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - } } }, "once": { @@ -2864,9 +2701,9 @@ "dev": true }, "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { @@ -3095,9 +2932,9 @@ } }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, "request": { @@ -3276,13 +3113,10 @@ } }, "run-async": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", - "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true }, "run-parallel": { "version": "1.1.9", @@ -3339,18 +3173,18 @@ "dev": true }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "should": { @@ -3459,9 +3293,9 @@ "dev": true }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "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", @@ -3475,9 +3309,9 @@ "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "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", @@ -3839,30 +3673,12 @@ "string-width": "^3.0.0" }, "dependencies": { - "ajv": { - "version": "6.12.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", - "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", - "dev": true - }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -3963,6 +3779,18 @@ "punycode": "^2.1.1" } }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", @@ -4049,9 +3877,9 @@ "dev": true }, "v8-compile-cache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", - "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", "dev": true }, "validate-npm-package-license": { @@ -4134,9 +3962,9 @@ } }, "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" diff --git a/package.json b/package.json index def1216b97..cee77eeaf4 100644 --- a/package.json +++ b/package.json @@ -38,24 +38,24 @@ "node": "*" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^3.0.0", - "@typescript-eslint/parser": "^3.0.0", - "clean-css": "^4.2.1", + "@typescript-eslint/eslint-plugin": "^3.2.0", + "@typescript-eslint/parser": "^3.2.0", + "clean-css": "^4.2.3", "cli-table": "^0.3.1", "colors": "^1.1.2", - "commander": "^5.0.0", + "commander": "^5.1.0", "del": "^5.1.0", "dependency-resolver": "^2.0.1", - "eslint": "^6.8.0", + "eslint": "^7.2.0", "eslint-config-standard": "^14.1.1", - "eslint-plugin-import": "^2.20.2", + "eslint-plugin-import": "^2.21.2", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "glob": "^7.1.4", + "glob": "^7.1.6", "glob-promise": "^3.4.0", "handlebars": "^4.7.6", - "js-beautify": "^1.10.2", + "js-beautify": "^1.11.0", "jsdom": "^16.2.2", "lodash": "^4.17.15", "mocha": "^8.0.1", From b2d19b038882b32935325d7f73531c8dfde2f7c4 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 11 Jun 2020 19:22:51 -0400 Subject: [PATCH 126/816] bump v10.1.0 --- CHANGES.md | 2 +- docs/conf.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 54c2439e17..cc343b00d6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## Version 10.1.0 (in progress) +## Version 10.1.0 New themes: diff --git a/docs/conf.py b/docs/conf.py index a598d03deb..9ab267555e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = '10.0' +version = '10.1' # The full version, including alpha/beta/rc tags. -release = '10.0.0' +release = '10.1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 74de6eaa1d4dddd2ce1b167abda91913a77c48e6 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 11 Jun 2020 19:23:41 -0400 Subject: [PATCH 127/816] (chore) bump copyright --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 9ab267555e..04d6663fda 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,7 +41,7 @@ # General information about the project. project = u'highlight.js' -copyright = u'2012–2018, Ivan Sagalaev' +copyright = u'2012–2020, 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 From b1bce6e3ada485b89696f554878b2ef44a73d94a Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 12 Jun 2020 03:17:46 -0400 Subject: [PATCH 128/816] (chore) more import below metadata comment --- src/languages/ini.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/ini.js b/src/languages/ini.js index fd7377da86..627c4f0702 100644 --- a/src/languages/ini.js +++ b/src/languages/ini.js @@ -1,5 +1,3 @@ -import * as regex from '../lib/regex.js'; - /* Language: TOML, also INI Description: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. @@ -8,6 +6,8 @@ Category: common, config Website: https://github.com/toml-lang/toml */ +import * as regex from '../lib/regex.js'; + export default function(hljs) { var NUMBERS = { className: 'number', From 06565885c7c8d2717b0f8d655c3157f02551686c Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Tue, 16 Jun 2020 09:05:16 -0700 Subject: [PATCH 129/816] (chore) removed dangling comma (#2612) - This causes a syntax error on node 6 and earlier. --- src/languages/java.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/java.js b/src/languages/java.js index a73e9bf5c6..395a80d86a 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -42,7 +42,7 @@ export default function(hljs) { regex.either( regex.concat(SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9'), /\./, SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9')), regex.concat(SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9'), /\.?/), - regex.concat(/\./, SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9')), + regex.concat(/\./, SEQUENCE_ALLOWING_UNDERSCORES('a-fA-F0-9')) ), /([pP][+-]?(\d+))?/, /[fFdDlL]?/ // decimal & fp mixed for simplicity From a4ee4e40263aad8586bfe7d1d0fc42a0683080f7 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 14 Jun 2020 11:05:47 -0400 Subject: [PATCH 130/816] (chore) declare ambient modules for lib/core & languges --- src/highlight.js | 1 + types/index.d.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/highlight.js b/src/highlight.js index 8f59f1ae9c..4f98f38ea5 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -20,6 +20,7 @@ const NO_MATCH = Symbol("nomatch"); /** * @param {any} hljs - object that is extended (legacy) + * @returns {HLJSApi} */ const HLJS = function(hljs) { // Convenience variables for build-in objects diff --git a/types/index.d.ts b/types/index.d.ts index b9eb0d317a..59fd9d1926 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -210,3 +210,22 @@ interface ModeDetails { subLanguage?: string | string[] compiled?: boolean } + +// deprecated API since v10 +// declare module 'highlight.js/lib/highlight.js'; + +declare module 'highlight.js' { + export = hljs; +} + +declare module 'highlight.js/lib/core' { + export = hljs; +} + +declare module 'highlight.js/lib/core.js' { + export = hljs; +} + +declare module 'highlight.js/lib/languages/*' { + export default function(hljs?: HLJSApi): LanguageDetail; +} From c5783d2ffca795ccbae7045f66553adaf78303a2 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 16 Jun 2020 12:13:46 -0400 Subject: [PATCH 131/816] (chore) clean up types just a little --- types/index.d.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 59fd9d1926..5bfe98a07c 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -3,7 +3,9 @@ // eslint-disable-next-line declare const hljs : HLJSApi; -interface HLJSApi { +type HLJSApi = PublicApi & ModesAPI + +interface PublicApi { highlight: (languageName: string, code: string, ignoreIllegals?: boolean, continuation?: Mode) => HighlightResult highlightAuto: (code: string, languageSubset?: string[]) => AutoHighlightResult fixMarkup: (html: string) => string @@ -24,7 +26,7 @@ interface HLJSApi { versionString: string } -interface HLJSApi { +interface ModesAPI { SHEBANG: (mode?: Partial & {binary?: string | RegExp}) => Mode BACKSLASH_ESCAPE: Mode QUOTE_STRING_MODE: Mode @@ -43,7 +45,7 @@ interface HLJSApi { UNDERSCORE_TITLE_MODE: Mode METHOD_GUARD: Mode END_SAME_AS_BEGIN: (mode: Mode) => Mode - // build in regex + // built in regex IDENT_RE: string UNDERSCORE_IDENT_RE: string NUMBER_RE: string @@ -52,13 +54,7 @@ interface HLJSApi { RE_STARTERS_RE: string } -type LanguageFn = (hljs: HLJSApi) => Language - -// interface RawLanguage { -// name?: string -// aliases?: string[] -// rawDefinition?: () => Language -// } +type LanguageFn = (hljs?: HLJSApi) => Language interface HighlightResult { relevance : number @@ -73,6 +69,7 @@ interface HighlightResult { // * for auto-highlight second_best? : Omit } +interface AutoHighlightResult extends HighlightResult {} interface illegalData { msg: string @@ -80,16 +77,15 @@ interface illegalData { mode: CompiledMode } -interface AutoHighlightResult extends HighlightResult { -} - type PluginEvent = 'before:highlight' | 'after:highlight' | 'before:highlightBlock' | 'after:highlightBlock' -type HLJSPlugin = { [K in PluginEvent]? : any } +type HLJSPlugin = { + [K in PluginEvent]? : any +} interface EmitterConstructor { new (opts: any): Emitter From 93fd0d7335e2b8b94dd122dc2898db8c86343257 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 16 Jun 2020 12:20:09 -0400 Subject: [PATCH 132/816] bump v10.1.1; (chore) add changelog for 10.1.1 --- CHANGES.md | 11 +++++++++++ docs/conf.py | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cc343b00d6..7dde7b4582 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,14 @@ +## Version 10.1.1 + +Fixes: + +- Resolve issue on Node 6 due to dangling comma (#2608) [Edwin Hoogerbeets][] +- Resolve `index.d.ts is not a module` error (#2603) [Josh Goebel][] + +[Josh Goebel]: https://github.com/yyyc514 +[Edwin Hoogerbeets]: https://github.com/ehoogerbeets + + ## Version 10.1.0 New themes: diff --git a/docs/conf.py b/docs/conf.py index 04d6663fda..08dad766f9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,7 +50,7 @@ # The short X.Y version. version = '10.1' # The full version, including alpha/beta/rc tags. -release = '10.1.0' +release = '10.1.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/package-lock.json b/package-lock.json index 1e222dd86d..e4a829a203 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "highlight.js", - "version": "10.1.0", + "version": "10.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cee77eeaf4..2fc3a729c2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "10.1.0", + "version": "10.1.1", "author": { "name": "Ivan Sagalaev", "email": "maniac@softwaremaniacs.org" From 54d1ed068ae0834bb817c91c71b6f92715465654 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 17 Jun 2020 13:11:46 -0400 Subject: [PATCH 133/816] (chore) update docs to match issue template --- docs/language-requests.rst | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/docs/language-requests.rst b/docs/language-requests.rst index c8f33d9d02..c67ff676e5 100644 --- a/docs/language-requests.rst +++ b/docs/language-requests.rst @@ -4,14 +4,25 @@ On requesting new languages This is a general answer to requests for adding new languages that appear from time to time in the highlight.js issue tracker and discussion group. - Highlight.js doesn't have a fundamental plan for implementing languages, - instead the project works by encouraging development of 3rd party language - grammars from contributors. We're also happy to host 3rd party language - grammars at the ``highlightjs`` GitHub organization - no matter how obscure - or weird. + Highlight.js does not have a fundamental plan for implementing new languages + - i.e., the core team doesn't usually develop new languages. The core team + instead focuses on parser development, bugs, and supporting the existing + languages. They also currently does not have time to review, merge and + maintain any additional languages (fixing bugs, dealing with issues, etc). + + Instead, the project works by encouraging 3rd party language grammars from + contributors willing to help develop and maintain them. We're also happy to + host those 3rd party language grammars at the ``highlightjs`` GitHub + organization - no matter how obscure or weird. Or you're wlecome to host it + yourself - we're still happy to link to it. + + This means that *there's no point in requesting a new language without also + providing a 3rd party implementation* (we'll simply close "Please support + language Xyz" issues with a link to this explanation). If you'd like to see + a particular language available but cannot implement it, the best way to + make it happen is to find another developer interested in doing so. + + For more info on actually developing a language see our :doc:`language-guide`, + and for information on how to properly package your 3rd party language module + see :doc:`language-contribution`. - This means that *there's no point in requesting a new language without - providing an implementation for it*. If you want to see a particular language - included in highlight.js but cannot implement it, the best way to make it - happen is to get another developer interested in doing so. Here's our - :doc:`language-guide`. From ab5083b2fc61e1cb7fec270186613d3cdb437245 Mon Sep 17 00:00:00 2001 From: Samia <39127633+samiaab1990@users.noreply.github.com> Date: Sat, 27 Jun 2020 23:35:30 -0400 Subject: [PATCH 134/816] New Style: Gradient Light (#2616) --- CHANGES.md | 8 +++ src/styles/gradient-light.css | 130 ++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 src/styles/gradient-light.css diff --git a/CHANGES.md b/CHANGES.md index 7dde7b4582..717db18a5a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,11 @@ +## Version 10.2.0 (next up) + +New themes: + +- *Gradient Light* by [Samia Ali]() + +[Samia Ali]: https://github.com/samiaab1990 + ## Version 10.1.1 Fixes: diff --git a/src/styles/gradient-light.css b/src/styles/gradient-light.css new file mode 100644 index 0000000000..801a136f4f --- /dev/null +++ b/src/styles/gradient-light.css @@ -0,0 +1,130 @@ +/* + +Gradient Light (c) Samia Ali + +*/ + +.hljs +{ +display: block; +overflow-x: auto; +padding: 0.5em; +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%); +color:#250482; +} + +.hljs-subtr{ +color:#01958B; +} + +.hljs-doctag, +.hljs-meta, +.hljs-comment, +.hljs-quote +{ + color:#CB7200; +} + +.hljs-selector-tag, +.hljs-selector-id, +.hljs-template-tag, +.hljs-regexp, +.hljs-attr, +.hljs-tag +{ + color:#07BD5F; +} + +.hljs-params, +.hljs-selector-class, +.hljs-bullet + +{ + color:#43449F; + +} + +.hljs-keyword, +.hljs-section, +.hljs-meta-keyword, +.hljs-symbol, +.hljs-type + +{ + + color:#7D2801; +} + +.hljs-addition, +.hljs-number, +.hljs-link +{ + color:#7F0096; +} + + +.hljs-string +{ + color: #38c0ff; +} + + +.hljs-attribute, +.hljs-addition +{ + color:#296562; +} + +.hljs-variable, +.hljs-template-variable + +{ + color:#025C8F; +} + +.hljs-builtin-name, +.hljs-built_in, +.hljs-formula, +.hljs-name, +.hljs-title, +.hljs-class, +.hljs-function +{ + color: #529117; + +} + +.hljs-selector-pseudo, +.hljs-deletion, +.hljs-literal +{ + color:#AD13FF; + +} + +.hljs-emphasis, +.hljs-quote +{ + font-style:italic; +} + +.hljs-params, +.hljs-selector-class, +.hljs-strong, +.hljs-selector-tag, +.hljs-selector-id, +.hljs-template-tag, +.hljs-section, +.hljs-keyword +{ + font-weight:bold; +} + + + + + + + + From 7bd0d62e016c72e4da83aea78db133c7413f80fd Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Mon, 29 Jun 2020 16:01:58 -0400 Subject: [PATCH 135/816] enh(matlab) add "arguments" keyword and fix "enumeration" (#2619) --- CHANGES.md | 6 ++++++ src/languages/matlab.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 717db18a5a..3b9b3db00f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,8 +4,14 @@ New themes: - *Gradient Light* by [Samia Ali]() +Language Improvements: + +- enh(matlab) Add new R2019b `arguments` keyword and fix `enumeration` keyword (#2619) [Andrew Janke][] + +[Andrew Janke]: https://github.com/apjanke [Samia Ali]: https://github.com/samiaab1990 + ## Version 10.1.1 Fixes: diff --git a/src/languages/matlab.js b/src/languages/matlab.js index a3d0cde8b0..0a75e8a5b0 100644 --- a/src/languages/matlab.js +++ b/src/languages/matlab.js @@ -24,7 +24,7 @@ export default function(hljs) { name: 'Matlab', keywords: { keyword: - 'break case catch classdef continue else elseif end enumerated events for function ' + + 'arguments break case catch classdef continue else elseif end enumeration events for function ' + 'global if methods otherwise parfor persistent properties return spmd switch try while', built_in: 'sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan ' + From 465c2fe9e4964e10c239552f2fac912a547adbba Mon Sep 17 00:00:00 2001 From: kageru Date: Thu, 2 Jul 2020 16:01:33 +0200 Subject: [PATCH 136/816] (kotlin) remove very old keywords and update example code (#2623) Removes obsolete Kotlin keywords and updates example. - These are no longer valid Kotlin keywords. (and there removal from the grammar was suggested years ago) - Also remove the `trait` usage from the example and format the code according to the Kotlin coding conventions. Reference: https://github.com/highlightjs/highlight.js/commit/af601cb4ca53fdbf6cd8f33f9ea9603581691113 --- CHANGES.md | 2 ++ src/languages/kotlin.js | 4 +--- test/detect/kotlin/default.txt | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3b9b3db00f..b530661178 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,9 +7,11 @@ New themes: Language Improvements: - enh(matlab) Add new R2019b `arguments` keyword and fix `enumeration` keyword (#2619) [Andrew Janke][] +- fix(kotlin) Remove very old keywords and update example code (#2623) [kageru][] [Andrew Janke]: https://github.com/apjanke [Samia Ali]: https://github.com/samiaab1990 +[kageru]: https://github.com/kageru ## Version 10.1.1 diff --git a/src/languages/kotlin.js b/src/languages/kotlin.js index f1d368c020..fe19c386d8 100644 --- a/src/languages/kotlin.js +++ b/src/languages/kotlin.js @@ -14,9 +14,7 @@ export default function(hljs) { 'crossinline dynamic final enum if else do while for when throw try catch finally ' + 'import package is in fun override companion reified inline lateinit init ' + 'interface annotation data sealed internal infix operator out by constructor super ' + - 'tailrec where const inner suspend typealias external expect actual ' + - // to be deleted soon - 'trait volatile transient native default', + 'tailrec where const inner suspend typealias external expect actual', built_in: 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing', literal: diff --git a/test/detect/kotlin/default.txt b/test/detect/kotlin/default.txt index 5360533a2e..024f3cc94d 100644 --- a/test/detect/kotlin/default.txt +++ b/test/detect/kotlin/default.txt @@ -1,12 +1,12 @@ import kotlin.lang.test -trait A { +interface A { fun x() } -fun xxx() : Int { - return 888 +fun xxx(): Int { + return 888 } -public fun main(args : Array) { +public fun main(args: Array) { } From eec9b8481c7c36ab959f3eee9a75301641d4e601 Mon Sep 17 00:00:00 2001 From: Alireza Rezaee Date: Sun, 5 Jul 2020 17:53:20 +0430 Subject: [PATCH 137/816] (chore) Update CDN urls to version 10.1.1 (#2627) --- README.md | 10 +++++----- README.ru.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dd596c099c..445e0489b1 100644 --- a/README.md +++ b/README.md @@ -199,19 +199,19 @@ A prebuilt version of highlight.js bundled with many common languages is hosted ```html - + href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css"> + + src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/languages/go.min.js"> ``` **jsdelivr** ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) ```html - + href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.1.1/build/styles/default.min.css"> + ``` **Note:** *The CDN-hosted `highlight.min.js` package doesn't bundle every language.* It would be diff --git a/README.ru.md b/README.ru.md index a448e217ed..7f7badc8e8 100644 --- a/README.ru.md +++ b/README.ru.md @@ -108,7 +108,7 @@ Highlight.js можно использовать в браузере прямо ```html + src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/languages/go.min.js"> ``` **Про Almond.** Нужно задать имя модуля в оптимизаторе, например: From d8692db1efa893b4b9e22ca0dbd96c64cc8da8c4 Mon Sep 17 00:00:00 2001 From: Zack Date: Mon, 20 Jul 2020 17:22:42 -0700 Subject: [PATCH 138/816] (parser) use null prototype objects for languages/aliases (#2636) Fix: Discord uses getLanguage to validate that a language specified exists in highlightJS and retrieve metadata about the language for code block highlighting in chat. Because highlightJS returns prototype values instead of the highlight languages themselves, the result is a few different bugs in our clients which expect the return type to be only `Language | undefined`. --- CHANGES.md | 2 ++ src/highlight.js | 4 ++-- test/api/getLanguage.js | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b530661178..c641b19cfd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,10 +8,12 @@ Language Improvements: - enh(matlab) Add new R2019b `arguments` keyword and fix `enumeration` keyword (#2619) [Andrew Janke][] - fix(kotlin) Remove very old keywords and update example code (#2623) [kageru][] +- fix(night) Prevent object prototypes method values from being returned in `getLanguage` (#2636) [night][] [Andrew Janke]: https://github.com/apjanke [Samia Ali]: https://github.com/samiaab1990 [kageru]: https://github.com/kageru +[night]: https://github.com/night ## Version 10.1.1 diff --git a/src/highlight.js b/src/highlight.js index 4f98f38ea5..b16efe83a0 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -29,9 +29,9 @@ const HLJS = function(hljs) { // Global internal variables used within the highlight.js library. /** @type {Record} */ - var languages = {}; + var languages = Object.create(null); /** @type {Record} */ - var aliases = {}; + var aliases = Object.create(null); /** @type {HLJSPlugin[]} */ var plugins = []; diff --git a/test/api/getLanguage.js b/test/api/getLanguage.js index d2654a4f63..ae14ebb92e 100644 --- a/test/api/getLanguage.js +++ b/test/api/getLanguage.js @@ -41,4 +41,16 @@ describe('.getLanguage()', () => { result.should.have.property('aliases').with.containEql('cs'); should.strictEqual(result, hljs.getLanguage('csharp')) }); + + it('should not succeed for constructor', () => { + const result = hljs.getLanguage('constructor'); + + should.strictEqual(result, undefined); + }); + + it('should not succeed for __proto__', () => { + const result = hljs.getLanguage('__proto__'); + + should.strictEqual(result, undefined); + }); }); From e3665447f9b345c6a562986385353dffc018ce59 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 21 Jul 2020 07:07:15 -0400 Subject: [PATCH 139/816] (arduion) no longer has all the C/C++ aliases Resolves #2626. The mistake is that Arduino language incorrectly picks up the aliases of C++. This is because it inherits from C++ but does not strip off the aliases. This affects functionaltiy. It seems that later-registered languages' aliases overwrite any earlier registration. Since Arduino is registered after C++ (because the former requires the latter), calling getLanguage('c++') will give Arduino (arduino with alias c++) instead of C++ (cpp with alias c++). --- src/languages/arduino.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/languages/arduino.js b/src/languages/arduino.js index 823e20395c..ce105003c7 100644 --- a/src/languages/arduino.js +++ b/src/languages/arduino.js @@ -104,6 +104,7 @@ export default function(hljs) { kws.built_in += ' ' + ARDUINO_KW.built_in; ARDUINO.name = 'Arduino'; + ARDUINO.aliases = ['ino']; return ARDUINO; } From 7f63502b1cd7fda116a8731f74d4af1a203a179a Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 21 Jul 2020 07:18:57 -0400 Subject: [PATCH 140/816] (chore) add alias overlap table Related #2626. --- SUPPORTED_LANGUAGES.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 482595f134..bef0f0de66 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -169,6 +169,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Shell | shell, console | | | Smali | smali | | | Smalltalk | smalltalk, st | | +| SML | sml, ml | | | Solidity | solidity, sol | [highlightjs-solidity](https://github.com/highlightjs/highlightjs-solidity) | | Stan | stan, stanfuncs | | | Stata | stata | | @@ -201,5 +202,18 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | Zephir | zephir, zep | | + +## Alias Overlap + +If you are using either of these languages at the same time please be sure to +use the full name and not the alias to avoid any ambiguity. + +| Language | Overlap | +| :-----------------------| :--------------------- | +| SML | ml | +| OCaml | ml | +| Lasso | ls | +| LiveScript | ls | + [1]: https://github.com/highlightjs/highlight.js#getting-the-library From 1809bca77c35039cb268ed863cf191572f275510 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Fri, 24 Jul 2020 09:13:47 -0400 Subject: [PATCH 141/816] (chore) bump lodash dependency --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e4a829a203..9bddb911e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2308,9 +2308,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, "lodash.sortby": { diff --git a/package.json b/package.json index 2fc3a729c2..408bd412ce 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "handlebars": "^4.7.6", "js-beautify": "^1.11.0", "jsdom": "^16.2.2", - "lodash": "^4.17.15", + "lodash": "^4.17.19", "mocha": "^8.0.1", "rollup": "^2.0.0", "rollup-plugin-commonjs": "^10.1.0", From 8dcdddd4552bf0de6f84ab3a129426f73a7fa73d Mon Sep 17 00:00:00 2001 From: Gabriel Staples Date: Mon, 27 Jul 2020 07:01:52 -0700 Subject: [PATCH 142/816] (chore) Update SUPPORTED_LANGUAGES.md to add `arduino` (#2639) --- SUPPORTED_LANGUAGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index bef0f0de66..468730cb26 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -12,6 +12,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu | ABNF | abnf | | | Access logs | accesslog | | | Ada | ada | | +| Arduino (C++ w/Arduino libs) | arduino ino | | | ARM assembler | armasm, arm | | | AVR assembler | avrasm | | | ActionScript | actionscript, as | | From a2a7db5d8f9cfdb28c99751fed9a55d17631511d Mon Sep 17 00:00:00 2001 From: ezksd Date: Mon, 3 Aug 2020 09:12:41 +0800 Subject: [PATCH 143/816] enh(java) class definitions could start with keyword `enum` (#2643) --- CHANGES.md | 2 ++ src/languages/java.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c641b19cfd..27f3dae26c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,11 +9,13 @@ Language Improvements: - enh(matlab) Add new R2019b `arguments` keyword and fix `enumeration` keyword (#2619) [Andrew Janke][] - fix(kotlin) Remove very old keywords and update example code (#2623) [kageru][] - fix(night) Prevent object prototypes method values from being returned in `getLanguage` (#2636) [night][] +- enh(java) Add support for `enum`, which will identify as a `class` now (#2643) [ezksd][] [Andrew Janke]: https://github.com/apjanke [Samia Ali]: https://github.com/samiaab1990 [kageru]: https://github.com/kageru [night]: https://github.com/night +[ezksd]: https://github.com/ezksd ## Version 10.1.1 diff --git a/src/languages/java.js b/src/languages/java.js index 395a80d86a..13ae1c5fc2 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -98,8 +98,8 @@ export default function(hljs) { hljs.QUOTE_STRING_MODE, { className: 'class', - beginKeywords: 'class interface', end: /[{;=]/, excludeEnd: true, - keywords: 'class interface', + beginKeywords: 'class interface enum', end: /[{;=]/, excludeEnd: true, + keywords: 'class interface enum', illegal: /[:"\[\]]/, contains: [ { beginKeywords: 'extends implements' }, From bc7c2a1dc4445d79e38976d903a4d3c8b1e2e1ff Mon Sep 17 00:00:00 2001 From: Alireza Rezaee Date: Wed, 5 Aug 2020 01:02:50 +0430 Subject: [PATCH 144/816] (chore) Update CDN urls to version 10.1.2 (#2645) --- README.md | 10 +++++----- README.ru.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 445e0489b1..03b249a37e 100644 --- a/README.md +++ b/README.md @@ -199,19 +199,19 @@ A prebuilt version of highlight.js bundled with many common languages is hosted ```html - + href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/styles/default.min.css"> + + src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/languages/go.min.js"> ``` **jsdelivr** ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) ```html - + href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.1.2/build/styles/default.min.css"> + ``` **Note:** *The CDN-hosted `highlight.min.js` package doesn't bundle every language.* It would be diff --git a/README.ru.md b/README.ru.md index 7f7badc8e8..26afb40106 100644 --- a/README.ru.md +++ b/README.ru.md @@ -108,7 +108,7 @@ Highlight.js можно использовать в браузере прямо ```html + src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/languages/go.min.js"> ``` **Про Almond.** Нужно задать имя модуля в оптимизаторе, например: From d3aa27fe73d20f6aa4bdd64804a78cc60988e29e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 5 Aug 2020 21:56:47 -0400 Subject: [PATCH 145/816] (chore) document support for older versions --- OLD_VERSIONS.md | 14 ++++++++++++++ README.md | 9 ++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 OLD_VERSIONS.md diff --git a/OLD_VERSIONS.md b/OLD_VERSIONS.md new file mode 100644 index 0000000000..e287aeac34 --- /dev/null +++ b/OLD_VERSIONS.md @@ -0,0 +1,14 @@ +## Support for Older Versions + +Due to both time and resource constrains the Highlight.js core team only fully supports the most current major version of the library. The prior major release will only receive critical security updates (when feasible). + +| Version | Status | EOL | +| :-----: | :------------ | :-: | - | +| 10.x | *Current.* Regular updates; bug fixes & new features. | n/a | +| 9.18.x | *Deprecated.* Security updates only. See [VERSION_10_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md). | TBD | +| < 9.17.x | Obsolete. | Jan 2020 | +| 8.x | Obsolete. | | +| 7.x | Obsolete. | | +| Older | Obsolete. | | + +Support for IE11 is really the only reason anyone should still prefer version 9. It's recommended that everyone else upgrade. diff --git a/README.md b/README.md index 03b249a37e..16f1c62046 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ the browser as well as on the server. It works with pretty much any markup, doesn’t depend on any framework, and has automatic language detection. -## Upgrading from Version 9 +#### Upgrading to Version 10 Version 10 is one of the biggest releases in quite some time. If you're upgrading from version 9, there are some breaking changes and things you may @@ -15,11 +15,14 @@ want to double check first. Please read [VERSION_10_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md) for high-level summary of breaking changes and any actions you may need to take. See [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_BREAKING_CHANGES.md) for a more detailed list and [CHANGES.md](https://github.com/highlightjs/highlight.js/blob/master/CHANGES.md) to learn what else is new. +##### Support for older versions + +Please see [OLD_VERSIONS.md](https://github.com/highlightjs/highlight.js/blob/master/OLD_VERSIONS.md) for support information. + ## Getting Started The bare minimum for using highlight.js on a web page is linking to the -library along with one of the styles and calling -[`initHighlightingOnLoad`][1]: +library along with one of the styles and calling [`initHighlightingOnLoad`][1]: ```html From bf5b797c788b0e8fe71bbe82b5a871f79e52967b Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 5 Aug 2020 21:58:56 -0400 Subject: [PATCH 146/816] (chore) Fix broken encoding of Markdown table --- OLD_VERSIONS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OLD_VERSIONS.md b/OLD_VERSIONS.md index e287aeac34..62b9ea014d 100644 --- a/OLD_VERSIONS.md +++ b/OLD_VERSIONS.md @@ -3,7 +3,7 @@ Due to both time and resource constrains the Highlight.js core team only fully supports the most current major version of the library. The prior major release will only receive critical security updates (when feasible). | Version | Status | EOL | -| :-----: | :------------ | :-: | - | +| :-----: | :------ | :-: | | 10.x | *Current.* Regular updates; bug fixes & new features. | n/a | | 9.18.x | *Deprecated.* Security updates only. See [VERSION_10_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md). | TBD | | < 9.17.x | Obsolete. | Jan 2020 | From 8965ebe6967f5adcb8d848b9de695e7dca41b995 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 5 Aug 2020 22:28:30 -0400 Subject: [PATCH 147/816] (parser) Add basic Vue.js component and examples. (#2544) - add basic Vue.js component - add simple usage case to the README - eat our own dogfood with `tools/developer.html` now using the Vue plugin just for fun --- CHANGES.md | 5 + README.md | 20 + demo/vue.js | 11965 +++++++++++++++++++++++++++++++++++++++++ src/highlight.js | 5 +- src/plugins/vue.js | 63 + tools/developer.html | 27 +- 6 files changed, 12077 insertions(+), 8 deletions(-) create mode 100644 demo/vue.js create mode 100644 src/plugins/vue.js diff --git a/CHANGES.md b/CHANGES.md index 27f3dae26c..c098bc8690 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ New themes: - *Gradient Light* by [Samia Ali]() +Big picture: + +- Add simple Vue plugin for basic use cases (#2544) [Josh Goebel][] + Language Improvements: - enh(matlab) Add new R2019b `arguments` keyword and fix `enumeration` keyword (#2619) [Andrew Janke][] @@ -11,6 +15,7 @@ Language Improvements: - fix(night) Prevent object prototypes method values from being returned in `getLanguage` (#2636) [night][] - enh(java) Add support for `enum`, which will identify as a `class` now (#2643) [ezksd][] +[Josh Goebel]: https://github.com/yyyc514 [Andrew Janke]: https://github.com/apjanke [Samia Ali]: https://github.com/samiaab1990 [kageru]: https://github.com/kageru diff --git a/README.md b/README.md index 16f1c62046..81d81faefb 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,26 @@ document.querySelectorAll('div.code').forEach((block) => { For other options refer to the documentation for [`configure`][4]. +## Using with Vue.js + +Simply register the plugin with Vue: + +```js +Vue.use(hljs.vuePlugin); +``` + +And you'll be provided with a `highlightjs` component for use +in your templates: + +```html +
+ + + + +
+``` + ## Web Workers You can run highlighting inside a web worker to avoid freezing the browser diff --git a/demo/vue.js b/demo/vue.js new file mode 100644 index 0000000000..e22cf13003 --- /dev/null +++ b/demo/vue.js @@ -0,0 +1,11965 @@ +/*! + * Vue.js v2.6.11 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.Vue = factory()); +}(this, function () { 'use strict'; + + /* */ + + var emptyObject = Object.freeze({}); + + // These helpers produce better VM code in JS engines due to their + // explicitness and function inlining. + function isUndef (v) { + return v === undefined || v === null + } + + function isDef (v) { + return v !== undefined && v !== null + } + + function isTrue (v) { + return v === true + } + + function isFalse (v) { + return v === false + } + + /** + * Check if value is primitive. + */ + function isPrimitive (value) { + return ( + typeof value === 'string' || + typeof value === 'number' || + // $flow-disable-line + typeof value === 'symbol' || + typeof value === 'boolean' + ) + } + + /** + * Quick object check - this is primarily used to tell + * Objects from primitive values when we know the value + * is a JSON-compliant type. + */ + function isObject (obj) { + return obj !== null && typeof obj === 'object' + } + + /** + * Get the raw type string of a value, e.g., [object Object]. + */ + var _toString = Object.prototype.toString; + + function toRawType (value) { + return _toString.call(value).slice(8, -1) + } + + /** + * Strict object type check. Only returns true + * for plain JavaScript objects. + */ + function isPlainObject (obj) { + return _toString.call(obj) === '[object Object]' + } + + function isRegExp (v) { + return _toString.call(v) === '[object RegExp]' + } + + /** + * Check if val is a valid array index. + */ + function isValidArrayIndex (val) { + var n = parseFloat(String(val)); + return n >= 0 && Math.floor(n) === n && isFinite(val) + } + + function isPromise (val) { + return ( + isDef(val) && + typeof val.then === 'function' && + typeof val.catch === 'function' + ) + } + + /** + * Convert a value to a string that is actually rendered. + */ + function toString (val) { + return val == null + ? '' + : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) + ? JSON.stringify(val, null, 2) + : String(val) + } + + /** + * Convert an input value to a number for persistence. + * If the conversion fails, return original string. + */ + function toNumber (val) { + var n = parseFloat(val); + return isNaN(n) ? val : n + } + + /** + * Make a map and return a function for checking if a key + * is in that map. + */ + function makeMap ( + str, + expectsLowerCase + ) { + var map = Object.create(null); + var list = str.split(','); + for (var i = 0; i < list.length; i++) { + map[list[i]] = true; + } + return expectsLowerCase + ? function (val) { return map[val.toLowerCase()]; } + : function (val) { return map[val]; } + } + + /** + * Check if a tag is a built-in tag. + */ + var isBuiltInTag = makeMap('slot,component', true); + + /** + * Check if an attribute is a reserved attribute. + */ + var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); + + /** + * Remove an item from an array. + */ + function remove (arr, item) { + if (arr.length) { + var index = arr.indexOf(item); + if (index > -1) { + return arr.splice(index, 1) + } + } + } + + /** + * Check whether an object has the property. + */ + var hasOwnProperty = Object.prototype.hasOwnProperty; + function hasOwn (obj, key) { + return hasOwnProperty.call(obj, key) + } + + /** + * Create a cached version of a pure function. + */ + function cached (fn) { + var cache = Object.create(null); + return (function cachedFn (str) { + var hit = cache[str]; + return hit || (cache[str] = fn(str)) + }) + } + + /** + * Camelize a hyphen-delimited string. + */ + var camelizeRE = /-(\w)/g; + var camelize = cached(function (str) { + return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) + }); + + /** + * Capitalize a string. + */ + var capitalize = cached(function (str) { + return str.charAt(0).toUpperCase() + str.slice(1) + }); + + /** + * Hyphenate a camelCase string. + */ + var hyphenateRE = /\B([A-Z])/g; + var hyphenate = cached(function (str) { + return str.replace(hyphenateRE, '-$1').toLowerCase() + }); + + /** + * Simple bind polyfill for environments that do not support it, + * e.g., PhantomJS 1.x. Technically, we don't need this anymore + * since native bind is now performant enough in most browsers. + * But removing it would mean breaking code that was able to run in + * PhantomJS 1.x, so this must be kept for backward compatibility. + */ + + /* istanbul ignore next */ + function polyfillBind (fn, ctx) { + function boundFn (a) { + var l = arguments.length; + return l + ? l > 1 + ? fn.apply(ctx, arguments) + : fn.call(ctx, a) + : fn.call(ctx) + } + + boundFn._length = fn.length; + return boundFn + } + + function nativeBind (fn, ctx) { + return fn.bind(ctx) + } + + var bind = Function.prototype.bind + ? nativeBind + : polyfillBind; + + /** + * Convert an Array-like object to a real Array. + */ + function toArray (list, start) { + start = start || 0; + var i = list.length - start; + var ret = new Array(i); + while (i--) { + ret[i] = list[i + start]; + } + return ret + } + + /** + * Mix properties into target object. + */ + function extend (to, _from) { + for (var key in _from) { + to[key] = _from[key]; + } + return to + } + + /** + * Merge an Array of Objects into a single Object. + */ + function toObject (arr) { + var res = {}; + for (var i = 0; i < arr.length; i++) { + if (arr[i]) { + extend(res, arr[i]); + } + } + return res + } + + /* eslint-disable no-unused-vars */ + + /** + * Perform no operation. + * Stubbing args to make Flow happy without leaving useless transpiled code + * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). + */ + function noop (a, b, c) {} + + /** + * Always return false. + */ + var no = function (a, b, c) { return false; }; + + /* eslint-enable no-unused-vars */ + + /** + * Return the same value. + */ + var identity = function (_) { return _; }; + + /** + * Generate a string containing static keys from compiler modules. + */ + function genStaticKeys (modules) { + return modules.reduce(function (keys, m) { + return keys.concat(m.staticKeys || []) + }, []).join(',') + } + + /** + * Check if two values are loosely equal - that is, + * if they are plain objects, do they have the same shape? + */ + function looseEqual (a, b) { + if (a === b) { return true } + var isObjectA = isObject(a); + var isObjectB = isObject(b); + if (isObjectA && isObjectB) { + try { + var isArrayA = Array.isArray(a); + var isArrayB = Array.isArray(b); + if (isArrayA && isArrayB) { + return a.length === b.length && a.every(function (e, i) { + return looseEqual(e, b[i]) + }) + } else if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime() + } else if (!isArrayA && !isArrayB) { + var keysA = Object.keys(a); + var keysB = Object.keys(b); + return keysA.length === keysB.length && keysA.every(function (key) { + return looseEqual(a[key], b[key]) + }) + } else { + /* istanbul ignore next */ + return false + } + } catch (e) { + /* istanbul ignore next */ + return false + } + } else if (!isObjectA && !isObjectB) { + return String(a) === String(b) + } else { + return false + } + } + + /** + * Return the first index at which a loosely equal value can be + * found in the array (if value is a plain object, the array must + * contain an object of the same shape), or -1 if it is not present. + */ + function looseIndexOf (arr, val) { + for (var i = 0; i < arr.length; i++) { + if (looseEqual(arr[i], val)) { return i } + } + return -1 + } + + /** + * Ensure a function is called only once. + */ + function once (fn) { + var called = false; + return function () { + if (!called) { + called = true; + fn.apply(this, arguments); + } + } + } + + var SSR_ATTR = 'data-server-rendered'; + + var ASSET_TYPES = [ + 'component', + 'directive', + 'filter' + ]; + + var LIFECYCLE_HOOKS = [ + 'beforeCreate', + 'created', + 'beforeMount', + 'mounted', + 'beforeUpdate', + 'updated', + 'beforeDestroy', + 'destroyed', + 'activated', + 'deactivated', + 'errorCaptured', + 'serverPrefetch' + ]; + + /* */ + + + + var config = ({ + /** + * Option merge strategies (used in core/util/options) + */ + // $flow-disable-line + optionMergeStrategies: Object.create(null), + + /** + * Whether to suppress warnings. + */ + silent: false, + + /** + * Show production mode tip message on boot? + */ + productionTip: "development" !== 'production', + + /** + * Whether to enable devtools + */ + devtools: "development" !== 'production', + + /** + * Whether to record perf + */ + performance: false, + + /** + * Error handler for watcher errors + */ + errorHandler: null, + + /** + * Warn handler for watcher warns + */ + warnHandler: null, + + /** + * Ignore certain custom elements + */ + ignoredElements: [], + + /** + * Custom user key aliases for v-on + */ + // $flow-disable-line + keyCodes: Object.create(null), + + /** + * Check if a tag is reserved so that it cannot be registered as a + * component. This is platform-dependent and may be overwritten. + */ + isReservedTag: no, + + /** + * Check if an attribute is reserved so that it cannot be used as a component + * prop. This is platform-dependent and may be overwritten. + */ + isReservedAttr: no, + + /** + * Check if a tag is an unknown element. + * Platform-dependent. + */ + isUnknownElement: no, + + /** + * Get the namespace of an element + */ + getTagNamespace: noop, + + /** + * Parse the real tag name for the specific platform. + */ + parsePlatformTagName: identity, + + /** + * Check if an attribute must be bound using property, e.g. value + * Platform-dependent. + */ + mustUseProp: no, + + /** + * Perform updates asynchronously. Intended to be used by Vue Test Utils + * This will significantly reduce performance if set to false. + */ + async: true, + + /** + * Exposed for legacy reasons + */ + _lifecycleHooks: LIFECYCLE_HOOKS + }); + + /* */ + + /** + * unicode letters used for parsing html tags, component names and property paths. + * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname + * skipping \u10000-\uEFFFF due to it freezing up PhantomJS + */ + var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/; + + /** + * Check if a string starts with $ or _ + */ + function isReserved (str) { + var c = (str + '').charCodeAt(0); + return c === 0x24 || c === 0x5F + } + + /** + * Define a property. + */ + function def (obj, key, val, enumerable) { + Object.defineProperty(obj, key, { + value: val, + enumerable: !!enumerable, + writable: true, + configurable: true + }); + } + + /** + * Parse simple path. + */ + var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]")); + function parsePath (path) { + if (bailRE.test(path)) { + return + } + var segments = path.split('.'); + return function (obj) { + for (var i = 0; i < segments.length; i++) { + if (!obj) { return } + obj = obj[segments[i]]; + } + return obj + } + } + + /* */ + + // can we use __proto__? + var hasProto = '__proto__' in {}; + + // Browser environment sniffing + var inBrowser = typeof window !== 'undefined'; + var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; + var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); + var UA = inBrowser && window.navigator.userAgent.toLowerCase(); + var isIE = UA && /msie|trident/.test(UA); + var isIE9 = UA && UA.indexOf('msie 9.0') > 0; + var isEdge = UA && UA.indexOf('edge/') > 0; + var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); + var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); + var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; + var isPhantomJS = UA && /phantomjs/.test(UA); + var isFF = UA && UA.match(/firefox\/(\d+)/); + + // Firefox has a "watch" function on Object.prototype... + var nativeWatch = ({}).watch; + + var supportsPassive = false; + if (inBrowser) { + try { + var opts = {}; + Object.defineProperty(opts, 'passive', ({ + get: function get () { + /* istanbul ignore next */ + supportsPassive = true; + } + })); // https://github.com/facebook/flow/issues/285 + window.addEventListener('test-passive', null, opts); + } catch (e) {} + } + + // this needs to be lazy-evaled because vue may be required before + // vue-server-renderer can set VUE_ENV + var _isServer; + var isServerRendering = function () { + if (_isServer === undefined) { + /* istanbul ignore if */ + if (!inBrowser && !inWeex && typeof global !== 'undefined') { + // detect presence of vue-server-renderer and avoid + // Webpack shimming the process + _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; + } else { + _isServer = false; + } + } + return _isServer + }; + + // detect devtools + var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; + + /* istanbul ignore next */ + function isNative (Ctor) { + return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) + } + + var hasSymbol = + typeof Symbol !== 'undefined' && isNative(Symbol) && + typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); + + var _Set; + /* istanbul ignore if */ // $flow-disable-line + if (typeof Set !== 'undefined' && isNative(Set)) { + // use native Set when available. + _Set = Set; + } else { + // a non-standard Set polyfill that only works with primitive keys. + _Set = /*@__PURE__*/(function () { + function Set () { + this.set = Object.create(null); + } + Set.prototype.has = function has (key) { + return this.set[key] === true + }; + Set.prototype.add = function add (key) { + this.set[key] = true; + }; + Set.prototype.clear = function clear () { + this.set = Object.create(null); + }; + + return Set; + }()); + } + + /* */ + + var warn = noop; + var tip = noop; + var generateComponentTrace = (noop); // work around flow check + var formatComponentName = (noop); + + { + var hasConsole = typeof console !== 'undefined'; + var classifyRE = /(?:^|[-_])(\w)/g; + var classify = function (str) { return str + .replace(classifyRE, function (c) { return c.toUpperCase(); }) + .replace(/[-_]/g, ''); }; + + warn = function (msg, vm) { + var trace = vm ? generateComponentTrace(vm) : ''; + + if (config.warnHandler) { + config.warnHandler.call(null, msg, vm, trace); + } else if (hasConsole && (!config.silent)) { + console.error(("[Vue warn]: " + msg + trace)); + } + }; + + tip = function (msg, vm) { + if (hasConsole && (!config.silent)) { + console.warn("[Vue tip]: " + msg + ( + vm ? generateComponentTrace(vm) : '' + )); + } + }; + + formatComponentName = function (vm, includeFile) { + if (vm.$root === vm) { + return '' + } + var options = typeof vm === 'function' && vm.cid != null + ? vm.options + : vm._isVue + ? vm.$options || vm.constructor.options + : vm; + var name = options.name || options._componentTag; + var file = options.__file; + if (!name && file) { + var match = file.match(/([^/\\]+)\.vue$/); + name = match && match[1]; + } + + return ( + (name ? ("<" + (classify(name)) + ">") : "") + + (file && includeFile !== false ? (" at " + file) : '') + ) + }; + + var repeat = function (str, n) { + var res = ''; + while (n) { + if (n % 2 === 1) { res += str; } + if (n > 1) { str += str; } + n >>= 1; + } + return res + }; + + generateComponentTrace = function (vm) { + if (vm._isVue && vm.$parent) { + var tree = []; + var currentRecursiveSequence = 0; + while (vm) { + if (tree.length > 0) { + var last = tree[tree.length - 1]; + if (last.constructor === vm.constructor) { + currentRecursiveSequence++; + vm = vm.$parent; + continue + } else if (currentRecursiveSequence > 0) { + tree[tree.length - 1] = [last, currentRecursiveSequence]; + currentRecursiveSequence = 0; + } + } + tree.push(vm); + vm = vm.$parent; + } + return '\n\nfound in\n\n' + tree + .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) + ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") + : formatComponentName(vm))); }) + .join('\n') + } else { + return ("\n\n(found in " + (formatComponentName(vm)) + ")") + } + }; + } + + /* */ + + var uid = 0; + + /** + * A dep is an observable that can have multiple + * directives subscribing to it. + */ + var Dep = function Dep () { + this.id = uid++; + this.subs = []; + }; + + Dep.prototype.addSub = function addSub (sub) { + this.subs.push(sub); + }; + + Dep.prototype.removeSub = function removeSub (sub) { + remove(this.subs, sub); + }; + + Dep.prototype.depend = function depend () { + if (Dep.target) { + Dep.target.addDep(this); + } + }; + + Dep.prototype.notify = function notify () { + // stabilize the subscriber list first + var subs = this.subs.slice(); + if (!config.async) { + // subs aren't sorted in scheduler if not running async + // we need to sort them now to make sure they fire in correct + // order + subs.sort(function (a, b) { return a.id - b.id; }); + } + for (var i = 0, l = subs.length; i < l; i++) { + subs[i].update(); + } + }; + + // The current target watcher being evaluated. + // This is globally unique because only one watcher + // can be evaluated at a time. + Dep.target = null; + var targetStack = []; + + function pushTarget (target) { + targetStack.push(target); + Dep.target = target; + } + + function popTarget () { + targetStack.pop(); + Dep.target = targetStack[targetStack.length - 1]; + } + + /* */ + + var VNode = function VNode ( + tag, + data, + children, + text, + elm, + context, + componentOptions, + asyncFactory + ) { + this.tag = tag; + this.data = data; + this.children = children; + this.text = text; + this.elm = elm; + this.ns = undefined; + this.context = context; + this.fnContext = undefined; + this.fnOptions = undefined; + this.fnScopeId = undefined; + this.key = data && data.key; + this.componentOptions = componentOptions; + this.componentInstance = undefined; + this.parent = undefined; + this.raw = false; + this.isStatic = false; + this.isRootInsert = true; + this.isComment = false; + this.isCloned = false; + this.isOnce = false; + this.asyncFactory = asyncFactory; + this.asyncMeta = undefined; + this.isAsyncPlaceholder = false; + }; + + var prototypeAccessors = { child: { configurable: true } }; + + // DEPRECATED: alias for componentInstance for backwards compat. + /* istanbul ignore next */ + prototypeAccessors.child.get = function () { + return this.componentInstance + }; + + Object.defineProperties( VNode.prototype, prototypeAccessors ); + + var createEmptyVNode = function (text) { + if ( text === void 0 ) text = ''; + + var node = new VNode(); + node.text = text; + node.isComment = true; + return node + }; + + function createTextVNode (val) { + return new VNode(undefined, undefined, undefined, String(val)) + } + + // optimized shallow clone + // used for static nodes and slot nodes because they may be reused across + // multiple renders, cloning them avoids errors when DOM manipulations rely + // on their elm reference. + function cloneVNode (vnode) { + var cloned = new VNode( + vnode.tag, + vnode.data, + // #7975 + // clone children array to avoid mutating original in case of cloning + // a child. + vnode.children && vnode.children.slice(), + vnode.text, + vnode.elm, + vnode.context, + vnode.componentOptions, + vnode.asyncFactory + ); + cloned.ns = vnode.ns; + cloned.isStatic = vnode.isStatic; + cloned.key = vnode.key; + cloned.isComment = vnode.isComment; + cloned.fnContext = vnode.fnContext; + cloned.fnOptions = vnode.fnOptions; + cloned.fnScopeId = vnode.fnScopeId; + cloned.asyncMeta = vnode.asyncMeta; + cloned.isCloned = true; + return cloned + } + + /* + * not type checking this file because flow doesn't play well with + * dynamically accessing methods on Array prototype + */ + + var arrayProto = Array.prototype; + var arrayMethods = Object.create(arrayProto); + + var methodsToPatch = [ + 'push', + 'pop', + 'shift', + 'unshift', + 'splice', + 'sort', + 'reverse' + ]; + + /** + * Intercept mutating methods and emit events + */ + methodsToPatch.forEach(function (method) { + // cache original method + var original = arrayProto[method]; + def(arrayMethods, method, function mutator () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + var result = original.apply(this, args); + var ob = this.__ob__; + var inserted; + switch (method) { + case 'push': + case 'unshift': + inserted = args; + break + case 'splice': + inserted = args.slice(2); + break + } + if (inserted) { ob.observeArray(inserted); } + // notify change + ob.dep.notify(); + return result + }); + }); + + /* */ + + var arrayKeys = Object.getOwnPropertyNames(arrayMethods); + + /** + * In some cases we may want to disable observation inside a component's + * update computation. + */ + var shouldObserve = true; + + function toggleObserving (value) { + shouldObserve = value; + } + + /** + * Observer class that is attached to each observed + * object. Once attached, the observer converts the target + * object's property keys into getter/setters that + * collect dependencies and dispatch updates. + */ + var Observer = function Observer (value) { + this.value = value; + this.dep = new Dep(); + this.vmCount = 0; + def(value, '__ob__', this); + if (Array.isArray(value)) { + if (hasProto) { + protoAugment(value, arrayMethods); + } else { + copyAugment(value, arrayMethods, arrayKeys); + } + this.observeArray(value); + } else { + this.walk(value); + } + }; + + /** + * Walk through all properties and convert them into + * getter/setters. This method should only be called when + * value type is Object. + */ + Observer.prototype.walk = function walk (obj) { + var keys = Object.keys(obj); + for (var i = 0; i < keys.length; i++) { + defineReactive$$1(obj, keys[i]); + } + }; + + /** + * Observe a list of Array items. + */ + Observer.prototype.observeArray = function observeArray (items) { + for (var i = 0, l = items.length; i < l; i++) { + observe(items[i]); + } + }; + + // helpers + + /** + * Augment a target Object or Array by intercepting + * the prototype chain using __proto__ + */ + function protoAugment (target, src) { + /* eslint-disable no-proto */ + target.__proto__ = src; + /* eslint-enable no-proto */ + } + + /** + * Augment a target Object or Array by defining + * hidden properties. + */ + /* istanbul ignore next */ + function copyAugment (target, src, keys) { + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + def(target, key, src[key]); + } + } + + /** + * Attempt to create an observer instance for a value, + * returns the new observer if successfully observed, + * or the existing observer if the value already has one. + */ + function observe (value, asRootData) { + if (!isObject(value) || value instanceof VNode) { + return + } + var ob; + if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { + ob = value.__ob__; + } else if ( + shouldObserve && + !isServerRendering() && + (Array.isArray(value) || isPlainObject(value)) && + Object.isExtensible(value) && + !value._isVue + ) { + ob = new Observer(value); + } + if (asRootData && ob) { + ob.vmCount++; + } + return ob + } + + /** + * Define a reactive property on an Object. + */ + function defineReactive$$1 ( + obj, + key, + val, + customSetter, + shallow + ) { + var dep = new Dep(); + + var property = Object.getOwnPropertyDescriptor(obj, key); + if (property && property.configurable === false) { + return + } + + // cater for pre-defined getter/setters + var getter = property && property.get; + var setter = property && property.set; + if ((!getter || setter) && arguments.length === 2) { + val = obj[key]; + } + + var childOb = !shallow && observe(val); + Object.defineProperty(obj, key, { + enumerable: true, + configurable: true, + get: function reactiveGetter () { + var value = getter ? getter.call(obj) : val; + if (Dep.target) { + dep.depend(); + if (childOb) { + childOb.dep.depend(); + if (Array.isArray(value)) { + dependArray(value); + } + } + } + return value + }, + set: function reactiveSetter (newVal) { + var value = getter ? getter.call(obj) : val; + /* eslint-disable no-self-compare */ + if (newVal === value || (newVal !== newVal && value !== value)) { + return + } + /* eslint-enable no-self-compare */ + if (customSetter) { + customSetter(); + } + // #7981: for accessor properties without setter + if (getter && !setter) { return } + if (setter) { + setter.call(obj, newVal); + } else { + val = newVal; + } + childOb = !shallow && observe(newVal); + dep.notify(); + } + }); + } + + /** + * Set a property on an object. Adds the new property and + * triggers change notification if the property doesn't + * already exist. + */ + function set (target, key, val) { + if (isUndef(target) || isPrimitive(target) + ) { + warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); + } + if (Array.isArray(target) && isValidArrayIndex(key)) { + target.length = Math.max(target.length, key); + target.splice(key, 1, val); + return val + } + if (key in target && !(key in Object.prototype)) { + target[key] = val; + return val + } + var ob = (target).__ob__; + if (target._isVue || (ob && ob.vmCount)) { + warn( + 'Avoid adding reactive properties to a Vue instance or its root $data ' + + 'at runtime - declare it upfront in the data option.' + ); + return val + } + if (!ob) { + target[key] = val; + return val + } + defineReactive$$1(ob.value, key, val); + ob.dep.notify(); + return val + } + + /** + * Delete a property and trigger change if necessary. + */ + function del (target, key) { + if (isUndef(target) || isPrimitive(target) + ) { + warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); + } + if (Array.isArray(target) && isValidArrayIndex(key)) { + target.splice(key, 1); + return + } + var ob = (target).__ob__; + if (target._isVue || (ob && ob.vmCount)) { + warn( + 'Avoid deleting properties on a Vue instance or its root $data ' + + '- just set it to null.' + ); + return + } + if (!hasOwn(target, key)) { + return + } + delete target[key]; + if (!ob) { + return + } + ob.dep.notify(); + } + + /** + * Collect dependencies on array elements when the array is touched, since + * we cannot intercept array element access like property getters. + */ + function dependArray (value) { + for (var e = (void 0), i = 0, l = value.length; i < l; i++) { + e = value[i]; + e && e.__ob__ && e.__ob__.dep.depend(); + if (Array.isArray(e)) { + dependArray(e); + } + } + } + + /* */ + + /** + * Option overwriting strategies are functions that handle + * how to merge a parent option value and a child option + * value into the final value. + */ + var strats = config.optionMergeStrategies; + + /** + * Options with restrictions + */ + { + strats.el = strats.propsData = function (parent, child, vm, key) { + if (!vm) { + warn( + "option \"" + key + "\" can only be used during instance " + + 'creation with the `new` keyword.' + ); + } + return defaultStrat(parent, child) + }; + } + + /** + * Helper that recursively merges two data objects together. + */ + function mergeData (to, from) { + if (!from) { return to } + var key, toVal, fromVal; + + var keys = hasSymbol + ? Reflect.ownKeys(from) + : Object.keys(from); + + for (var i = 0; i < keys.length; i++) { + key = keys[i]; + // in case the object is already observed... + if (key === '__ob__') { continue } + toVal = to[key]; + fromVal = from[key]; + if (!hasOwn(to, key)) { + set(to, key, fromVal); + } else if ( + toVal !== fromVal && + isPlainObject(toVal) && + isPlainObject(fromVal) + ) { + mergeData(toVal, fromVal); + } + } + return to + } + + /** + * Data + */ + function mergeDataOrFn ( + parentVal, + childVal, + vm + ) { + if (!vm) { + // in a Vue.extend merge, both should be functions + if (!childVal) { + return parentVal + } + if (!parentVal) { + return childVal + } + // when parentVal & childVal are both present, + // we need to return a function that returns the + // merged result of both functions... no need to + // check if parentVal is a function here because + // it has to be a function to pass previous merges. + return function mergedDataFn () { + return mergeData( + typeof childVal === 'function' ? childVal.call(this, this) : childVal, + typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal + ) + } + } else { + return function mergedInstanceDataFn () { + // instance merge + var instanceData = typeof childVal === 'function' + ? childVal.call(vm, vm) + : childVal; + var defaultData = typeof parentVal === 'function' + ? parentVal.call(vm, vm) + : parentVal; + if (instanceData) { + return mergeData(instanceData, defaultData) + } else { + return defaultData + } + } + } + } + + strats.data = function ( + parentVal, + childVal, + vm + ) { + if (!vm) { + if (childVal && typeof childVal !== 'function') { + warn( + 'The "data" option should be a function ' + + 'that returns a per-instance value in component ' + + 'definitions.', + vm + ); + + return parentVal + } + return mergeDataOrFn(parentVal, childVal) + } + + return mergeDataOrFn(parentVal, childVal, vm) + }; + + /** + * Hooks and props are merged as arrays. + */ + function mergeHook ( + parentVal, + childVal + ) { + var res = childVal + ? parentVal + ? parentVal.concat(childVal) + : Array.isArray(childVal) + ? childVal + : [childVal] + : parentVal; + return res + ? dedupeHooks(res) + : res + } + + function dedupeHooks (hooks) { + var res = []; + for (var i = 0; i < hooks.length; i++) { + if (res.indexOf(hooks[i]) === -1) { + res.push(hooks[i]); + } + } + return res + } + + LIFECYCLE_HOOKS.forEach(function (hook) { + strats[hook] = mergeHook; + }); + + /** + * Assets + * + * When a vm is present (instance creation), we need to do + * a three-way merge between constructor options, instance + * options and parent options. + */ + function mergeAssets ( + parentVal, + childVal, + vm, + key + ) { + var res = Object.create(parentVal || null); + if (childVal) { + assertObjectType(key, childVal, vm); + return extend(res, childVal) + } else { + return res + } + } + + ASSET_TYPES.forEach(function (type) { + strats[type + 's'] = mergeAssets; + }); + + /** + * Watchers. + * + * Watchers hashes should not overwrite one + * another, so we merge them as arrays. + */ + strats.watch = function ( + parentVal, + childVal, + vm, + key + ) { + // work around Firefox's Object.prototype.watch... + if (parentVal === nativeWatch) { parentVal = undefined; } + if (childVal === nativeWatch) { childVal = undefined; } + /* istanbul ignore if */ + if (!childVal) { return Object.create(parentVal || null) } + { + assertObjectType(key, childVal, vm); + } + if (!parentVal) { return childVal } + var ret = {}; + extend(ret, parentVal); + for (var key$1 in childVal) { + var parent = ret[key$1]; + var child = childVal[key$1]; + if (parent && !Array.isArray(parent)) { + parent = [parent]; + } + ret[key$1] = parent + ? parent.concat(child) + : Array.isArray(child) ? child : [child]; + } + return ret + }; + + /** + * Other object hashes. + */ + strats.props = + strats.methods = + strats.inject = + strats.computed = function ( + parentVal, + childVal, + vm, + key + ) { + if (childVal && "development" !== 'production') { + assertObjectType(key, childVal, vm); + } + if (!parentVal) { return childVal } + var ret = Object.create(null); + extend(ret, parentVal); + if (childVal) { extend(ret, childVal); } + return ret + }; + strats.provide = mergeDataOrFn; + + /** + * Default strategy. + */ + var defaultStrat = function (parentVal, childVal) { + return childVal === undefined + ? parentVal + : childVal + }; + + /** + * Validate component names + */ + function checkComponents (options) { + for (var key in options.components) { + validateComponentName(key); + } + } + + function validateComponentName (name) { + if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) { + warn( + 'Invalid component name: "' + name + '". Component names ' + + 'should conform to valid custom element name in html5 specification.' + ); + } + if (isBuiltInTag(name) || config.isReservedTag(name)) { + warn( + 'Do not use built-in or reserved HTML elements as component ' + + 'id: ' + name + ); + } + } + + /** + * Ensure all props option syntax are normalized into the + * Object-based format. + */ + function normalizeProps (options, vm) { + var props = options.props; + if (!props) { return } + var res = {}; + var i, val, name; + if (Array.isArray(props)) { + i = props.length; + while (i--) { + val = props[i]; + if (typeof val === 'string') { + name = camelize(val); + res[name] = { type: null }; + } else { + warn('props must be strings when using array syntax.'); + } + } + } else if (isPlainObject(props)) { + for (var key in props) { + val = props[key]; + name = camelize(key); + res[name] = isPlainObject(val) + ? val + : { type: val }; + } + } else { + warn( + "Invalid value for option \"props\": expected an Array or an Object, " + + "but got " + (toRawType(props)) + ".", + vm + ); + } + options.props = res; + } + + /** + * Normalize all injections into Object-based format + */ + function normalizeInject (options, vm) { + var inject = options.inject; + if (!inject) { return } + var normalized = options.inject = {}; + if (Array.isArray(inject)) { + for (var i = 0; i < inject.length; i++) { + normalized[inject[i]] = { from: inject[i] }; + } + } else if (isPlainObject(inject)) { + for (var key in inject) { + var val = inject[key]; + normalized[key] = isPlainObject(val) + ? extend({ from: key }, val) + : { from: val }; + } + } else { + warn( + "Invalid value for option \"inject\": expected an Array or an Object, " + + "but got " + (toRawType(inject)) + ".", + vm + ); + } + } + + /** + * Normalize raw function directives into object format. + */ + function normalizeDirectives (options) { + var dirs = options.directives; + if (dirs) { + for (var key in dirs) { + var def$$1 = dirs[key]; + if (typeof def$$1 === 'function') { + dirs[key] = { bind: def$$1, update: def$$1 }; + } + } + } + } + + function assertObjectType (name, value, vm) { + if (!isPlainObject(value)) { + warn( + "Invalid value for option \"" + name + "\": expected an Object, " + + "but got " + (toRawType(value)) + ".", + vm + ); + } + } + + /** + * Merge two option objects into a new one. + * Core utility used in both instantiation and inheritance. + */ + function mergeOptions ( + parent, + child, + vm + ) { + { + checkComponents(child); + } + + if (typeof child === 'function') { + child = child.options; + } + + normalizeProps(child, vm); + normalizeInject(child, vm); + normalizeDirectives(child); + + // Apply extends and mixins on the child options, + // but only if it is a raw options object that isn't + // the result of another mergeOptions call. + // Only merged options has the _base property. + if (!child._base) { + if (child.extends) { + parent = mergeOptions(parent, child.extends, vm); + } + if (child.mixins) { + for (var i = 0, l = child.mixins.length; i < l; i++) { + parent = mergeOptions(parent, child.mixins[i], vm); + } + } + } + + var options = {}; + var key; + for (key in parent) { + mergeField(key); + } + for (key in child) { + if (!hasOwn(parent, key)) { + mergeField(key); + } + } + function mergeField (key) { + var strat = strats[key] || defaultStrat; + options[key] = strat(parent[key], child[key], vm, key); + } + return options + } + + /** + * Resolve an asset. + * This function is used because child instances need access + * to assets defined in its ancestor chain. + */ + function resolveAsset ( + options, + type, + id, + warnMissing + ) { + /* istanbul ignore if */ + if (typeof id !== 'string') { + return + } + var assets = options[type]; + // check local registration variations first + if (hasOwn(assets, id)) { return assets[id] } + var camelizedId = camelize(id); + if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } + var PascalCaseId = capitalize(camelizedId); + if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } + // fallback to prototype chain + var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; + if (warnMissing && !res) { + warn( + 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, + options + ); + } + return res + } + + /* */ + + + + function validateProp ( + key, + propOptions, + propsData, + vm + ) { + var prop = propOptions[key]; + var absent = !hasOwn(propsData, key); + var value = propsData[key]; + // boolean casting + var booleanIndex = getTypeIndex(Boolean, prop.type); + if (booleanIndex > -1) { + if (absent && !hasOwn(prop, 'default')) { + value = false; + } else if (value === '' || value === hyphenate(key)) { + // only cast empty string / same name to boolean if + // boolean has higher priority + var stringIndex = getTypeIndex(String, prop.type); + if (stringIndex < 0 || booleanIndex < stringIndex) { + value = true; + } + } + } + // check default value + if (value === undefined) { + value = getPropDefaultValue(vm, prop, key); + // since the default value is a fresh copy, + // make sure to observe it. + var prevShouldObserve = shouldObserve; + toggleObserving(true); + observe(value); + toggleObserving(prevShouldObserve); + } + { + assertProp(prop, key, value, vm, absent); + } + return value + } + + /** + * Get the default value of a prop. + */ + function getPropDefaultValue (vm, prop, key) { + // no default, return undefined + if (!hasOwn(prop, 'default')) { + return undefined + } + var def = prop.default; + // warn against non-factory defaults for Object & Array + if (isObject(def)) { + warn( + 'Invalid default value for prop "' + key + '": ' + + 'Props with type Object/Array must use a factory function ' + + 'to return the default value.', + vm + ); + } + // the raw prop value was also undefined from previous render, + // return previous default value to avoid unnecessary watcher trigger + if (vm && vm.$options.propsData && + vm.$options.propsData[key] === undefined && + vm._props[key] !== undefined + ) { + return vm._props[key] + } + // call factory function for non-Function types + // a value is Function if its prototype is function even across different execution context + return typeof def === 'function' && getType(prop.type) !== 'Function' + ? def.call(vm) + : def + } + + /** + * Assert whether a prop is valid. + */ + function assertProp ( + prop, + name, + value, + vm, + absent + ) { + if (prop.required && absent) { + warn( + 'Missing required prop: "' + name + '"', + vm + ); + return + } + if (value == null && !prop.required) { + return + } + var type = prop.type; + var valid = !type || type === true; + var expectedTypes = []; + if (type) { + if (!Array.isArray(type)) { + type = [type]; + } + for (var i = 0; i < type.length && !valid; i++) { + var assertedType = assertType(value, type[i]); + expectedTypes.push(assertedType.expectedType || ''); + valid = assertedType.valid; + } + } + + if (!valid) { + warn( + getInvalidTypeMessage(name, value, expectedTypes), + vm + ); + return + } + var validator = prop.validator; + if (validator) { + if (!validator(value)) { + warn( + 'Invalid prop: custom validator check failed for prop "' + name + '".', + vm + ); + } + } + } + + var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; + + function assertType (value, type) { + var valid; + var expectedType = getType(type); + if (simpleCheckRE.test(expectedType)) { + var t = typeof value; + valid = t === expectedType.toLowerCase(); + // for primitive wrapper objects + if (!valid && t === 'object') { + valid = value instanceof type; + } + } else if (expectedType === 'Object') { + valid = isPlainObject(value); + } else if (expectedType === 'Array') { + valid = Array.isArray(value); + } else { + valid = value instanceof type; + } + return { + valid: valid, + expectedType: expectedType + } + } + + /** + * Use function string name to check built-in types, + * because a simple equality check will fail when running + * across different vms / iframes. + */ + function getType (fn) { + var match = fn && fn.toString().match(/^\s*function (\w+)/); + return match ? match[1] : '' + } + + function isSameType (a, b) { + return getType(a) === getType(b) + } + + function getTypeIndex (type, expectedTypes) { + if (!Array.isArray(expectedTypes)) { + return isSameType(expectedTypes, type) ? 0 : -1 + } + for (var i = 0, len = expectedTypes.length; i < len; i++) { + if (isSameType(expectedTypes[i], type)) { + return i + } + } + return -1 + } + + function getInvalidTypeMessage (name, value, expectedTypes) { + var message = "Invalid prop: type check failed for prop \"" + name + "\"." + + " Expected " + (expectedTypes.map(capitalize).join(', ')); + var expectedType = expectedTypes[0]; + var receivedType = toRawType(value); + var expectedValue = styleValue(value, expectedType); + var receivedValue = styleValue(value, receivedType); + // check if we need to specify expected value + if (expectedTypes.length === 1 && + isExplicable(expectedType) && + !isBoolean(expectedType, receivedType)) { + message += " with value " + expectedValue; + } + message += ", got " + receivedType + " "; + // check if we need to specify received value + if (isExplicable(receivedType)) { + message += "with value " + receivedValue + "."; + } + return message + } + + function styleValue (value, type) { + if (type === 'String') { + return ("\"" + value + "\"") + } else if (type === 'Number') { + return ("" + (Number(value))) + } else { + return ("" + value) + } + } + + function isExplicable (value) { + var explicitTypes = ['string', 'number', 'boolean']; + return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; }) + } + + function isBoolean () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; }) + } + + /* */ + + function handleError (err, vm, info) { + // Deactivate deps tracking while processing error handler to avoid possible infinite rendering. + // See: https://github.com/vuejs/vuex/issues/1505 + pushTarget(); + try { + if (vm) { + var cur = vm; + while ((cur = cur.$parent)) { + var hooks = cur.$options.errorCaptured; + if (hooks) { + for (var i = 0; i < hooks.length; i++) { + try { + var capture = hooks[i].call(cur, err, vm, info) === false; + if (capture) { return } + } catch (e) { + globalHandleError(e, cur, 'errorCaptured hook'); + } + } + } + } + } + globalHandleError(err, vm, info); + } finally { + popTarget(); + } + } + + function invokeWithErrorHandling ( + handler, + context, + args, + vm, + info + ) { + var res; + try { + res = args ? handler.apply(context, args) : handler.call(context); + if (res && !res._isVue && isPromise(res) && !res._handled) { + res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); }); + // issue #9511 + // avoid catch triggering multiple times when nested calls + res._handled = true; + } + } catch (e) { + handleError(e, vm, info); + } + return res + } + + function globalHandleError (err, vm, info) { + if (config.errorHandler) { + try { + return config.errorHandler.call(null, err, vm, info) + } catch (e) { + // if the user intentionally throws the original error in the handler, + // do not log it twice + if (e !== err) { + logError(e, null, 'config.errorHandler'); + } + } + } + logError(err, vm, info); + } + + function logError (err, vm, info) { + { + warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); + } + /* istanbul ignore else */ + if ((inBrowser || inWeex) && typeof console !== 'undefined') { + console.error(err); + } else { + throw err + } + } + + /* */ + + var isUsingMicroTask = false; + + var callbacks = []; + var pending = false; + + function flushCallbacks () { + pending = false; + var copies = callbacks.slice(0); + callbacks.length = 0; + for (var i = 0; i < copies.length; i++) { + copies[i](); + } + } + + // Here we have async deferring wrappers using microtasks. + // In 2.5 we used (macro) tasks (in combination with microtasks). + // However, it has subtle problems when state is changed right before repaint + // (e.g. #6813, out-in transitions). + // Also, using (macro) tasks in event handler would cause some weird behaviors + // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109). + // So we now use microtasks everywhere, again. + // A major drawback of this tradeoff is that there are some scenarios + // where microtasks have too high a priority and fire in between supposedly + // sequential events (e.g. #4521, #6690, which have workarounds) + // or even between bubbling of the same event (#6566). + var timerFunc; + + // The nextTick behavior leverages the microtask queue, which can be accessed + // via either native Promise.then or MutationObserver. + // MutationObserver has wider support, however it is seriously bugged in + // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It + // completely stops working after triggering a few times... so, if native + // Promise is available, we will use it: + /* istanbul ignore next, $flow-disable-line */ + if (typeof Promise !== 'undefined' && isNative(Promise)) { + var p = Promise.resolve(); + timerFunc = function () { + p.then(flushCallbacks); + // In problematic UIWebViews, Promise.then doesn't completely break, but + // it can get stuck in a weird state where callbacks are pushed into the + // microtask queue but the queue isn't being flushed, until the browser + // needs to do some other work, e.g. handle a timer. Therefore we can + // "force" the microtask queue to be flushed by adding an empty timer. + if (isIOS) { setTimeout(noop); } + }; + isUsingMicroTask = true; + } else if (!isIE && typeof MutationObserver !== 'undefined' && ( + isNative(MutationObserver) || + // PhantomJS and iOS 7.x + MutationObserver.toString() === '[object MutationObserverConstructor]' + )) { + // Use MutationObserver where native Promise is not available, + // e.g. PhantomJS, iOS7, Android 4.4 + // (#6466 MutationObserver is unreliable in IE11) + var counter = 1; + var observer = new MutationObserver(flushCallbacks); + var textNode = document.createTextNode(String(counter)); + observer.observe(textNode, { + characterData: true + }); + timerFunc = function () { + counter = (counter + 1) % 2; + textNode.data = String(counter); + }; + isUsingMicroTask = true; + } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { + // Fallback to setImmediate. + // Technically it leverages the (macro) task queue, + // but it is still a better choice than setTimeout. + timerFunc = function () { + setImmediate(flushCallbacks); + }; + } else { + // Fallback to setTimeout. + timerFunc = function () { + setTimeout(flushCallbacks, 0); + }; + } + + function nextTick (cb, ctx) { + var _resolve; + callbacks.push(function () { + if (cb) { + try { + cb.call(ctx); + } catch (e) { + handleError(e, ctx, 'nextTick'); + } + } else if (_resolve) { + _resolve(ctx); + } + }); + if (!pending) { + pending = true; + timerFunc(); + } + // $flow-disable-line + if (!cb && typeof Promise !== 'undefined') { + return new Promise(function (resolve) { + _resolve = resolve; + }) + } + } + + /* */ + + var mark; + var measure; + + { + var perf = inBrowser && window.performance; + /* istanbul ignore if */ + if ( + perf && + perf.mark && + perf.measure && + perf.clearMarks && + perf.clearMeasures + ) { + mark = function (tag) { return perf.mark(tag); }; + measure = function (name, startTag, endTag) { + perf.measure(name, startTag, endTag); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + // perf.clearMeasures(name) + }; + } + } + + /* not type checking this file because flow doesn't play well with Proxy */ + + var initProxy; + + { + var allowedGlobals = makeMap( + 'Infinity,undefined,NaN,isFinite,isNaN,' + + 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + + 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + + 'require' // for Webpack/Browserify + ); + + var warnNonPresent = function (target, key) { + warn( + "Property or method \"" + key + "\" is not defined on the instance but " + + 'referenced during render. Make sure that this property is reactive, ' + + 'either in the data option, or for class-based components, by ' + + 'initializing the property. ' + + 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', + target + ); + }; + + var warnReservedPrefix = function (target, key) { + warn( + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + + 'prevent conflicts with Vue internals. ' + + 'See: https://vuejs.org/v2/api/#data', + target + ); + }; + + var hasProxy = + typeof Proxy !== 'undefined' && isNative(Proxy); + + if (hasProxy) { + var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); + config.keyCodes = new Proxy(config.keyCodes, { + set: function set (target, key, value) { + if (isBuiltInModifier(key)) { + warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); + return false + } else { + target[key] = value; + return true + } + } + }); + } + + var hasHandler = { + has: function has (target, key) { + var has = key in target; + var isAllowed = allowedGlobals(key) || + (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data)); + if (!has && !isAllowed) { + if (key in target.$data) { warnReservedPrefix(target, key); } + else { warnNonPresent(target, key); } + } + return has || !isAllowed + } + }; + + var getHandler = { + get: function get (target, key) { + if (typeof key === 'string' && !(key in target)) { + if (key in target.$data) { warnReservedPrefix(target, key); } + else { warnNonPresent(target, key); } + } + return target[key] + } + }; + + initProxy = function initProxy (vm) { + if (hasProxy) { + // determine which proxy handler to use + var options = vm.$options; + var handlers = options.render && options.render._withStripped + ? getHandler + : hasHandler; + vm._renderProxy = new Proxy(vm, handlers); + } else { + vm._renderProxy = vm; + } + }; + } + + /* */ + + var seenObjects = new _Set(); + + /** + * Recursively traverse an object to evoke all converted + * getters, so that every nested property inside the object + * is collected as a "deep" dependency. + */ + function traverse (val) { + _traverse(val, seenObjects); + seenObjects.clear(); + } + + function _traverse (val, seen) { + var i, keys; + var isA = Array.isArray(val); + if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { + return + } + if (val.__ob__) { + var depId = val.__ob__.dep.id; + if (seen.has(depId)) { + return + } + seen.add(depId); + } + if (isA) { + i = val.length; + while (i--) { _traverse(val[i], seen); } + } else { + keys = Object.keys(val); + i = keys.length; + while (i--) { _traverse(val[keys[i]], seen); } + } + } + + /* */ + + var normalizeEvent = cached(function (name) { + var passive = name.charAt(0) === '&'; + name = passive ? name.slice(1) : name; + var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first + name = once$$1 ? name.slice(1) : name; + var capture = name.charAt(0) === '!'; + name = capture ? name.slice(1) : name; + return { + name: name, + once: once$$1, + capture: capture, + passive: passive + } + }); + + function createFnInvoker (fns, vm) { + function invoker () { + var arguments$1 = arguments; + + var fns = invoker.fns; + if (Array.isArray(fns)) { + var cloned = fns.slice(); + for (var i = 0; i < cloned.length; i++) { + invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler"); + } + } else { + // return handler return value for single handlers + return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler") + } + } + invoker.fns = fns; + return invoker + } + + function updateListeners ( + on, + oldOn, + add, + remove$$1, + createOnceHandler, + vm + ) { + var name, def$$1, cur, old, event; + for (name in on) { + def$$1 = cur = on[name]; + old = oldOn[name]; + event = normalizeEvent(name); + if (isUndef(cur)) { + warn( + "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), + vm + ); + } else if (isUndef(old)) { + if (isUndef(cur.fns)) { + cur = on[name] = createFnInvoker(cur, vm); + } + if (isTrue(event.once)) { + cur = on[name] = createOnceHandler(event.name, cur, event.capture); + } + add(event.name, cur, event.capture, event.passive, event.params); + } else if (cur !== old) { + old.fns = cur; + on[name] = old; + } + } + for (name in oldOn) { + if (isUndef(on[name])) { + event = normalizeEvent(name); + remove$$1(event.name, oldOn[name], event.capture); + } + } + } + + /* */ + + function mergeVNodeHook (def, hookKey, hook) { + if (def instanceof VNode) { + def = def.data.hook || (def.data.hook = {}); + } + var invoker; + var oldHook = def[hookKey]; + + function wrappedHook () { + hook.apply(this, arguments); + // important: remove merged hook to ensure it's called only once + // and prevent memory leak + remove(invoker.fns, wrappedHook); + } + + if (isUndef(oldHook)) { + // no existing hook + invoker = createFnInvoker([wrappedHook]); + } else { + /* istanbul ignore if */ + if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { + // already a merged invoker + invoker = oldHook; + invoker.fns.push(wrappedHook); + } else { + // existing plain hook + invoker = createFnInvoker([oldHook, wrappedHook]); + } + } + + invoker.merged = true; + def[hookKey] = invoker; + } + + /* */ + + function extractPropsFromVNodeData ( + data, + Ctor, + tag + ) { + // we are only extracting raw values here. + // validation and default values are handled in the child + // component itself. + var propOptions = Ctor.options.props; + if (isUndef(propOptions)) { + return + } + var res = {}; + var attrs = data.attrs; + var props = data.props; + if (isDef(attrs) || isDef(props)) { + for (var key in propOptions) { + var altKey = hyphenate(key); + { + var keyInLowerCase = key.toLowerCase(); + if ( + key !== keyInLowerCase && + attrs && hasOwn(attrs, keyInLowerCase) + ) { + tip( + "Prop \"" + keyInLowerCase + "\" is passed to component " + + (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + + " \"" + key + "\". " + + "Note that HTML attributes are case-insensitive and camelCased " + + "props need to use their kebab-case equivalents when using in-DOM " + + "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." + ); + } + } + checkProp(res, props, key, altKey, true) || + checkProp(res, attrs, key, altKey, false); + } + } + return res + } + + function checkProp ( + res, + hash, + key, + altKey, + preserve + ) { + if (isDef(hash)) { + if (hasOwn(hash, key)) { + res[key] = hash[key]; + if (!preserve) { + delete hash[key]; + } + return true + } else if (hasOwn(hash, altKey)) { + res[key] = hash[altKey]; + if (!preserve) { + delete hash[altKey]; + } + return true + } + } + return false + } + + /* */ + + // The template compiler attempts to minimize the need for normalization by + // statically analyzing the template at compile time. + // + // For plain HTML markup, normalization can be completely skipped because the + // generated render function is guaranteed to return Array. There are + // two cases where extra normalization is needed: + + // 1. When the children contains components - because a functional component + // may return an Array instead of a single root. In this case, just a simple + // normalization is needed - if any child is an Array, we flatten the whole + // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep + // because functional components already normalize their own children. + function simpleNormalizeChildren (children) { + for (var i = 0; i < children.length; i++) { + if (Array.isArray(children[i])) { + return Array.prototype.concat.apply([], children) + } + } + return children + } + + // 2. When the children contains constructs that always generated nested Arrays, + // e.g.