diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..1561b367b1 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,71 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true, + "mocha": true + }, + "extends": [ + "eslint:recommended", + "standard" + ], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + }, + "parser": '@typescript-eslint/parser', + "plugins": [ + "@typescript-eslint" + ], + "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","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 + "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": { + "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/.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. 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/.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/AUTHORS.txt b/AUTHORS.txt index 799acc064a..131f873ad8 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -286,3 +286,5 @@ Contributors: - G8t Guy - Samia Ali - Alexandre Grison +- Jim Mason +- lioshi diff --git a/CHANGES.md b/CHANGES.md index 4f9602069c..cc343b00d6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,95 @@ +## Version 10.1.0 + +New themes: + +- *NNFX* and *NNFX-dark* by [Jim Mason][] +- *lioshi* by [lioshi][] + +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][] +- (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][] +- (fix) `fixMarkup` would rarely destroy markup when `useBR` was enabled (#2532) [Josh Goebel][] + +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][] +- `endSameAsBegin` is now deprecated. (#2261) [Josh Goebel][] + +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][] +- 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][] +- 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][] +- 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, 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][] +- fix(toml) Improve key parsing (#2595) [Antoine du Hamel][] + +[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 +[Sam Rawlins]: https://github.com/srawlins +[Sergey Prokhorov]: https://github.com/seriyps +[Nils Knappmeier]: https://github.com/nknapp +[Martin (Lhoerion)]: https://github.com/Lhoerion +[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 + +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 + + +## 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/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 7ffa8f7a23..482595f134 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 | | @@ -40,6 +40,8 @@ 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) | +| 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) | @@ -91,6 +93,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 | | @@ -120,6 +123,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 | | @@ -172,6 +176,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) | @@ -181,7 +186,9 @@ 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 | | | VHDL | vhdl | | | Vala | vala | | diff --git a/docs/api.rst b/docs/api.rst index deb6f496c2..8b5ee44540 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()`` @@ -102,24 +101,32 @@ 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. +``registerAliases(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/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/docs/conf.py b/docs/conf.py index a598d03deb..04d6663fda 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,16 +41,16 @@ # 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 # 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. 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 `_. 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..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 --------- @@ -186,7 +194,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 80% rename from docs/reference.rst rename to docs/mode-reference.rst index d2e4cb1c88..afec714bb0 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 @@ -208,16 +238,22 @@ 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 -^^^^^^^ +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: @@ -228,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/package-lock.json b/package-lock.json index 97ff5ecb65..1e222dd86d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,35 @@ { "name": "highlight.js", - "version": "10.0.0", + "version": "10.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "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.10.1" + } + }, + "@babel/helper-validator-identifier": { + "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.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.10.1", + "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,18 @@ "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/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", @@ -47,6 +85,18 @@ "@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/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", @@ -59,6 +109,74 @@ "integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "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.2.0", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "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/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.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.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": { + "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", @@ -72,33 +190,31 @@ "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": { + "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", - "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": { @@ -112,23 +228,40 @@ } }, "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": { + "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 +296,66 @@ "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" + } + }, "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" + } + }, + "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", "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", @@ -188,9 +369,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": { @@ -234,9 +415,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": { @@ -251,6 +432,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,26 +472,32 @@ } } }, + "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", - "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" @@ -313,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" @@ -327,6 +520,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 +546,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", @@ -405,18 +613,18 @@ "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" } }, "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": { @@ -435,12 +643,29 @@ "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": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "cssom": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", @@ -448,9 +673,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" @@ -471,14 +696,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": { @@ -492,6 +709,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", @@ -556,9 +782,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": { @@ -570,6 +796,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", @@ -577,6 +812,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": { @@ -602,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 } } @@ -615,24 +858,81 @@ "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", - "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", @@ -647,9 +947,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", @@ -659,105 +959,536 @@ "source-map": "~0.6.1" } }, - "esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "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 - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "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=", - "dev": true - }, - "fast-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.0.4.tgz", - "integrity": "sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg==", + "eslint": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.2.0.tgz", + "integrity": "sha512-B3BtEyaDKC5MlfDa2Ha8/D6DsS4fju95zs0hjS3HdGazw+LNayai38A25qMppK37wWGWNYSPOR6oYzlz5MHsRQ==", "dev": true, "requires": { - "@nodelib/fs.stat": "^2.0.1", - "@nodelib/fs.walk": "^1.2.1", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "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", "glob-parent": "^5.0.0", - "is-glob": "^4.0.1", - "merge2": "^1.2.3", - "micromatch": "^4.0.2" + "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.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "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": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "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": { - "fill-range": "^7.0.1" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "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 }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "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": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "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": { + "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 + }, + "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": "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": "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" + } + }, + "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" + } + } + } + }, + "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.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.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.3", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.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 + }, + "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" + } + } + } + }, + "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": "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" + } + }, + "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": "7.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", + "dev": true, + "requires": { + "acorn": "^7.2.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.2.0" + }, + "dependencies": { + "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 + } + } + }, + "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", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "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 + }, + "fast-deep-equal": { + "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": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.0.4.tgz", + "integrity": "sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.1", + "@nodelib/fs.walk": "^1.2.1", + "glob-parent": "^5.0.0", + "is-glob": "^4.0.1", + "merge2": "^1.2.3", + "micromatch": "^4.0.2" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { @@ -787,6 +1518,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", @@ -797,12 +1546,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": { @@ -812,16 +1570,36 @@ "dev": true, "requires": { "is-buffer": "~2.0.3" + } + }, + "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": { - "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 + "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 +1636,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", @@ -871,20 +1655,12 @@ "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": { - "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", @@ -913,6 +1689,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 +1714,12 @@ "slash": "^3.0.0" } }, + "graceful-fs": { + "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": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -936,15 +1727,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": { @@ -990,10 +1782,16 @@ "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", - "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" @@ -1025,6 +1823,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 +1867,120 @@ "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 + }, + "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" + } + } + } + }, "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-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", + "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", @@ -1068,10 +1990,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": { @@ -1101,6 +2029,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", @@ -1119,6 +2053,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-reference": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", @@ -1137,14 +2077,34 @@ } }, "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", + "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 +2120,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", @@ -1172,19 +2138,49 @@ "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", - "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": { + "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", @@ -1202,49 +2198,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": { @@ -1259,12 +2243,27 @@ "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", "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", @@ -1275,14 +2274,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": { @@ -1295,14 +2286,25 @@ "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", - "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": { @@ -1318,12 +2320,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": { @@ -1352,20 +2354,26 @@ "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": { + "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", @@ -1375,52 +2383,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": { @@ -1434,9 +2441,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", @@ -1447,11 +2454,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" + } } } }, @@ -1461,30 +2483,44 @@ "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 }, - "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==", + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", "dev": true, "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" + "abbrev": "1", + "osenv": "^0.1.4" } }, - "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "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": { - "abbrev": "1", - "osenv": "^0.1.4" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-path": { @@ -1505,6 +2541,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", @@ -1523,14 +2565,16 @@ "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=", + "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.2", - "es-abstract": "^1.5.1" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" } }, "once": { @@ -1542,22 +2586,13 @@ "wrappy": "1" } }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "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": { - "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 - } + "mimic-fn": "^2.1.0" } }, "optionator": { @@ -1597,21 +2632,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": { @@ -1629,6 +2664,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 +2700,12 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "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": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -1671,12 +2730,91 @@ "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 + }, + "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", @@ -1690,9 +2828,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": { @@ -1707,19 +2845,102 @@ "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", - "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": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "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", @@ -1729,7 +2950,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", @@ -1739,9 +2960,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": { @@ -1762,6 +2995,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": { @@ -1776,6 +3021,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,16 +3112,31 @@ "estree-walker": "^0.6.1" } }, + "run-async": { + "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", "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", - "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": { @@ -1861,9 +3146,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" @@ -1875,12 +3160,33 @@ "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", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "shebang-command": { + "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": "^3.0.0" + } + }, + "shebang-regex": { + "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": { "version": "13.2.3", "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", @@ -1941,12 +3247,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 +3292,38 @@ "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", "dev": true }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.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", @@ -1990,23 +3345,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": { @@ -2025,6 +3363,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,13 +3626,33 @@ "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", - "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": { @@ -2049,6 +3661,46 @@ "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": { + "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 + }, + "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 +3720,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 +3741,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", @@ -2087,32 +3760,52 @@ } }, "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" } }, + "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", + "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", @@ -2137,21 +3830,32 @@ "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 + }, + "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", - "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 } @@ -2167,11 +3871,27 @@ } }, "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": { + "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": { + "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", @@ -2181,23 +3901,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": { @@ -2210,9 +3922,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": { @@ -2231,20 +3943,28 @@ "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": { - "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" @@ -2272,9 +3992,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": { @@ -2322,10 +4048,19 @@ "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", - "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": { @@ -2353,9 +4088,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", @@ -2367,7 +4102,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": { @@ -2376,6 +4111,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", @@ -2399,9 +4162,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 8a0869a2ac..cee77eeaf4 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" @@ -21,34 +21,51 @@ "url": "git://github.com/highlightjs/highlight.js.git" }, "main": "./lib/index.js", + "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", + "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": { "node": "*" }, "devDependencies": { - "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", - "glob": "^7.1.4", + "eslint": "^7.2.0", + "eslint-config-standard": "^14.1.1", + "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.6", "glob-promise": "^3.4.0", - "handlebars": "^4.5.3", - "js-beautify": "^1.10.2", - "jsdom": "^16.0.1", + "handlebars": "^4.7.6", + "js-beautify": "^1.11.0", + "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", "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 9ce4bd97c3..8f59f1ae9c 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -3,48 +3,55 @@ Syntax highlighting with language autodetection. https://highlightjs.org/ */ -import deepFreeze from './vendor/deep_freeze'; -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; 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. - var languages = {}, - aliases = {}, - plugins = []; + /** @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 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, 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 @@ -52,18 +59,24 @@ 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 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,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} ignore_illegals - 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, ignore_illegals, continuation) { + function highlight(languageName, code, ignoreIllegals, continuation) { + /** @type {{ code: string, language: string, result?: any }} */ var context = { code, language: languageName @@ -107,7 +121,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 @@ -116,56 +130,54 @@ const HLJS = function(hljs) { return result; } - // private highlight that's used internally and does not fire callbacks - function _highlight(languageName, code, ignore_illegals, continuation) { + /** + * 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; - 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 keywordMatch(mode, match) { - var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0]; - return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str]; + /** + * 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]; } function processKeywords() { - var keyword_match, last_index, match, result, buf; - if (!top.keywords) { emitter.addText(mode_buffer); return; } - last_index = 0; - top.lexemesRe.lastIndex = 0; - match = top.lexemesRe.exec(mode_buffer); - buf = ""; + let last_index = 0; + top.keywordPatternRe.lastIndex = 0; + let match = top.keywordPatternRe.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]; } - 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); @@ -173,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 : undefined); - // 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 @@ -192,27 +206,64 @@ const HLJS = function(hljs) { if (top.relevance > 0) { relevance += result.relevance; } - if (explicit) { - continuations[top.subLanguage] = result.top; - } emitter.addSublanguage(result.emitter, result.language); } function processBuffer() { - if (top.subLanguage != null) + if (top.subLanguage != null) { processSubLanguage(); - else + } else { processKeywords(); + } 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"]) { + const resp = new Response(mode); + mode["on:end"](match, resp); + if (resp.ignore) matched = false; + } + + if (matched) { + while (mode.endsParent && mode.parent) { + mode = mode.parent; + } + return mode; + } + } + // 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); + } } + /** + * 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 @@ -227,18 +278,27 @@ 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; - if (new_mode.__onBegin) { - let res = new_mode.__onBegin(match) || {}; - if (res.ignoreMatch) - return doIgnore(lexeme); + const resp = new Response(new_mode); + // first internal before callbacks, then the public ones + 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); } if (new_mode && new_mode.endSameAsBegin) { - new_mode.endRe = regex.escape( lexeme ); + new_mode.endRe = regex.escape(lexeme); } if (new_mode.skip) { @@ -253,14 +313,24 @@ const HLJS = function(hljs) { } } startNewMode(new_mode); + // if (mode["after:begin"]) { + // let resp = new Response(mode); + // mode["after:begin"](match, resp); + // } 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); - var end_mode = endOfMode(top, matchPlusRemainder); - if (!end_mode) { return; } + + var end_mode = endOfMode(top, match, matchPlusRemainder); + if (!end_mode) { return NO_MATCH; } var origin = top; if (origin.skip) { @@ -294,7 +364,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); } @@ -302,50 +372,74 @@ const HLJS = function(hljs) { list.forEach(item => emitter.openNode(item)); } + /** @type {{type?: MatchType, index?: number, rule?: Mode}}} */ var lastMatch = {}; - function processLexeme(text_before_match, match) { - var err; + /** + * 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]; // 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'); + /** @type {AnnotatedError} */ + 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 || '') + '"'); + /** @type {AnnotatedError} */ + 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; + } + } + + // 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; } /* @@ -370,35 +464,39 @@ const HLJS = function(hljs) { throw new Error('Unknown language: "' + languageName + '"'); } - compileLanguage(language); - var top = continuation || language; + var md = compileLanguage(language); + var result = ''; + /** @type {CompiledMode} */ + var top = continuation || md; + /** @type Record */ 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 iterations = 0; + var continueScanAtSamePosition = false; try { - var continueScanAtSamePosition = false; top.matcher.considerAll(); - while (true) { + 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(); } - 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,16 +518,17 @@ 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 { + illegal: false, relevance: 0, value: escape(codeToHighlight), emitter: emitter, @@ -443,7 +542,26 @@ 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 + * @param {string} code + * @returns {HighlightResult} + */ + 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: @@ -453,57 +571,66 @@ 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 = { - relevance: 0, - emitter: new options.__emitter(options), - value: escape(code) - }; - var second_best = result; + var result = justTextHighlightResult(code); + 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; } - /* + /** 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, function(match, p1) { - if (options.useBR && match === '\n') { - return '
'; - } else if (options.tabReplace) { - return p1.replace(/\t/g, options.tabReplace); - } - return ''; + return html.replace(fixMarkupRe, match => { + if (match === '\n') { + return options.useBR ? '
' : match; + } else if (options.tabReplace) { + return match.replace(/\t/g, options.tabReplace); + } + return match; }); } + /** + * 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, - result = [prevClassName.trim()]; + var language = currentLang ? aliases[currentLang] : resultLang; + var result = [prevClassName.trim()]; if (!prevClassName.match(/\bhljs\b/)) { result.push('hljs'); @@ -516,86 +643,99 @@ 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) { - var node, originalStream, result, resultNode, text; - var language = blockLanguage(block); + function highlightBlock(element) { + /** @type HTMLElement */ + let node = null; + const language = blockLanguage(element); - if (shouldNotHighlight(language)) - return; + 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; } - 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: 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 + // TODO: remove with version 11.0 + re: result.relevance, + relavance: result.relevance }; if (result.second_best) { - block.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 }; } } - /* - Updates highlight.js global options with values passed in the form of an object. - */ - function configure(user_options) { - options = inherit(options, user_options); + /** + * 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() { - if (initHighlighting.called) - return; + /** + * 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);
   }
 
-  var PLAINTEXT_LANGUAGE = { disableAutodetect: true };
-
-  function registerLanguage(name, language) {
-    var lang;
-    try { lang = language(hljs); }
-    catch (error) {
-      console.error("Language definition for '{}' could not be registered.".replace("{}", name));
+  /**
+   * Register a language grammar module
+   *
+   * @param {string} languageName
+   * @param {LanguageFn} languageDefinition
+   */
+  function registerLanguage(languageName, languageDefinition) {
+    var lang = null;
+    try {
+      lang = languageDefinition(hljs);
+    } catch (error) {
+      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
@@ -605,51 +745,84 @@ 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) {
-      lang.aliases.forEach(function(alias) {aliases[alias] = 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);
     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;
   }
 
+  /**
+   * @param {string} name - name of the language to retrieve
+   * @returns {Language | undefined}
+   */
   function getLanguage(name) {
     name = (name || '').toLowerCase();
     return languages[name] || languages[aliases[name]];
   }
 
+  /**
+   *
+   * @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.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;
   }
 
-  function addPlugin(plugin, options) {
+  /**
+   * @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) {
+    plugins.forEach(function(plugin) {
       if (plugin[cb]) {
         plugin[cb](args);
       }
@@ -658,7 +831,7 @@ const HLJS = function(hljs) {
 
   /* Interface definition */
 
-  Object.assign(hljs,{
+  Object.assign(hljs, {
     highlight,
     highlightAuto,
     fixMarkup,
@@ -669,6 +842,7 @@ const HLJS = function(hljs) {
     registerLanguage,
     listLanguages,
     getLanguage,
+    registerAliases,
     requireLanguage,
     autoDetection,
     inherit,
@@ -680,8 +854,11 @@ const HLJS = function(hljs) {
   hljs.versionString = packageJSON.version;
 
   for (const key in MODES) {
-    if (typeof MODES[key] === "object")
+    // @ts-ignore
+    if (typeof MODES[key] === "object") {
+      // @ts-ignore
       deepFreeze(MODES[key]);
+    }
   }
 
   // merge all the modes/regexs into our main object
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/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 f7757c47c5..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
@@ -36,7 +37,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/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 f7175f8835..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+
 
@@ -21,8 +22,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/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 da0c41506b..de2c7a46d9 100644
--- a/src/languages/avrasm.js
+++ b/src/languages/avrasm.js
@@ -5,12 +5,13 @@ Category: assembler
 Website: https://www.microchip.com/webdoc/avrassembler/avrassembler.wb_instruction_list.html
 */
 
+/** @type LanguageFn */
 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/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 be9c8c92fc..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 = {
@@ -55,11 +56,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*\{/,
@@ -71,8 +82,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:
@@ -98,7 +109,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/basic.js b/src/languages/basic.js
index 412768219d..c37bedac71 100644
--- a/src/languages/basic.js
+++ b/src/languages/basic.js
@@ -5,14 +5,15 @@ 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',
     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/bnf.js b/src/languages/bnf.js
index 2f9fca8660..d4edc03bc6 100644
--- a/src/languages/bnf.js
+++ b/src/languages/bnf.js
@@ -4,7 +4,8 @@ Website: https://en.wikipedia.org/wiki/Backus–Naur_form
 Author: Oleg Efimov 
 */
 
-export default function(hljs){
+/** @type LanguageFn */
+export default function(hljs) {
   return {
     name: 'Backus–Naur Form',
     contains: [
diff --git a/src/languages/brainfuck.js b/src/languages/brainfuck.js
index 2a9bb07b6d..957d19618b 100644
--- a/src/languages/brainfuck.js
+++ b/src/languages/brainfuck.js
@@ -4,7 +4,8 @@ Author: Evgeny Stepanischev 
 Website: https://esolangs.org/wiki/Brainfuck
 */
 
-export default function(hljs){
+/** @type LanguageFn */
+export default function(hljs) {
   var LITERAL = {
     className: 'literal',
     begin: '[\\+\\-]',
diff --git a/src/languages/c-like.js b/src/languages/c-like.js
index 90e23073ee..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 + ')?';
@@ -44,7 +45,10 @@ export default function(hljs) {
         begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + "|.)", end: '\'',
         illegal: '.'
       },
-      { begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\((?:.|\n)*?\)\1"/ }
+      hljs.END_SAME_AS_BEGIN({
+        begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,
+        end: /\)([^()\\ ]{0,16})"/,
+      })
     ]
   };
 
@@ -103,8 +107,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 ' +
@@ -209,8 +213,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]
       },
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 5be1dfc517..bf0d877810 100644
--- a/src/languages/clojure.js
+++ b/src/languages/clojure.js
@@ -6,9 +6,13 @@ Website: https://clojure.org
 Category: lisp
 */
 
+/** @type LanguageFn */
 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 +45,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 +88,6 @@ export default function(hljs) {
   };
   var NAME = {
     keywords: keywords,
-    lexemes: SYMBOL_RE,
     className: 'name', begin: SYMBOL_RE,
     starts: BODY
   };
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 0defcd5adb..2d6a8f5094 100644
--- a/src/languages/coffeescript.js
+++ b/src/languages/coffeescript.js
@@ -7,21 +7,46 @@ Category: common, scripting
 Website: https://coffeescript.org
 */
 
+import * as ECMAScript from './lib/ecmascript.js';
+
+/** @type LanguageFn */
 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/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 58beb328e8..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))?';
@@ -11,6 +12,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 +189,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/csharp.js b/src/languages/csharp.js
index 8294552c85..8c20e37db9 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:
@@ -90,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 = {
@@ -176,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/src/languages/csp.js b/src/languages/csp.js
index 496b106621..930c381f3c 100644
--- a/src/languages/csp.js
+++ b/src/languages/csp.js
@@ -7,12 +7,13 @@ 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',
     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/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 9d6e482614..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
@@ -30,6 +31,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 +247,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/dart.js b/src/languages/dart.js
index c7101b0643..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 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 ' +
-      // 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
       }
     ]
-  }
+  };
 }
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/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-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 e289bce1fd..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 = {
@@ -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/groovy.js b/src/languages/groovy.js
index 8dfb00767f..014019e72e 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.js';
+
+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/src/languages/handlebars.js b/src/languages/handlebars.js
index 7fea1c3cca..eba95ab210 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.js'
+
 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/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/htmlbars.js b/src/languages/htmlbars.js
index 11a4488107..caca6d4dad 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.js"
 
-  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/languages/hy.js b/src/languages/hy.js
index 4faa8780f8..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,15 +44,8 @@ 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 SHEBANG = {
-    className: 'meta',
-    begin: '^#!', end: '$'
-  };
-
   var SYMBOL = {
     begin: SYMBOL_RE,
     relevance: 0
@@ -91,7 +87,6 @@ export default function(hljs) {
   };
   var NAME = {
     keywords: keywords,
-    lexemes: SYMBOL_RE,
     className: 'name', begin: SYMBOL_RE,
     starts: BODY
   };
@@ -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/ini.js b/src/languages/ini.js
index 73c19409b2..627c4f0702 100644
--- a/src/languages/ini.js
+++ b/src/languages/ini.js
@@ -6,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',
@@ -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/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: "\\$|\\?|%|,|;$|~|#|@|)?';
-  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/languages/javascript.js b/src/languages/javascript.js
index 9636f508da..bc7a4a5349 100644
--- a/src/languages/javascript.js
+++ b/src/languages/javascript.js
@@ -5,7 +5,11 @@ Category: common, scripting
 Website: https://developer.mozilla.org/en-US/docs/Web/JavaScript
 */
 
+import * as ECMAScript from './lib/ecmascript.js';
+import * as regex from '../lib/regex.js';
+
 export default function(hljs) {
+  var IDENT_RE = ECMAScript.IDENT_RE;
   var FRAGMENT = {
     begin: '<>',
     end: ''
@@ -14,26 +18,11 @@ 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 = {
-    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'
+    $pattern: ECMAScript.IDENT_RE,
+    keyword: ECMAScript.KEYWORDS.join(" "),
+    literal: ECMAScript.LITERALS.join(" "),
+    built_in: ECMAScript.BUILT_INS.join(" ")
   };
   var NUMBER = {
     className: 'number',
@@ -90,6 +79,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
   ]);
@@ -106,15 +99,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,
@@ -157,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
@@ -175,17 +184,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: /\)/,
@@ -249,7 +268,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/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
new file mode 100644
index 0000000000..b80f24d480
--- /dev/null
+++ b/src/languages/lib/ecmascript.js
@@ -0,0 +1,139 @@
+export const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
+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/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/livescript.js b/src/languages/livescript.js
index 17e6ab057d..a200bcde8b 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.js';
+
 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/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/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: '"',
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 d0ffa2cace..ed21d082a1 100644
--- a/src/languages/powershell.js
+++ b/src/languages/powershell.js
@@ -6,7 +6,7 @@ Contributors: Nicholas Blumhardt , Victor Zhou >/,
-    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/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'
 
       },
       {
diff --git a/src/languages/typescript.js b/src/languages/typescript.js
index 23d3fb34a4..537d243679 100644
--- a/src/languages/typescript.js
+++ b/src/languages/typescript.js
@@ -7,57 +7,42 @@ Website: https://www.typescriptlang.org
 Category: common, scripting
 */
 
+import * as ECMAScript from './lib/ecmascript.js';
+
 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",
+    "number",
+    "boolean",
+    "string",
+    "object",
+    "never",
+    "enum"
+  ];
+  var TS_SPECIFIC_KEYWORDS = [
+    "type",
+    "namespace",
+    "typedef",
+    "interface",
+    "public",
+    "private",
+    "protected",
+    "implements",
+    "declare",
+    "abstract",
+    "readonly"
+  ];
   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'
+    $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,
-  };
-
-  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
-    ]
+    begin: '@' + IDENT_RE,
   };
   var NUMBER = {
     className: 'number',
@@ -72,7 +57,7 @@ export default function(hljs) {
     className: 'subst',
     begin: '\\$\\{', end: '\\}',
     keywords: KEYWORDS,
-    contains: []  // defined later
+    contains: [] // defined later
   };
   var HTML_TEMPLATE = {
     begin: 'html`', end: '',
@@ -113,14 +98,38 @@ 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',
     aliases: ['ts'],
     keywords: KEYWORDS,
     contains: [
+      hljs.SHEBANG(),
       {
         className: 'meta',
         begin: /^\s*['"]use strict['"]/
@@ -142,27 +151,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
                   }
                 ]
               }
@@ -177,7 +192,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: /%/,
@@ -209,7 +224,7 @@ export default function(hljs) {
         begin: '\\.' + hljs.IDENT_RE, relevance: 0 // hack: prevents detection of keywords after dots
       },
       DECORATOR,
-      ARGS
+      ARGUMENTS
     ]
   };
 }
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/languages/yaml.js b/src/languages/yaml.js
index d7586eb1f3..02a1d9cee2 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.
@@ -18,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,
@@ -44,76 +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
-      },
-      { // local tags
-        className: 'type',
-        begin: '!' + hljs.UNDERSCORE_IDENT_RE,
-      },
-      { // data type
-        className: 'type',
-        begin: '!!' + hljs.UNDERSCORE_IDENT_RE,
-      },
-      { // 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/src/lib/html_renderer.js b/src/lib/html_renderer.js
index 2ed5f04946..831b3e0a40 100644
--- a/src/lib/html_renderer.js
+++ b/src/lib/html_renderer.js
@@ -1,46 +1,87 @@
-const SPAN_CLOSE = '';
+import { escapeHTML } from './utils.js';
+
+/**
+ * @typedef {object} Renderer
+ * @property {(text: string) => void} addText
+ * @property {(node: Node) => void} openNode
+ * @property {(node: Node) => void} closeNode
+ * @property {() => string} value
+ */
 
-import {escapeHTML} from './utils';
+/** @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)
+    this.buffer += escapeHTML(text);
   }
 
+  /**
+   * Adds a node open to the output stream (if needed)
+   *
+   * @param {Node} node */
   openNode(node) {
     if (!emitsWrappingTags(node)) return;
 
     let className = node.kind;
-    if (!node.sublanguage)
+    if (!node.sublanguage) {
       className = `${this.classPrefix}${className}`;
+    }
     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;
+    this.buffer += ``;
   }
 }
diff --git a/src/lib/mode_compiler.js b/src/lib/mode_compiler.js
index 10fd000483..7608d6a156 100644
--- a/src/lib/mode_compiler.js
+++ b/src/lib/mode_compiler.js
@@ -1,13 +1,26 @@
-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(' ');
 
 // 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,20 +62,27 @@ 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;
       }
-      let terminators = this.regexes.map(el => el[1]);
-      this.matcherRe = langRe(regex.join(terminators, '|'), true);
+      const terminators = this.regexes.map(el => el[1]);
+      this.matcherRe = langRe(regex.join(terminators), true);
       this.lastIndex = 0;
     }
 
+    /** @param {string} s */
     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);
+      // @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)
+      match.splice(0, i);
 
       return Object.assign(match, matchData);
     }
@@ -98,7 +121,9 @@ export function compileLanguage(language) {
   */
   class ResumableMultiRegex {
     constructor() {
+      // @ts-ignore
       this.rules = [];
+      // @ts-ignore
       this.multiRegexes = [];
       this.count = 0;
 
@@ -106,11 +131,12 @@ export function compileLanguage(language) {
       this.regexIndex = 0;
     }
 
+    // @ts-ignore
     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;
@@ -120,19 +146,22 @@ export function compileLanguage(language) {
       this.regexIndex = 0;
     }
 
+    // @ts-ignore
     addRule(re, opts) {
       this.rules.push([re, opts]);
-      if (opts.type==="begin") this.count++;
+      if (opts.type === "begin") this.count++;
     }
 
+    /** @param {string} s */
     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;
@@ -140,26 +169,43 @@ 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();
 
-    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];
+  /**
+   * 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 === ".") {
-      return {ignoreMatch: true };
+      response.ignoreMatch();
     }
   }
 
@@ -193,19 +239,43 @@ 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;
 
-    // __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)
+
+    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);
+    }
+
+    // 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.lexemesRe = langRe(mode.lexemes || /\w+/, true);
+    // `mode.lexemes` was the old standard before we added and now recommend
+    // using `keywords.$pattern` to pass the keyword pattern
+    cmode.keywordPatternRe = langRe(mode.lexemes || kw_pattern || /\w+/, true);
 
     if (parent) {
       if (mode.beginKeywords) {
@@ -215,117 +285,166 @@ 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/;
+      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.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.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.")
+    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) {
-      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
+***********************************************/
 
-// 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
     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();
+  /**
+   * 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) {
+      keywordList = keywordList.toLowerCase();
+    }
+    keywordList.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])];
-  });
-}
 }
 
+/**
+ * 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
-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());
+/**
+ * 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 4e153791d1..f493f073cb 100644
--- a/src/lib/modes.js
+++ b/src/lib/modes.js
@@ -1,4 +1,5 @@
-import {inherit} from './utils';
+import { inherit } from './utils.js';
+import * as regex from './regex.js';
 
 // Common regexps
 export const IDENT_RE = '[a-zA-Z]\\w*';
@@ -8,38 +9,73 @@ 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) {
+    opts.begin = regex.concat(
+      beginShebang,
+      /.*\b/,
+      opts.binary,
+      /\b.*/);
+  }
+  return inherit({
+    className: 'meta',
+    begin: beginShebang,
+    end: /$/,
+    relevance: 0,
+    /** @type {ModeCallback} */
+    "on:begin": (m, resp) => {
+      if (m.index !== 0) resp.ignoreMatch();
+    }
+  }, opts);
+};
+
 // Common modes
 export const BACKSLASH_ESCAPE = {
   begin: '\\\\[\\s\\S]', relevance: 0
 };
 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) {
+/**
+ * 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({
     className: 'doctag',
-    begin: '(?:TODO|FIXME|NOTE|BUG|XXX):',
+    begin: '(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):',
     relevance: 0
   });
   return mode;
@@ -65,7 +101,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 +118,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]
       }
@@ -112,3 +150,20 @@ export const METHOD_GUARD = {
   begin: '\\.\\s*' + UNDERSCORE_IDENT_RE,
   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,
+    {
+      /** @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 a0e156de39..53a9158ac7 100644
--- a/src/lib/regex.js
+++ b/src/lib/regex.js
@@ -1,17 +1,72 @@
+/**
+ * @param {string} value
+ * @returns {RegExp}
+ * */
 export function escape(value) {
-  return new RegExp(value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm');
+  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;
+}
+
+/**
+ * @param {RegExp | string } re
+ * @returns {string}
+ */
+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}
+ */
+export function concat(...args) {
+  const joined = args.map((x) => source(x)).join("");
+  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}
+ */
 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;
@@ -22,7 +77,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
@@ -49,12 +109,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/response.js b/src/lib/response.js
new file mode 100644
index 0000000000..c49c6df59f
--- /dev/null
+++ b/src/lib/response.js
@@ -0,0 +1,15 @@
+export default class Response {
+  /**
+   * @param {CompiledMode} mode
+   */
+  constructor(mode) {
+    // eslint-disable-next-line no-undefined
+    if (mode.data === undefined) mode.data = {};
+
+    this.data = mode.data;
+  }
+
+  ignoreMatch() {
+    this.ignore = true;
+  }
+}
diff --git a/src/lib/token_tree.js b/src/lib/token_tree.js
index 8e5df9c313..b748d6b3df 100644
--- a/src/lib/token_tree.js
+++ b/src/lib/token_tree.js
@@ -1,30 +1,41 @@
-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 */
+/**  */
 
 class TokenTree {
   constructor() {
+    /** @type DataNode */
     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; }
 
+  /** @param {Node} node */
   add(node) {
     this.top.children.push(node);
   }
 
+  /** @param {string} kind */
   openNode(kind) {
-    let node = { kind, children: [] };
+    /** @type Node */
+    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();
+    }
+    // eslint-disable-next-line no-undefined
+    return undefined;
   }
 
   closeAllNodes() {
@@ -35,33 +46,47 @@ 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);
     } 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;
   }
 
+  /**
+   * @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)
-      })
+        TokenTree._collapse(child);
+      });
     }
   }
 }
@@ -74,7 +99,7 @@ class TokenTree {
 
   - addKeyword(text, kind)
   - addText(text)
-  - addSublanguage(emitter, subLangaugeName)
+  - addSublanguage(emitter, subLanguageName)
   - finalize()
   - openNode(kind)
   - closeNode()
@@ -82,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; }
 
@@ -96,26 +132,33 @@ 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) {
-    let node = emitter.root;
+    /** @type DataNode */
+    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..3b9a0f1069 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -1,43 +1,66 @@
+/**
+ * @param {string} value
+ * @returns {string}
+ */
 export function escapeHTML(value) {
-  return value.replace(/&/g, '&').replace(//g, '>');
+  return value
+    .replace(/&/g, '&')
+    .replace(//g, '>')
+    .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
+ * @template T
+ * @param {T} original
+ * @param {Record[]} objects
+ * @returns {T} a single new object
  */
-export function inherit(parent) {  // inherit(parent, override_obj, override_obj, ...)
-  var key;
+export function inherit(original, ...objects) {
+  /** @type Record */
   var result = {};
-  var objects = Array.prototype.slice.call(arguments, 1);
 
-  for (key in parent)
-    result[key] = parent[key];
+  for (const key in original) {
+    result[key] = original[key];
+  }
   objects.forEach(function(obj) {
-    for (key in 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) {
-      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,
@@ -61,6 +84,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 = '';
@@ -92,17 +120,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) + '"';
     }
+    // @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/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;
+}
+
+
+
+
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;
+}
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;
+}
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/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); 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 new file mode 100644 index 0000000000..aede3ebb7a --- /dev/null +++ b/test/api/registerAlias.js @@ -0,0 +1,24 @@ +'use strict'; + +const hljs = require('../../build'); +const should = require('should'); + +describe('.registerAliases()', () => { + it('should get an existing language by alias', () => { + hljs.registerAliases('jquery', { + languageName: 'javascript' + }); + const result = hljs.getLanguage('jquery'); + + result.should.be.instanceOf(Object); + }); + + it('should get an existing language by aliases', () => { + hljs.registerAliases(['jquery', 'jqueryui'], { + languageName: 'javascript' + }); + const result = hljs.getLanguage('jquery'); + + result.should.be.instanceOf(Object); + }); +}); 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/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/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/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 0c4f8af86f..dfce2c1690 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)) +str.split(" ").map((m) -> m.charCodeAt(0)) -fs.readFile("package.json", "utf-8", (err, content) -> - data = JSON.parse(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 new file mode 100644 index 0000000000..5d34afed47 --- /dev/null +++ b/test/markup/cpp/truncated-block-comment.expect.txt @@ -0,0 +1,3 @@ +/* +Truncated block comment + \ No newline at end of file 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..8b6abd1f47 --- /dev/null +++ b/test/markup/cpp/truncated-raw-string.expect.txt @@ -0,0 +1,5 @@ +R"foo( +Truncated raw string +)nope" +Still not completed. + \ No newline at end of file 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. 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/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/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/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 {} } 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/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 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 new file mode 100644 index 0000000000..5962db4897 --- /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..f64bffb33c --- /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' 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 ae081bc79b..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 new file mode 100644 index 0000000000..9bf2c6b69d --- /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}} + \ No newline at end of file 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/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 cedd3aa3e6..357bb36eaf 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}} + \ 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 new file mode 100644 index 0000000000..d866457688 --- /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 + \ No newline at end of file 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..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 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 new file mode 100644 index 0000000000..78bb20062d --- /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 + + \ No newline at end of file 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..b75c3d9cbb 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 }} - + \ 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 48da6b13c7..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 - +{{ abcd.[] }} text + \ No newline at end of file diff --git a/test/markup/handlebars/hashes.expect.txt b/test/markup/handlebars/hashes.expect.txt new file mode 100644 index 0000000000..5a6ca0dfae --- /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)}} + \ No newline at end of file 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..2d43b9b3c9 --- /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}} + \ No newline at end of file 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..484f4cad9c --- /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]}} + \ No newline at end of file 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..4ff92a6fb4 100644 --- a/test/markup/handlebars/partial-call.expect.txt +++ b/test/markup/handlebars/partial-call.expect.txt @@ -1,2 +1,2 @@ -{{> partial}} - +{{> 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 new file mode 100644 index 0000000000..9ebaf62401 --- /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 + \ No newline at end of file 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..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}} - +{{{{#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 c243c13ba1..a18900dbae 100644 --- a/test/markup/handlebars/simple-expression.expect.txt +++ b/test/markup/handlebars/simple-expression.expect.txt @@ -1,2 +1,2 @@ -{{abc}} - +{{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 d8bf1c4c32..47d00dfdc8 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)}} + \ No newline at end of file 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..1787f8d7ae 100644 --- a/test/markup/handlebars/triple-mustache.expect.txt +++ b/test/markup/handlebars/triple-mustache.expect.txt @@ -1,2 +1,2 @@ -{{{raw}}} - +{{{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 dea935f1f3..28138ffa6b 100644 --- a/test/markup/index.js +++ b/test/markup/index.js @@ -1,10 +1,12 @@ '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(); const { getThirdPartyPackages } = require("../../tools/lib/external_language") @@ -13,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) }); @@ -35,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/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!" 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/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; diff --git a/test/markup/javascript/arrow-function.expect.txt b/test/markup/javascript/arrow-function.expect.txt index c7b648e5bc..b9ad0135fa 100644 --- a/test/markup/javascript/arrow-function.expect.txt +++ b/test/markup/javascript/arrow-function.expect.txt @@ -1,4 +1,14 @@ 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/class.expect.txt b/test/markup/javascript/class.expect.txt index 31a8507e4c..edc3e79e3b 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; + var c = Symbol('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/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 a000fe75a7..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 n = () => <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/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 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 e92b578cea..f927f9d8cc 100644 --- a/test/markup/javascript/object-attr.expect.txt +++ b/test/markup/javascript/object-attr.expect.txt @@ -1,6 +1,15 @@ { key: value, // with comment key2: value, - 'key-3': value, - key4: false ? undefined : true + key2clone: value, + 'key-3': value, + 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, } + 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 new file mode 100644 index 0000000000..52f584761a --- /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$); 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/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 +*/ 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 ff99191bf4..b85c55bf67 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}.`; } } 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 3addcb3036..5c2595c296 100644 --- a/test/markup/typescript/functions.expect.txt +++ b/test/markup/typescript/functions.expect.txt @@ -13,3 +13,14 @@ 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 ); + 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(); 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/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 @@ + + + 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/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 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 dbc5645dcd..d777a9b7ac 100644 --- a/test/markup/yaml/tag.expect.txt +++ b/test/markup/yaml/tag.expect.txt @@ -1,4 +1,12 @@ 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 +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 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( 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, } }, 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/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); } 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 +}