diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..5ace4600a1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index eda9686de4..232db269ab 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 with: fetch-depth: 0 # create a new branch called pr from the remote PR branch diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8f4941b8b..3306eaa6a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [ master ] +permissions: + contents: read + jobs: tests: @@ -16,9 +19,9 @@ jobs: node-version: [10.x, 12.x, 14.x, 16.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm ci @@ -33,9 +36,9 @@ jobs: node-version: [10.x, 12.x, 14.x, 16.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm ci @@ -50,9 +53,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x - run: npm ci @@ -63,9 +66,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x - run: npm ci diff --git a/CHANGELOG.md b/CHANGELOG.md index 6329ab4686..2d792fe64d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,40 +1,129 @@ # Prism Changelog +## 1.28.0 (2022-04-17) + +### New components + +* __Ado__ & __Mata__ (Stata) ([#3383](https://github.com/PrismJS/prism/issues/3383)) [`63806d57`](https://github.com/PrismJS/prism/commit/63806d57) +* __ARM Assembly__ ([#3376](https://github.com/PrismJS/prism/issues/3376)) [`554ff324`](https://github.com/PrismJS/prism/commit/554ff324) +* __Arturo__ ([#3403](https://github.com/PrismJS/prism/issues/3403)) [`e2fe1f79`](https://github.com/PrismJS/prism/commit/e2fe1f79) +* __AWK__ & __GAWK__ ([#3374](https://github.com/PrismJS/prism/issues/3374)) [`ea8a0f40`](https://github.com/PrismJS/prism/commit/ea8a0f40) +* __Cooklang__ ([#3337](https://github.com/PrismJS/prism/issues/3337)) [`4eb928c3`](https://github.com/PrismJS/prism/commit/4eb928c3) +* __CUE__ ([#3375](https://github.com/PrismJS/prism/issues/3375)) [`a1340666`](https://github.com/PrismJS/prism/commit/a1340666) +* __gettext__ ([#3369](https://github.com/PrismJS/prism/issues/3369)) [`dfef9b61`](https://github.com/PrismJS/prism/commit/dfef9b61) +* __GNU Linker Script__ ([#3373](https://github.com/PrismJS/prism/issues/3373)) [`33f2cf95`](https://github.com/PrismJS/prism/commit/33f2cf95) +* __Odin__ ([#3424](https://github.com/PrismJS/prism/issues/3424)) [`8a3fef6d`](https://github.com/PrismJS/prism/commit/8a3fef6d) +* __PlantUML__ ([#3372](https://github.com/PrismJS/prism/issues/3372)) [`0d49553c`](https://github.com/PrismJS/prism/commit/0d49553c) +* __ReScript__ ([#3435](https://github.com/PrismJS/prism/issues/3435)) [`cbef9af7`](https://github.com/PrismJS/prism/commit/cbef9af7) +* __SuperCollider__ ([#3371](https://github.com/PrismJS/prism/issues/3371)) [`1b1d6731`](https://github.com/PrismJS/prism/commit/1b1d6731) + +### Updated components + +* __.properties__ + * Use `key`, `value` for token names; `attr-name`, `attr-value` as aliases ([#3377](https://github.com/PrismJS/prism/issues/3377)) [`b94a664d`](https://github.com/PrismJS/prism/commit/b94a664d) +* __ABAP__ + * Sorted keyword list ([#3368](https://github.com/PrismJS/prism/issues/3368)) [`7bda2bf1`](https://github.com/PrismJS/prism/commit/7bda2bf1) +* __Ada__ + * Changed `attr-name` to `attribute`; Use `attr-name` as alias ([#3381](https://github.com/PrismJS/prism/issues/3381)) [`cde0b5b2`](https://github.com/PrismJS/prism/commit/cde0b5b2) + * Added `or` keyword ([#3380](https://github.com/PrismJS/prism/issues/3380)) [`c30b736f`](https://github.com/PrismJS/prism/commit/c30b736f) +* __Atmel AVR Assembly__ + * Fixed `&=` and `|=` operators ([#3395](https://github.com/PrismJS/prism/issues/3395)) [`8c4ae5a5`](https://github.com/PrismJS/prism/commit/8c4ae5a5) +* __AutoHotkey__ + * Use standard tokens ([#3385](https://github.com/PrismJS/prism/issues/3385)) [`61c460e8`](https://github.com/PrismJS/prism/commit/61c460e8) + * Use general pattern instead of name list for directives ([#3384](https://github.com/PrismJS/prism/issues/3384)) [`7ac84dda`](https://github.com/PrismJS/prism/commit/7ac84dda) +* __CFScript__ + * Simplified operator regex ([#3396](https://github.com/PrismJS/prism/issues/3396)) [`6a215fe0`](https://github.com/PrismJS/prism/commit/6a215fe0) +* __CMake__ + * Simplified `variable` and `operator` regexes ([#3398](https://github.com/PrismJS/prism/issues/3398)) [`8e59744b`](https://github.com/PrismJS/prism/commit/8e59744b) +* __Erlang__ + * Added `begin` keyword ([#3387](https://github.com/PrismJS/prism/issues/3387)) [`cf38d059`](https://github.com/PrismJS/prism/commit/cf38d059) +* __Excel Formula__ + * Use more fitting aliases for `function-name`, `range`, and `cell` ([#3391](https://github.com/PrismJS/prism/issues/3391)) [`ef0ec02a`](https://github.com/PrismJS/prism/commit/ef0ec02a) +* __Flow__ + * Changed alias of `type` to `class-name` ([#3390](https://github.com/PrismJS/prism/issues/3390)) [`ce41434d`](https://github.com/PrismJS/prism/commit/ce41434d) + * Recognise `[Ss]ymbol` as a type ([#3388](https://github.com/PrismJS/prism/issues/3388)) [`3916883a`](https://github.com/PrismJS/prism/commit/3916883a) +* __GEDCOM__ + * Update `tag` to `record` ([#3386](https://github.com/PrismJS/prism/issues/3386)) [`f8f95340`](https://github.com/PrismJS/prism/commit/f8f95340) +* __Groovy__ + * Added string interpolation without hook ([#3366](https://github.com/PrismJS/prism/issues/3366)) [`5617765f`](https://github.com/PrismJS/prism/commit/5617765f) +* __Handlebars__ + * Added Mustache alias ([#3422](https://github.com/PrismJS/prism/issues/3422)) [`cb5229af`](https://github.com/PrismJS/prism/commit/cb5229af) +* __Java__ + * Improved class name detection ([#3351](https://github.com/PrismJS/prism/issues/3351)) [`4cb3d038`](https://github.com/PrismJS/prism/commit/4cb3d038) + * Fixed `record` false positives ([#3348](https://github.com/PrismJS/prism/issues/3348)) [`3bd8fdb1`](https://github.com/PrismJS/prism/commit/3bd8fdb1) +* __JavaScript__ + * Added support for new regex syntax ([#3399](https://github.com/PrismJS/prism/issues/3399)) [`ca78cde6`](https://github.com/PrismJS/prism/commit/ca78cde6) +* __Keyman__ + * Added new keywords ([#3401](https://github.com/PrismJS/prism/issues/3401)) [`bac36827`](https://github.com/PrismJS/prism/commit/bac36827) +* __MEL__ + * Improved functions, code, and comments ([#3393](https://github.com/PrismJS/prism/issues/3393)) [`8e648dab`](https://github.com/PrismJS/prism/commit/8e648dab) +* __NEON__ + * Change alias of `key` to `property` ([#3394](https://github.com/PrismJS/prism/issues/3394)) [`1c533f4a`](https://github.com/PrismJS/prism/commit/1c533f4a) +* __PHP__ + * Added `never` return type + minor fix of named arguments ([#3421](https://github.com/PrismJS/prism/issues/3421)) [`4ffab525`](https://github.com/PrismJS/prism/commit/4ffab525) + * Added `readonly` keyword ([#3349](https://github.com/PrismJS/prism/issues/3349)) [`4c3f1969`](https://github.com/PrismJS/prism/commit/4c3f1969) +* __PureBasic__ + * Added support for pointer to string operator ([#3362](https://github.com/PrismJS/prism/issues/3362)) [`499b1fa0`](https://github.com/PrismJS/prism/commit/499b1fa0) +* __Razor C#__ + * Added support for `@helper` and inline C# inside attribute values ([#3355](https://github.com/PrismJS/prism/issues/3355)) [`31a38d0c`](https://github.com/PrismJS/prism/commit/31a38d0c) +* __VHDL__ + * Add `private`, `view` keywords; Distinguish `attribute` from `keyword` ([#3389](https://github.com/PrismJS/prism/issues/3389)) [`d1a5ce30`](https://github.com/PrismJS/prism/commit/d1a5ce30) +* __Wolfram language__ + * Simplified `operator` regex ([#3397](https://github.com/PrismJS/prism/issues/3397)) [`10ae6da3`](https://github.com/PrismJS/prism/commit/10ae6da3) + +### Updated plugins + +* __Autolinker__ + * Fixed URL regex to match more valid URLs ([#3358](https://github.com/PrismJS/prism/issues/3358)) [`17ed9160`](https://github.com/PrismJS/prism/commit/17ed9160) +* __Command Line__ + * Add support for command continuation prefix ([#3344](https://github.com/PrismJS/prism/issues/3344)) [`b53832cd`](https://github.com/PrismJS/prism/commit/b53832cd) + * Increased prompt opacity ([#3352](https://github.com/PrismJS/prism/issues/3352)) [`f95dd190`](https://github.com/PrismJS/prism/commit/f95dd190) +* __Keep Markup__ + * Use original nodes instead of clones ([#3365](https://github.com/PrismJS/prism/issues/3365)) [`8a843a17`](https://github.com/PrismJS/prism/commit/8a843a17) + +### Other + +* __Infrastructure__ + * Use terser ([#3407](https://github.com/PrismJS/prism/issues/3407)) [`11c54624`](https://github.com/PrismJS/prism/commit/11c54624) + * Tests: Cache results for exp backtracking check ([#3356](https://github.com/PrismJS/prism/issues/3356)) [`ead22e1e`](https://github.com/PrismJS/prism/commit/ead22e1e) +* __Website__ + * More documentation for language definitons ([#3427](https://github.com/PrismJS/prism/issues/3427)) [`333bd590`](https://github.com/PrismJS/prism/commit/333bd590) + ## 1.27.0 (2022-02-17) ### New components -* __UO Razor Script__ (#3309) [`3f8cc5a0`](https://github.com/PrismJS/prism/commit/3f8cc5a0) +* __UO Razor Script__ ([#3309](https://github.com/PrismJS/prism/issues/3309)) [`3f8cc5a0`](https://github.com/PrismJS/prism/commit/3f8cc5a0) ### Updated components * __AutoIt__ - * Allow hyphen in directive (#3308) [`bcb2e2c8`](https://github.com/PrismJS/prism/commit/bcb2e2c8) + * Allow hyphen in directive ([#3308](https://github.com/PrismJS/prism/issues/3308)) [`bcb2e2c8`](https://github.com/PrismJS/prism/commit/bcb2e2c8) * __EditorConfig__ - * Change alias of `section` from `keyword` to `selector` (#3305) [`e46501b9`](https://github.com/PrismJS/prism/commit/e46501b9) + * Change alias of `section` from `keyword` to `selector` ([#3305](https://github.com/PrismJS/prism/issues/3305)) [`e46501b9`](https://github.com/PrismJS/prism/commit/e46501b9) * __Ini__ - * Swap out `header` for `section` (#3304) [`deb3a97f`](https://github.com/PrismJS/prism/commit/deb3a97f) + * Swap out `header` for `section` ([#3304](https://github.com/PrismJS/prism/issues/3304)) [`deb3a97f`](https://github.com/PrismJS/prism/commit/deb3a97f) * __MongoDB__ - * Added v5 support (#3297) [`8458c41f`](https://github.com/PrismJS/prism/commit/8458c41f) + * Added v5 support ([#3297](https://github.com/PrismJS/prism/issues/3297)) [`8458c41f`](https://github.com/PrismJS/prism/commit/8458c41f) * __PureBasic__ - * Added missing keyword and fixed constants ending with `$` (#3320) [`d6c53726`](https://github.com/PrismJS/prism/commit/d6c53726) + * Added missing keyword and fixed constants ending with `$` ([#3320](https://github.com/PrismJS/prism/issues/3320)) [`d6c53726`](https://github.com/PrismJS/prism/commit/d6c53726) * __Scala__ - * Added support for interpolated strings (#3293) [`441a1422`](https://github.com/PrismJS/prism/commit/441a1422) + * Added support for interpolated strings ([#3293](https://github.com/PrismJS/prism/issues/3293)) [`441a1422`](https://github.com/PrismJS/prism/commit/441a1422) * __Systemd configuration file__ - * Swap out `operator` for `punctuation` (#3306) [`2eb89e15`](https://github.com/PrismJS/prism/commit/2eb89e15) + * Swap out `operator` for `punctuation` ([#3306](https://github.com/PrismJS/prism/issues/3306)) [`2eb89e15`](https://github.com/PrismJS/prism/commit/2eb89e15) ### Updated plugins * __Command Line__ - * Escape markup in command line output (#3341) [`e002e78c`](https://github.com/PrismJS/prism/commit/e002e78c) - * Add support for line continuation and improved colors (#3326) [`1784b175`](https://github.com/PrismJS/prism/commit/1784b175) - * Added span around command and output (#3312) [`82d0ca15`](https://github.com/PrismJS/prism/commit/82d0ca15) + * Escape markup in command line output ([#3341](https://github.com/PrismJS/prism/issues/3341)) [`e002e78c`](https://github.com/PrismJS/prism/commit/e002e78c) + * Add support for line continuation and improved colors ([#3326](https://github.com/PrismJS/prism/issues/3326)) [`1784b175`](https://github.com/PrismJS/prism/commit/1784b175) + * Added span around command and output ([#3312](https://github.com/PrismJS/prism/issues/3312)) [`82d0ca15`](https://github.com/PrismJS/prism/commit/82d0ca15) ### Other * __Core__ - * Added better error message for missing grammars (#3311) [`2cc4660b`](https://github.com/PrismJS/prism/commit/2cc4660b) + * Added better error message for missing grammars ([#3311](https://github.com/PrismJS/prism/issues/3311)) [`2cc4660b`](https://github.com/PrismJS/prism/commit/2cc4660b) ## 1.26.0 (2022-01-06) diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000000..c7ee4991fc --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,11 @@ +## Maintainers (alphabetical by user name) + +- [@Golmote](https://github.com/Golmote) +- [@JaKXz](https://github.com/JaKXz) Jason Kurian +- [@LeaVerou](https://github.com/LeaVerou) Lea Verou (original author) +- [@mAAdhaTTah](https://github.com/mAAdhaTTah) James DiGioia +- [@RunDevelopment](https://github.com/RunDevelopment) Michael Schmidt + +## Former Maintainers + +- [@zeitgeist87](https://github.com/zeitgeist87) Andreas Rohner diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..c796689dff --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,51 @@ +# Security Policy + +## What is considered a vulnerability? + +There are some types of [low-severity][severity] vulnerabilities that we will not acknowledge as CVE and treat as bugs instead. +All vulnerabilities with a severity of medium and above will of course be acknowledged and fixed. + +Please see the below section on how we treat [ReDoS] vulnerabilities. + +If you are unsure whether a vulnerability you found qualifies, please report it as a vulnerability via email (see below). + +### ReDoS + +Prism is a regex-based syntax highlighter. +As such, the main types of vulnerabilities reported to us are [ReDoS] vulnerabilities ([CWE-1333](https://cwe.mitre.org/data/definitions/1333.html)), aka slow regexes. + +However, not all ReDoS is created equal. +A slow regex can be have a [worst-case time complexity](https://en.wikipedia.org/wiki/Time_complexity) anywhere from _O(n2)_ to _2O(n)_. +This matters because a worst-case time complexity _≥ O(n3)_ is a [high severity][severity] vulnerability while _O(n2)_ is low or medium severity in the context of Prism. +Furthermore, worst-case time complexities of _O(n2)_ can have 2 different causes: backtracking or moving. +Backtracking is always fixable by rewriting the slow regex but moving is not (except in special cases). + +Because of their lower severity and the fact that moving is difficult or impossible to fix, we will treat regexes with worst-case time complexity of _O(n2)_ caused by moving as regular bugs and not as vulnerabilities. +Please report them as [bugs](https://github.com/PrismJS/prism/issues/new/choose) instead of as vulnerabilities. + +If you found a slow regex but are unsure about the worst-case time complexity or its cause, please report it as a vulnerability via email (see below). + + +## Reporting a Vulnerability + +***DO NOT CREATE AN ISSUE*** to report a vulnerability. + +Instead, please send an email to at least one of [Prism's maintainers](MAINTAINERS.md). +See [Responsible Disclosure](https://en.wikipedia.org/wiki/Responsible_disclosure) for more details. + +### Procedure + +1. After you send an email [a maintainer](MAINTAINERS.md), you should receive a response from the [Prism team](https://github.com/orgs/PrismJS/people) within 3 days. + + We may require further information, so please keep in touch with us until the vulnerability has been fixed. + +2. After the vulnerability has been confirmed and accepted, we will create a [security advisory](https://docs.github.com/en/code-security/security-advisories/about-github-security-advisories) and start working on a fix. + + You will be [added as a collaborator](https://docs.github.com/en/code-security/security-advisories/adding-a-collaborator-to-a-security-advisory) (this requires a GitHub account). + At this point, all communication will occur using comments on the advisory and the [temporary private fork](https://docs.github.com/en/code-security/security-advisories/collaborating-in-a-temporary-private-fork-to-resolve-a-security-vulnerability). + +3. After the fix has been merged, we will make a new release and publish the security advisory within one week. + + +[ReDoS]: https://en.wikipedia.org/wiki/ReDoS +[severity]: https://www.imperva.com/learn/application-security/cve-cvss-vulnerability/ diff --git a/components.js b/components.js index 74cd207d00..5523cfa640 100644 --- a/components.js +++ b/components.js @@ -1,2 +1,2 @@ -var components = {"core":{"meta":{"path":"components/prism-core.js","option":"mandatory"},"core":"Core"},"themes":{"meta":{"path":"themes/{id}.css","link":"index.html?theme={id}","exclusive":true},"prism":{"title":"Default","option":"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{"title":"Okaidia","owner":"ocodia"},"prism-twilight":{"title":"Twilight","owner":"remybach"},"prism-coy":{"title":"Coy","owner":"tshedor"},"prism-solarizedlight":{"title":"Solarized Light","owner":"hectormatos2011 "},"prism-tomorrow":{"title":"Tomorrow Night","owner":"Rosey"}},"languages":{"meta":{"path":"components/prism-{id}","noCSS":true,"examplesPath":"examples/prism-{id}","addCheckAll":true},"markup":{"title":"Markup","alias":["html","xml","svg","mathml","ssml","atom","rss"],"aliasTitles":{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","ssml":"SSML","atom":"Atom","rss":"RSS"},"option":"default"},"css":{"title":"CSS","option":"default","modify":"markup"},"clike":{"title":"C-like","option":"default"},"javascript":{"title":"JavaScript","require":"clike","modify":"markup","optional":"regex","alias":"js","option":"default"},"abap":{"title":"ABAP","owner":"dellagustin"},"abnf":{"title":"ABNF","owner":"RunDevelopment"},"actionscript":{"title":"ActionScript","require":"javascript","modify":"markup","owner":"Golmote"},"ada":{"title":"Ada","owner":"Lucretia"},"agda":{"title":"Agda","owner":"xy-ren"},"al":{"title":"AL","owner":"RunDevelopment"},"antlr4":{"title":"ANTLR4","alias":"g4","owner":"RunDevelopment"},"apacheconf":{"title":"Apache Configuration","owner":"GuiTeK"},"apex":{"title":"Apex","require":["clike","sql"],"owner":"RunDevelopment"},"apl":{"title":"APL","owner":"ngn"},"applescript":{"title":"AppleScript","owner":"Golmote"},"aql":{"title":"AQL","owner":"RunDevelopment"},"arduino":{"title":"Arduino","require":"cpp","alias":"ino","owner":"dkern"},"arff":{"title":"ARFF","owner":"Golmote"},"armasm":{"title":"ARM Assembly","alias":"arm-asm","owner":"RunDevelopment"},"arturo":{"title":"Arturo","alias":"art","optional":["bash","css","javascript","markup","markdown","sql"],"owner":"drkameleon"},"asciidoc":{"alias":"adoc","title":"AsciiDoc","owner":"Golmote"},"aspnet":{"title":"ASP.NET (C#)","require":["markup","csharp"],"owner":"nauzilus"},"asm6502":{"title":"6502 Assembly","owner":"kzurawel"},"asmatmel":{"title":"Atmel AVR Assembly","owner":"cerkit"},"autohotkey":{"title":"AutoHotkey","owner":"aviaryan"},"autoit":{"title":"AutoIt","owner":"Golmote"},"avisynth":{"title":"AviSynth","alias":"avs","owner":"Zinfidel"},"avro-idl":{"title":"Avro IDL","alias":"avdl","owner":"RunDevelopment"},"awk":{"title":"AWK","alias":"gawk","aliasTitles":{"gawk":"GAWK"},"owner":"RunDevelopment"},"bash":{"title":"Bash","alias":"shell","aliasTitles":{"shell":"Shell"},"owner":"zeitgeist87"},"basic":{"title":"BASIC","owner":"Golmote"},"batch":{"title":"Batch","owner":"Golmote"},"bbcode":{"title":"BBcode","alias":"shortcode","aliasTitles":{"shortcode":"Shortcode"},"owner":"RunDevelopment"},"bicep":{"title":"Bicep","owner":"johnnyreilly"},"birb":{"title":"Birb","require":"clike","owner":"Calamity210"},"bison":{"title":"Bison","require":"c","owner":"Golmote"},"bnf":{"title":"BNF","alias":"rbnf","aliasTitles":{"rbnf":"RBNF"},"owner":"RunDevelopment"},"brainfuck":{"title":"Brainfuck","owner":"Golmote"},"brightscript":{"title":"BrightScript","owner":"RunDevelopment"},"bro":{"title":"Bro","owner":"wayward710"},"bsl":{"title":"BSL (1C:Enterprise)","alias":"oscript","aliasTitles":{"oscript":"OneScript"},"owner":"Diversus23"},"c":{"title":"C","require":"clike","owner":"zeitgeist87"},"csharp":{"title":"C#","require":"clike","alias":["cs","dotnet"],"owner":"mvalipour"},"cpp":{"title":"C++","require":"c","owner":"zeitgeist87"},"cfscript":{"title":"CFScript","require":"clike","alias":"cfc","owner":"mjclemente"},"chaiscript":{"title":"ChaiScript","require":["clike","cpp"],"owner":"RunDevelopment"},"cil":{"title":"CIL","owner":"sbrl"},"clojure":{"title":"Clojure","owner":"troglotit"},"cmake":{"title":"CMake","owner":"mjrogozinski"},"cobol":{"title":"COBOL","owner":"RunDevelopment"},"coffeescript":{"title":"CoffeeScript","require":"javascript","alias":"coffee","owner":"R-osey"},"concurnas":{"title":"Concurnas","alias":"conc","owner":"jasontatton"},"csp":{"title":"Content-Security-Policy","owner":"ScottHelme"},"cooklang":{"title":"Cooklang","owner":"ahue"},"coq":{"title":"Coq","owner":"RunDevelopment"},"crystal":{"title":"Crystal","require":"ruby","owner":"MakeNowJust"},"css-extras":{"title":"CSS Extras","require":"css","modify":"css","owner":"milesj"},"csv":{"title":"CSV","owner":"RunDevelopment"},"cue":{"title":"CUE","owner":"RunDevelopment"},"cypher":{"title":"Cypher","owner":"RunDevelopment"},"d":{"title":"D","require":"clike","owner":"Golmote"},"dart":{"title":"Dart","require":"clike","owner":"Golmote"},"dataweave":{"title":"DataWeave","owner":"machaval"},"dax":{"title":"DAX","owner":"peterbud"},"dhall":{"title":"Dhall","owner":"RunDevelopment"},"diff":{"title":"Diff","owner":"uranusjr"},"django":{"title":"Django/Jinja2","require":"markup-templating","alias":"jinja2","owner":"romanvm"},"dns-zone-file":{"title":"DNS zone file","owner":"RunDevelopment","alias":"dns-zone"},"docker":{"title":"Docker","alias":"dockerfile","owner":"JustinBeckwith"},"dot":{"title":"DOT (Graphviz)","alias":"gv","optional":"markup","owner":"RunDevelopment"},"ebnf":{"title":"EBNF","owner":"RunDevelopment"},"editorconfig":{"title":"EditorConfig","owner":"osipxd"},"eiffel":{"title":"Eiffel","owner":"Conaclos"},"ejs":{"title":"EJS","require":["javascript","markup-templating"],"owner":"RunDevelopment","alias":"eta","aliasTitles":{"eta":"Eta"}},"elixir":{"title":"Elixir","owner":"Golmote"},"elm":{"title":"Elm","owner":"zwilias"},"etlua":{"title":"Embedded Lua templating","require":["lua","markup-templating"],"owner":"RunDevelopment"},"erb":{"title":"ERB","require":["ruby","markup-templating"],"owner":"Golmote"},"erlang":{"title":"Erlang","owner":"Golmote"},"excel-formula":{"title":"Excel Formula","alias":["xlsx","xls"],"owner":"RunDevelopment"},"fsharp":{"title":"F#","require":"clike","owner":"simonreynolds7"},"factor":{"title":"Factor","owner":"catb0t"},"false":{"title":"False","owner":"edukisto"},"firestore-security-rules":{"title":"Firestore security rules","require":"clike","owner":"RunDevelopment"},"flow":{"title":"Flow","require":"javascript","owner":"Golmote"},"fortran":{"title":"Fortran","owner":"Golmote"},"ftl":{"title":"FreeMarker Template Language","require":"markup-templating","owner":"RunDevelopment"},"gml":{"title":"GameMaker Language","alias":"gamemakerlanguage","require":"clike","owner":"LiarOnce"},"gap":{"title":"GAP (CAS)","owner":"RunDevelopment"},"gcode":{"title":"G-code","owner":"RunDevelopment"},"gcsim":{"title":"gcsim code","owner":"genshinsim"},"gdscript":{"title":"GDScript","owner":"RunDevelopment"},"gedcom":{"title":"GEDCOM","owner":"Golmote"},"gettext":{"title":"gettext","alias":"po","owner":"RunDevelopment"},"gherkin":{"title":"Gherkin","owner":"hason"},"git":{"title":"Git","owner":"lgiraudel"},"glsl":{"title":"GLSL","require":"c","owner":"Golmote"},"gn":{"title":"GN","alias":"gni","owner":"RunDevelopment"},"linker-script":{"title":"GNU Linker Script","alias":"ld","owner":"RunDevelopment"},"go":{"title":"Go","require":"clike","owner":"arnehormann"},"go-module":{"title":"Go module","alias":"go-mod","owner":"RunDevelopment"},"graphql":{"title":"GraphQL","optional":"markdown","owner":"Golmote"},"groovy":{"title":"Groovy","require":"clike","owner":"robfletcher"},"haml":{"title":"Haml","require":"ruby","optional":["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],"owner":"Golmote"},"handlebars":{"title":"Handlebars","require":"markup-templating","alias":["hbs","mustache"],"aliasTitles":{"mustache":"Mustache"},"owner":"Golmote"},"haskell":{"title":"Haskell","alias":"hs","owner":"bholst"},"haxe":{"title":"Haxe","require":"clike","optional":"regex","owner":"Golmote"},"hcl":{"title":"HCL","owner":"outsideris"},"hlsl":{"title":"HLSL","require":"c","owner":"RunDevelopment"},"hoon":{"title":"Hoon","owner":"matildepark"},"http":{"title":"HTTP","optional":["csp","css","hpkp","hsts","javascript","json","markup","uri"],"owner":"danielgtaylor"},"hpkp":{"title":"HTTP Public-Key-Pins","owner":"ScottHelme"},"hsts":{"title":"HTTP Strict-Transport-Security","owner":"ScottHelme"},"ichigojam":{"title":"IchigoJam","owner":"BlueCocoa"},"icon":{"title":"Icon","owner":"Golmote"},"icu-message-format":{"title":"ICU Message Format","owner":"RunDevelopment"},"idris":{"title":"Idris","alias":"idr","owner":"KeenS","require":"haskell"},"ignore":{"title":".ignore","owner":"osipxd","alias":["gitignore","hgignore","npmignore"],"aliasTitles":{"gitignore":".gitignore","hgignore":".hgignore","npmignore":".npmignore"}},"inform7":{"title":"Inform 7","owner":"Golmote"},"ini":{"title":"Ini","owner":"aviaryan"},"io":{"title":"Io","owner":"AlesTsurko"},"j":{"title":"J","owner":"Golmote"},"java":{"title":"Java","require":"clike","owner":"sherblot"},"javadoc":{"title":"JavaDoc","require":["markup","java","javadoclike"],"modify":"java","optional":"scala","owner":"RunDevelopment"},"javadoclike":{"title":"JavaDoc-like","modify":["java","javascript","php"],"owner":"RunDevelopment"},"javastacktrace":{"title":"Java stack trace","owner":"RunDevelopment"},"jexl":{"title":"Jexl","owner":"czosel"},"jolie":{"title":"Jolie","require":"clike","owner":"thesave"},"jq":{"title":"JQ","owner":"RunDevelopment"},"jsdoc":{"title":"JSDoc","require":["javascript","javadoclike","typescript"],"modify":"javascript","optional":["actionscript","coffeescript"],"owner":"RunDevelopment"},"js-extras":{"title":"JS Extras","require":"javascript","modify":"javascript","optional":["actionscript","coffeescript","flow","n4js","typescript"],"owner":"RunDevelopment"},"json":{"title":"JSON","alias":"webmanifest","aliasTitles":{"webmanifest":"Web App Manifest"},"owner":"CupOfTea696"},"json5":{"title":"JSON5","require":"json","owner":"RunDevelopment"},"jsonp":{"title":"JSONP","require":"json","owner":"RunDevelopment"},"jsstacktrace":{"title":"JS stack trace","owner":"sbrl"},"js-templates":{"title":"JS Templates","require":"javascript","modify":"javascript","optional":["css","css-extras","graphql","markdown","markup","sql"],"owner":"RunDevelopment"},"julia":{"title":"Julia","owner":"cdagnino"},"keepalived":{"title":"Keepalived Configure","owner":"dev-itsheng"},"keyman":{"title":"Keyman","owner":"mcdurdin"},"kotlin":{"title":"Kotlin","alias":["kt","kts"],"aliasTitles":{"kts":"Kotlin Script"},"require":"clike","owner":"Golmote"},"kumir":{"title":"KuMir (КуМир)","alias":"kum","owner":"edukisto"},"kusto":{"title":"Kusto","owner":"RunDevelopment"},"latex":{"title":"LaTeX","alias":["tex","context"],"aliasTitles":{"tex":"TeX","context":"ConTeXt"},"owner":"japborst"},"latte":{"title":"Latte","require":["clike","markup-templating","php"],"owner":"nette"},"less":{"title":"Less","require":"css","optional":"css-extras","owner":"Golmote"},"lilypond":{"title":"LilyPond","require":"scheme","alias":"ly","owner":"RunDevelopment"},"liquid":{"title":"Liquid","require":"markup-templating","owner":"cinhtau"},"lisp":{"title":"Lisp","alias":["emacs","elisp","emacs-lisp"],"owner":"JuanCaicedo"},"livescript":{"title":"LiveScript","owner":"Golmote"},"llvm":{"title":"LLVM IR","owner":"porglezomp"},"log":{"title":"Log file","optional":"javastacktrace","owner":"RunDevelopment"},"lolcode":{"title":"LOLCODE","owner":"Golmote"},"lua":{"title":"Lua","owner":"Golmote"},"magma":{"title":"Magma (CAS)","owner":"RunDevelopment"},"makefile":{"title":"Makefile","owner":"Golmote"},"markdown":{"title":"Markdown","require":"markup","optional":"yaml","alias":"md","owner":"Golmote"},"markup-templating":{"title":"Markup templating","require":"markup","owner":"Golmote"},"mata":{"title":"Mata","owner":"RunDevelopment"},"matlab":{"title":"MATLAB","owner":"Golmote"},"maxscript":{"title":"MAXScript","owner":"RunDevelopment"},"mel":{"title":"MEL","owner":"Golmote"},"mermaid":{"title":"Mermaid","owner":"RunDevelopment"},"mizar":{"title":"Mizar","owner":"Golmote"},"mongodb":{"title":"MongoDB","owner":"airs0urce","require":"javascript"},"monkey":{"title":"Monkey","owner":"Golmote"},"moonscript":{"title":"MoonScript","alias":"moon","owner":"RunDevelopment"},"n1ql":{"title":"N1QL","owner":"TMWilds"},"n4js":{"title":"N4JS","require":"javascript","optional":"jsdoc","alias":"n4jsd","owner":"bsmith-n4"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","owner":"stephanmax"},"naniscript":{"title":"Naninovel Script","owner":"Elringus","alias":"nani"},"nasm":{"title":"NASM","owner":"rbmj"},"neon":{"title":"NEON","owner":"nette"},"nevod":{"title":"Nevod","owner":"nezaboodka"},"nginx":{"title":"nginx","owner":"volado"},"nim":{"title":"Nim","owner":"Golmote"},"nix":{"title":"Nix","owner":"Golmote"},"nsis":{"title":"NSIS","owner":"idleberg"},"objectivec":{"title":"Objective-C","require":"c","alias":"objc","owner":"uranusjr"},"ocaml":{"title":"OCaml","owner":"Golmote"},"opencl":{"title":"OpenCL","require":"c","modify":["c","cpp"],"owner":"Milania1"},"openqasm":{"title":"OpenQasm","alias":"qasm","owner":"RunDevelopment"},"oz":{"title":"Oz","owner":"Golmote"},"parigp":{"title":"PARI/GP","owner":"Golmote"},"parser":{"title":"Parser","require":"markup","owner":"Golmote"},"pascal":{"title":"Pascal","alias":"objectpascal","aliasTitles":{"objectpascal":"Object Pascal"},"owner":"Golmote"},"pascaligo":{"title":"Pascaligo","owner":"DefinitelyNotAGoat"},"psl":{"title":"PATROL Scripting Language","owner":"bertysentry"},"pcaxis":{"title":"PC-Axis","alias":"px","owner":"RunDevelopment"},"peoplecode":{"title":"PeopleCode","alias":"pcode","owner":"RunDevelopment"},"perl":{"title":"Perl","owner":"Golmote"},"php":{"title":"PHP","require":"markup-templating","owner":"milesj"},"phpdoc":{"title":"PHPDoc","require":["php","javadoclike"],"modify":"php","owner":"RunDevelopment"},"php-extras":{"title":"PHP Extras","require":"php","modify":"php","owner":"milesj"},"plant-uml":{"title":"PlantUML","alias":"plantuml","owner":"RunDevelopment"},"plsql":{"title":"PL/SQL","require":"sql","owner":"Golmote"},"powerquery":{"title":"PowerQuery","alias":["pq","mscript"],"owner":"peterbud"},"powershell":{"title":"PowerShell","owner":"nauzilus"},"processing":{"title":"Processing","require":"clike","owner":"Golmote"},"prolog":{"title":"Prolog","owner":"Golmote"},"promql":{"title":"PromQL","owner":"arendjr"},"properties":{"title":".properties","owner":"Golmote"},"protobuf":{"title":"Protocol Buffers","require":"clike","owner":"just-boris"},"pug":{"title":"Pug","require":["markup","javascript"],"optional":["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],"owner":"Golmote"},"puppet":{"title":"Puppet","owner":"Golmote"},"pure":{"title":"Pure","optional":["c","cpp","fortran"],"owner":"Golmote"},"purebasic":{"title":"PureBasic","require":"clike","alias":"pbfasm","owner":"HeX0R101"},"purescript":{"title":"PureScript","require":"haskell","alias":"purs","owner":"sriharshachilakapati"},"python":{"title":"Python","alias":"py","owner":"multipetros"},"qsharp":{"title":"Q#","require":"clike","alias":"qs","owner":"fedonman"},"q":{"title":"Q (kdb+ database)","owner":"Golmote"},"qml":{"title":"QML","require":"javascript","owner":"RunDevelopment"},"qore":{"title":"Qore","require":"clike","owner":"temnroegg"},"r":{"title":"R","owner":"Golmote"},"racket":{"title":"Racket","require":"scheme","alias":"rkt","owner":"RunDevelopment"},"cshtml":{"title":"Razor C#","alias":"razor","require":["markup","csharp"],"optional":["css","css-extras","javascript","js-extras"],"owner":"RunDevelopment"},"jsx":{"title":"React JSX","require":["markup","javascript"],"optional":["jsdoc","js-extras","js-templates"],"owner":"vkbansal"},"tsx":{"title":"React TSX","require":["jsx","typescript"]},"reason":{"title":"Reason","require":"clike","owner":"Golmote"},"regex":{"title":"Regex","owner":"RunDevelopment"},"rego":{"title":"Rego","owner":"JordanSh"},"renpy":{"title":"Ren'py","alias":"rpy","owner":"HyuchiaDiego"},"rest":{"title":"reST (reStructuredText)","owner":"Golmote"},"rip":{"title":"Rip","owner":"ravinggenius"},"roboconf":{"title":"Roboconf","owner":"Golmote"},"robotframework":{"title":"Robot Framework","alias":"robot","owner":"RunDevelopment"},"ruby":{"title":"Ruby","require":"clike","alias":"rb","owner":"samflores"},"rust":{"title":"Rust","owner":"Golmote"},"sas":{"title":"SAS","optional":["groovy","lua","sql"],"owner":"Golmote"},"sass":{"title":"Sass (Sass)","require":"css","optional":"css-extras","owner":"Golmote"},"scss":{"title":"Sass (Scss)","require":"css","optional":"css-extras","owner":"MoOx"},"scala":{"title":"Scala","require":"java","owner":"jozic"},"scheme":{"title":"Scheme","owner":"bacchus123"},"shell-session":{"title":"Shell session","require":"bash","alias":["sh-session","shellsession"],"owner":"RunDevelopment"},"smali":{"title":"Smali","owner":"RunDevelopment"},"smalltalk":{"title":"Smalltalk","owner":"Golmote"},"smarty":{"title":"Smarty","require":"markup-templating","optional":"php","owner":"Golmote"},"sml":{"title":"SML","alias":"smlnj","aliasTitles":{"smlnj":"SML/NJ"},"owner":"RunDevelopment"},"solidity":{"title":"Solidity (Ethereum)","alias":"sol","require":"clike","owner":"glachaud"},"solution-file":{"title":"Solution file","alias":"sln","owner":"RunDevelopment"},"soy":{"title":"Soy (Closure Template)","require":"markup-templating","owner":"Golmote"},"sparql":{"title":"SPARQL","require":"turtle","owner":"Triply-Dev","alias":"rq"},"splunk-spl":{"title":"Splunk SPL","owner":"RunDevelopment"},"sqf":{"title":"SQF: Status Quo Function (Arma 3)","require":"clike","owner":"RunDevelopment"},"sql":{"title":"SQL","owner":"multipetros"},"squirrel":{"title":"Squirrel","require":"clike","owner":"RunDevelopment"},"stan":{"title":"Stan","owner":"RunDevelopment"},"stata":{"title":"Stata Ado","require":["mata","java","python"],"owner":"RunDevelopment"},"iecst":{"title":"Structured Text (IEC 61131-3)","owner":"serhioromano"},"stylus":{"title":"Stylus","owner":"vkbansal"},"supercollider":{"title":"SuperCollider","alias":"sclang","owner":"RunDevelopment"},"swift":{"title":"Swift","owner":"chrischares"},"systemd":{"title":"Systemd configuration file","owner":"RunDevelopment"},"t4-templating":{"title":"T4 templating","owner":"RunDevelopment"},"t4-cs":{"title":"T4 Text Templates (C#)","require":["t4-templating","csharp"],"alias":"t4","owner":"RunDevelopment"},"t4-vb":{"title":"T4 Text Templates (VB)","require":["t4-templating","vbnet"],"owner":"RunDevelopment"},"tap":{"title":"TAP","owner":"isaacs","require":"yaml"},"tcl":{"title":"Tcl","owner":"PeterChaplin"},"tt2":{"title":"Template Toolkit 2","require":["clike","markup-templating"],"owner":"gflohr"},"textile":{"title":"Textile","require":"markup","optional":"css","owner":"Golmote"},"toml":{"title":"TOML","owner":"RunDevelopment"},"tremor":{"title":"Tremor","alias":["trickle","troy"],"owner":"darach","aliasTitles":{"trickle":"trickle","troy":"troy"}},"turtle":{"title":"Turtle","alias":"trig","aliasTitles":{"trig":"TriG"},"owner":"jakubklimek"},"twig":{"title":"Twig","require":"markup-templating","owner":"brandonkelly"},"typescript":{"title":"TypeScript","require":"javascript","optional":"js-templates","alias":"ts","owner":"vkbansal"},"typoscript":{"title":"TypoScript","alias":"tsconfig","aliasTitles":{"tsconfig":"TSConfig"},"owner":"dkern"},"unrealscript":{"title":"UnrealScript","alias":["uscript","uc"],"owner":"RunDevelopment"},"uorazor":{"title":"UO Razor Script","owner":"jaseowns"},"uri":{"title":"URI","alias":"url","aliasTitles":{"url":"URL"},"owner":"RunDevelopment"},"v":{"title":"V","require":"clike","owner":"taggon"},"vala":{"title":"Vala","require":"clike","optional":"regex","owner":"TemplarVolk"},"vbnet":{"title":"VB.Net","require":"basic","owner":"Bigsby"},"velocity":{"title":"Velocity","require":"markup","owner":"Golmote"},"verilog":{"title":"Verilog","owner":"a-rey"},"vhdl":{"title":"VHDL","owner":"a-rey"},"vim":{"title":"vim","owner":"westonganger"},"visual-basic":{"title":"Visual Basic","alias":["vb","vba"],"aliasTitles":{"vba":"VBA"},"owner":"Golmote"},"warpscript":{"title":"WarpScript","owner":"RunDevelopment"},"wasm":{"title":"WebAssembly","owner":"Golmote"},"web-idl":{"title":"Web IDL","alias":"webidl","owner":"RunDevelopment"},"wiki":{"title":"Wiki markup","require":"markup","owner":"Golmote"},"wolfram":{"title":"Wolfram language","alias":["mathematica","nb","wl"],"aliasTitles":{"mathematica":"Mathematica","nb":"Mathematica Notebook"},"owner":"msollami"},"wren":{"title":"Wren","owner":"clsource"},"xeora":{"title":"Xeora","require":"markup","alias":"xeoracube","aliasTitles":{"xeoracube":"XeoraCube"},"owner":"freakmaxi"},"xml-doc":{"title":"XML doc (.net)","require":"markup","modify":["csharp","fsharp","vbnet"],"owner":"RunDevelopment"},"xojo":{"title":"Xojo (REALbasic)","owner":"Golmote"},"xquery":{"title":"XQuery","require":"markup","owner":"Golmote"},"yaml":{"title":"YAML","alias":"yml","owner":"hason"},"yang":{"title":"YANG","owner":"RunDevelopment"},"zig":{"title":"Zig","owner":"RunDevelopment"}},"plugins":{"meta":{"path":"plugins/{id}/prism-{id}","link":"plugins/{id}/"},"line-highlight":{"title":"Line Highlight","description":"Highlights specific lines and/or line ranges."},"line-numbers":{"title":"Line Numbers","description":"Line number at the beginning of code lines.","owner":"kuba-kubula"},"show-invisibles":{"title":"Show Invisibles","description":"Show hidden characters such as tabs and line breaks.","optional":["autolinker","data-uri-highlight"]},"autolinker":{"title":"Autolinker","description":"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},"wpd":{"title":"WebPlatform Docs","description":"Makes tokens link to WebPlatform.org documentation. The links open in a new tab."},"custom-class":{"title":"Custom Class","description":"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.","owner":"dvkndn","noCSS":true},"file-highlight":{"title":"File Highlight","description":"Fetch external files and highlight them with Prism. Used on the Prism website itself.","noCSS":true},"show-language":{"title":"Show Language","description":"Display the highlighted language in code blocks (inline code does not show the label).","owner":"nauzilus","noCSS":true,"require":"toolbar"},"jsonp-highlight":{"title":"JSONP Highlight","description":"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).","noCSS":true,"owner":"nauzilus"},"highlight-keywords":{"title":"Highlight Keywords","description":"Adds special CSS classes for each keyword for fine-grained highlighting.","owner":"vkbansal","noCSS":true},"remove-initial-line-feed":{"title":"Remove initial line feed","description":"Removes the initial line feed in code blocks.","owner":"Golmote","noCSS":true},"inline-color":{"title":"Inline color","description":"Adds a small inline preview for colors in style sheets.","require":"css-extras","owner":"RunDevelopment"},"previewers":{"title":"Previewers","description":"Previewers for angles, colors, gradients, easing and time.","require":"css-extras","owner":"Golmote"},"autoloader":{"title":"Autoloader","description":"Automatically loads the needed languages to highlight the code blocks.","owner":"Golmote","noCSS":true},"keep-markup":{"title":"Keep Markup","description":"Prevents custom markup from being dropped out during highlighting.","owner":"Golmote","optional":"normalize-whitespace","noCSS":true},"command-line":{"title":"Command Line","description":"Display a command line with a prompt and, optionally, the output/response from the commands.","owner":"chriswells0"},"unescaped-markup":{"title":"Unescaped Markup","description":"Write markup without having to escape anything."},"normalize-whitespace":{"title":"Normalize Whitespace","description":"Supports multiple operations to normalize whitespace in code blocks.","owner":"zeitgeist87","optional":"unescaped-markup","noCSS":true},"data-uri-highlight":{"title":"Data-URI Highlight","description":"Highlights data-URI contents.","owner":"Golmote","noCSS":true},"toolbar":{"title":"Toolbar","description":"Attach a toolbar for plugins to easily register buttons on the top of a code block.","owner":"mAAdhaTTah"},"copy-to-clipboard":{"title":"Copy to Clipboard Button","description":"Add a button that copies the code block to the clipboard when clicked.","owner":"mAAdhaTTah","require":"toolbar","noCSS":true},"download-button":{"title":"Download Button","description":"A button in the toolbar of a code block adding a convenient way to download a code file.","owner":"Golmote","require":"toolbar","noCSS":true},"match-braces":{"title":"Match braces","description":"Highlights matching braces.","owner":"RunDevelopment"},"diff-highlight":{"title":"Diff Highlight","description":"Highlights the code inside diff blocks.","owner":"RunDevelopment","require":"diff"},"filter-highlight-all":{"title":"Filter highlightAll","description":"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.","owner":"RunDevelopment","noCSS":true},"treeview":{"title":"Treeview","description":"A language with special styles to highlight file system tree structures.","owner":"Golmote"}}}; +var components = {"core":{"meta":{"path":"components/prism-core.js","option":"mandatory"},"core":"Core"},"themes":{"meta":{"path":"themes/{id}.css","link":"index.html?theme={id}","exclusive":true},"prism":{"title":"Default","option":"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{"title":"Okaidia","owner":"ocodia"},"prism-twilight":{"title":"Twilight","owner":"remybach"},"prism-coy":{"title":"Coy","owner":"tshedor"},"prism-solarizedlight":{"title":"Solarized Light","owner":"hectormatos2011 "},"prism-tomorrow":{"title":"Tomorrow Night","owner":"Rosey"}},"languages":{"meta":{"path":"components/prism-{id}","noCSS":true,"examplesPath":"examples/prism-{id}","addCheckAll":true},"markup":{"title":"Markup","alias":["html","xml","svg","mathml","ssml","atom","rss"],"aliasTitles":{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","ssml":"SSML","atom":"Atom","rss":"RSS"},"option":"default"},"css":{"title":"CSS","option":"default","modify":"markup"},"clike":{"title":"C-like","option":"default"},"javascript":{"title":"JavaScript","require":"clike","modify":"markup","optional":"regex","alias":"js","option":"default"},"abap":{"title":"ABAP","owner":"dellagustin"},"abnf":{"title":"ABNF","owner":"RunDevelopment"},"actionscript":{"title":"ActionScript","require":"javascript","modify":"markup","owner":"Golmote"},"ada":{"title":"Ada","owner":"Lucretia"},"agda":{"title":"Agda","owner":"xy-ren"},"al":{"title":"AL","owner":"RunDevelopment"},"antlr4":{"title":"ANTLR4","alias":"g4","owner":"RunDevelopment"},"apacheconf":{"title":"Apache Configuration","owner":"GuiTeK"},"apex":{"title":"Apex","require":["clike","sql"],"owner":"RunDevelopment"},"apl":{"title":"APL","owner":"ngn"},"applescript":{"title":"AppleScript","owner":"Golmote"},"aql":{"title":"AQL","owner":"RunDevelopment"},"arduino":{"title":"Arduino","require":"cpp","alias":"ino","owner":"dkern"},"arff":{"title":"ARFF","owner":"Golmote"},"armasm":{"title":"ARM Assembly","alias":"arm-asm","owner":"RunDevelopment"},"arturo":{"title":"Arturo","alias":"art","optional":["bash","css","javascript","markup","markdown","sql"],"owner":"drkameleon"},"asciidoc":{"alias":"adoc","title":"AsciiDoc","owner":"Golmote"},"aspnet":{"title":"ASP.NET (C#)","require":["markup","csharp"],"owner":"nauzilus"},"asm6502":{"title":"6502 Assembly","owner":"kzurawel"},"asmatmel":{"title":"Atmel AVR Assembly","owner":"cerkit"},"autohotkey":{"title":"AutoHotkey","owner":"aviaryan"},"autoit":{"title":"AutoIt","owner":"Golmote"},"avisynth":{"title":"AviSynth","alias":"avs","owner":"Zinfidel"},"avro-idl":{"title":"Avro IDL","alias":"avdl","owner":"RunDevelopment"},"awk":{"title":"AWK","alias":"gawk","aliasTitles":{"gawk":"GAWK"},"owner":"RunDevelopment"},"bash":{"title":"Bash","alias":"shell","aliasTitles":{"shell":"Shell"},"owner":"zeitgeist87"},"basic":{"title":"BASIC","owner":"Golmote"},"batch":{"title":"Batch","owner":"Golmote"},"bbcode":{"title":"BBcode","alias":"shortcode","aliasTitles":{"shortcode":"Shortcode"},"owner":"RunDevelopment"},"bbj":{"title":"BBj","owner":"hyyan"},"bicep":{"title":"Bicep","owner":"johnnyreilly"},"birb":{"title":"Birb","require":"clike","owner":"Calamity210"},"bison":{"title":"Bison","require":"c","owner":"Golmote"},"bnf":{"title":"BNF","alias":"rbnf","aliasTitles":{"rbnf":"RBNF"},"owner":"RunDevelopment"},"brainfuck":{"title":"Brainfuck","owner":"Golmote"},"brightscript":{"title":"BrightScript","owner":"RunDevelopment"},"bro":{"title":"Bro","owner":"wayward710"},"bsl":{"title":"BSL (1C:Enterprise)","alias":"oscript","aliasTitles":{"oscript":"OneScript"},"owner":"Diversus23"},"c":{"title":"C","require":"clike","owner":"zeitgeist87"},"csharp":{"title":"C#","require":"clike","alias":["cs","dotnet"],"owner":"mvalipour"},"cpp":{"title":"C++","require":"c","owner":"zeitgeist87"},"cfscript":{"title":"CFScript","require":"clike","alias":"cfc","owner":"mjclemente"},"chaiscript":{"title":"ChaiScript","require":["clike","cpp"],"owner":"RunDevelopment"},"cil":{"title":"CIL","owner":"sbrl"},"clojure":{"title":"Clojure","owner":"troglotit"},"cmake":{"title":"CMake","owner":"mjrogozinski"},"cobol":{"title":"COBOL","owner":"RunDevelopment"},"coffeescript":{"title":"CoffeeScript","require":"javascript","alias":"coffee","owner":"R-osey"},"concurnas":{"title":"Concurnas","alias":"conc","owner":"jasontatton"},"csp":{"title":"Content-Security-Policy","owner":"ScottHelme"},"cooklang":{"title":"Cooklang","owner":"ahue"},"coq":{"title":"Coq","owner":"RunDevelopment"},"crystal":{"title":"Crystal","require":"ruby","owner":"MakeNowJust"},"css-extras":{"title":"CSS Extras","require":"css","modify":"css","owner":"milesj"},"csv":{"title":"CSV","owner":"RunDevelopment"},"cue":{"title":"CUE","owner":"RunDevelopment"},"cypher":{"title":"Cypher","owner":"RunDevelopment"},"d":{"title":"D","require":"clike","owner":"Golmote"},"dart":{"title":"Dart","require":"clike","owner":"Golmote"},"dataweave":{"title":"DataWeave","owner":"machaval"},"dax":{"title":"DAX","owner":"peterbud"},"dhall":{"title":"Dhall","owner":"RunDevelopment"},"diff":{"title":"Diff","owner":"uranusjr"},"django":{"title":"Django/Jinja2","require":"markup-templating","alias":"jinja2","owner":"romanvm"},"dns-zone-file":{"title":"DNS zone file","owner":"RunDevelopment","alias":"dns-zone"},"docker":{"title":"Docker","alias":"dockerfile","owner":"JustinBeckwith"},"dot":{"title":"DOT (Graphviz)","alias":"gv","optional":"markup","owner":"RunDevelopment"},"ebnf":{"title":"EBNF","owner":"RunDevelopment"},"editorconfig":{"title":"EditorConfig","owner":"osipxd"},"eiffel":{"title":"Eiffel","owner":"Conaclos"},"ejs":{"title":"EJS","require":["javascript","markup-templating"],"owner":"RunDevelopment","alias":"eta","aliasTitles":{"eta":"Eta"}},"elixir":{"title":"Elixir","owner":"Golmote"},"elm":{"title":"Elm","owner":"zwilias"},"etlua":{"title":"Embedded Lua templating","require":["lua","markup-templating"],"owner":"RunDevelopment"},"erb":{"title":"ERB","require":["ruby","markup-templating"],"owner":"Golmote"},"erlang":{"title":"Erlang","owner":"Golmote"},"excel-formula":{"title":"Excel Formula","alias":["xlsx","xls"],"owner":"RunDevelopment"},"fsharp":{"title":"F#","require":"clike","owner":"simonreynolds7"},"factor":{"title":"Factor","owner":"catb0t"},"false":{"title":"False","owner":"edukisto"},"firestore-security-rules":{"title":"Firestore security rules","require":"clike","owner":"RunDevelopment"},"flow":{"title":"Flow","require":"javascript","owner":"Golmote"},"fortran":{"title":"Fortran","owner":"Golmote"},"ftl":{"title":"FreeMarker Template Language","require":"markup-templating","owner":"RunDevelopment"},"gml":{"title":"GameMaker Language","alias":"gamemakerlanguage","require":"clike","owner":"LiarOnce"},"gap":{"title":"GAP (CAS)","owner":"RunDevelopment"},"gcode":{"title":"G-code","owner":"RunDevelopment"},"gcsim":{"title":"gcsim code","owner":"genshinsim"},"gdscript":{"title":"GDScript","owner":"RunDevelopment"},"gedcom":{"title":"GEDCOM","owner":"Golmote"},"gettext":{"title":"gettext","alias":"po","owner":"RunDevelopment"},"gherkin":{"title":"Gherkin","owner":"hason"},"git":{"title":"Git","owner":"lgiraudel"},"glsl":{"title":"GLSL","require":"c","owner":"Golmote"},"gn":{"title":"GN","alias":"gni","owner":"RunDevelopment"},"linker-script":{"title":"GNU Linker Script","alias":"ld","owner":"RunDevelopment"},"go":{"title":"Go","require":"clike","owner":"arnehormann"},"go-module":{"title":"Go module","alias":"go-mod","owner":"RunDevelopment"},"gradle":{"title":"Gradle","require":"clike","owner":"zeabdelkhalek-badido18"},"graphql":{"title":"GraphQL","optional":"markdown","owner":"Golmote"},"groovy":{"title":"Groovy","require":"clike","owner":"robfletcher"},"haml":{"title":"Haml","require":"ruby","optional":["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],"owner":"Golmote"},"handlebars":{"title":"Handlebars","require":"markup-templating","alias":["hbs","mustache"],"aliasTitles":{"mustache":"Mustache"},"owner":"Golmote"},"haskell":{"title":"Haskell","alias":"hs","owner":"bholst"},"haxe":{"title":"Haxe","require":"clike","optional":"regex","owner":"Golmote"},"hcl":{"title":"HCL","owner":"outsideris"},"hlsl":{"title":"HLSL","require":"c","owner":"RunDevelopment"},"hoon":{"title":"Hoon","owner":"matildepark"},"http":{"title":"HTTP","optional":["csp","css","hpkp","hsts","javascript","json","markup","uri"],"owner":"danielgtaylor"},"hpkp":{"title":"HTTP Public-Key-Pins","owner":"ScottHelme"},"hsts":{"title":"HTTP Strict-Transport-Security","owner":"ScottHelme"},"ichigojam":{"title":"IchigoJam","owner":"BlueCocoa"},"icon":{"title":"Icon","owner":"Golmote"},"icu-message-format":{"title":"ICU Message Format","owner":"RunDevelopment"},"idris":{"title":"Idris","alias":"idr","owner":"KeenS","require":"haskell"},"ignore":{"title":".ignore","owner":"osipxd","alias":["gitignore","hgignore","npmignore"],"aliasTitles":{"gitignore":".gitignore","hgignore":".hgignore","npmignore":".npmignore"}},"inform7":{"title":"Inform 7","owner":"Golmote"},"ini":{"title":"Ini","owner":"aviaryan"},"io":{"title":"Io","owner":"AlesTsurko"},"j":{"title":"J","owner":"Golmote"},"java":{"title":"Java","require":"clike","owner":"sherblot"},"javadoc":{"title":"JavaDoc","require":["markup","java","javadoclike"],"modify":"java","optional":"scala","owner":"RunDevelopment"},"javadoclike":{"title":"JavaDoc-like","modify":["java","javascript","php"],"owner":"RunDevelopment"},"javastacktrace":{"title":"Java stack trace","owner":"RunDevelopment"},"jexl":{"title":"Jexl","owner":"czosel"},"jolie":{"title":"Jolie","require":"clike","owner":"thesave"},"jq":{"title":"JQ","owner":"RunDevelopment"},"jsdoc":{"title":"JSDoc","require":["javascript","javadoclike","typescript"],"modify":"javascript","optional":["actionscript","coffeescript"],"owner":"RunDevelopment"},"js-extras":{"title":"JS Extras","require":"javascript","modify":"javascript","optional":["actionscript","coffeescript","flow","n4js","typescript"],"owner":"RunDevelopment"},"json":{"title":"JSON","alias":"webmanifest","aliasTitles":{"webmanifest":"Web App Manifest"},"owner":"CupOfTea696"},"json5":{"title":"JSON5","require":"json","owner":"RunDevelopment"},"jsonp":{"title":"JSONP","require":"json","owner":"RunDevelopment"},"jsstacktrace":{"title":"JS stack trace","owner":"sbrl"},"js-templates":{"title":"JS Templates","require":"javascript","modify":"javascript","optional":["css","css-extras","graphql","markdown","markup","sql"],"owner":"RunDevelopment"},"julia":{"title":"Julia","owner":"cdagnino"},"keepalived":{"title":"Keepalived Configure","owner":"dev-itsheng"},"keyman":{"title":"Keyman","owner":"mcdurdin"},"kotlin":{"title":"Kotlin","alias":["kt","kts"],"aliasTitles":{"kts":"Kotlin Script"},"require":"clike","owner":"Golmote"},"kumir":{"title":"KuMir (КуМир)","alias":"kum","owner":"edukisto"},"kusto":{"title":"Kusto","owner":"RunDevelopment"},"latex":{"title":"LaTeX","alias":["tex","context"],"aliasTitles":{"tex":"TeX","context":"ConTeXt"},"owner":"japborst"},"latte":{"title":"Latte","require":["clike","markup-templating","php"],"owner":"nette"},"less":{"title":"Less","require":"css","optional":"css-extras","owner":"Golmote"},"lilypond":{"title":"LilyPond","require":"scheme","alias":"ly","owner":"RunDevelopment"},"liquid":{"title":"Liquid","require":"markup-templating","owner":"cinhtau"},"lisp":{"title":"Lisp","alias":["emacs","elisp","emacs-lisp"],"owner":"JuanCaicedo"},"livescript":{"title":"LiveScript","owner":"Golmote"},"llvm":{"title":"LLVM IR","owner":"porglezomp"},"log":{"title":"Log file","optional":"javastacktrace","owner":"RunDevelopment"},"lolcode":{"title":"LOLCODE","owner":"Golmote"},"lua":{"title":"Lua","owner":"Golmote"},"magma":{"title":"Magma (CAS)","owner":"RunDevelopment"},"makefile":{"title":"Makefile","owner":"Golmote"},"markdown":{"title":"Markdown","require":"markup","optional":"yaml","alias":"md","owner":"Golmote"},"markup-templating":{"title":"Markup templating","require":"markup","owner":"Golmote"},"mata":{"title":"Mata","owner":"RunDevelopment"},"matlab":{"title":"MATLAB","owner":"Golmote"},"maxscript":{"title":"MAXScript","owner":"RunDevelopment"},"mel":{"title":"MEL","owner":"Golmote"},"mermaid":{"title":"Mermaid","owner":"RunDevelopment"},"metafont":{"title":"METAFONT","owner":"LaeriExNihilo"},"mizar":{"title":"Mizar","owner":"Golmote"},"mongodb":{"title":"MongoDB","owner":"airs0urce","require":"javascript"},"monkey":{"title":"Monkey","owner":"Golmote"},"moonscript":{"title":"MoonScript","alias":"moon","owner":"RunDevelopment"},"n1ql":{"title":"N1QL","owner":"TMWilds"},"n4js":{"title":"N4JS","require":"javascript","optional":"jsdoc","alias":"n4jsd","owner":"bsmith-n4"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","owner":"stephanmax"},"naniscript":{"title":"Naninovel Script","owner":"Elringus","alias":"nani"},"nasm":{"title":"NASM","owner":"rbmj"},"neon":{"title":"NEON","owner":"nette"},"nevod":{"title":"Nevod","owner":"nezaboodka"},"nginx":{"title":"nginx","owner":"volado"},"nim":{"title":"Nim","owner":"Golmote"},"nix":{"title":"Nix","owner":"Golmote"},"nsis":{"title":"NSIS","owner":"idleberg"},"objectivec":{"title":"Objective-C","require":"c","alias":"objc","owner":"uranusjr"},"ocaml":{"title":"OCaml","owner":"Golmote"},"odin":{"title":"Odin","owner":"edukisto"},"opencl":{"title":"OpenCL","require":"c","modify":["c","cpp"],"owner":"Milania1"},"openqasm":{"title":"OpenQasm","alias":"qasm","owner":"RunDevelopment"},"oz":{"title":"Oz","owner":"Golmote"},"parigp":{"title":"PARI/GP","owner":"Golmote"},"parser":{"title":"Parser","require":"markup","owner":"Golmote"},"pascal":{"title":"Pascal","alias":"objectpascal","aliasTitles":{"objectpascal":"Object Pascal"},"owner":"Golmote"},"pascaligo":{"title":"Pascaligo","owner":"DefinitelyNotAGoat"},"psl":{"title":"PATROL Scripting Language","owner":"bertysentry"},"pcaxis":{"title":"PC-Axis","alias":"px","owner":"RunDevelopment"},"peoplecode":{"title":"PeopleCode","alias":"pcode","owner":"RunDevelopment"},"perl":{"title":"Perl","owner":"Golmote"},"php":{"title":"PHP","require":"markup-templating","owner":"milesj"},"phpdoc":{"title":"PHPDoc","require":["php","javadoclike"],"modify":"php","owner":"RunDevelopment"},"php-extras":{"title":"PHP Extras","require":"php","modify":"php","owner":"milesj"},"plant-uml":{"title":"PlantUML","alias":"plantuml","owner":"RunDevelopment"},"plsql":{"title":"PL/SQL","require":"sql","owner":"Golmote"},"powerquery":{"title":"PowerQuery","alias":["pq","mscript"],"owner":"peterbud"},"powershell":{"title":"PowerShell","owner":"nauzilus"},"processing":{"title":"Processing","require":"clike","owner":"Golmote"},"prolog":{"title":"Prolog","owner":"Golmote"},"promql":{"title":"PromQL","owner":"arendjr"},"properties":{"title":".properties","owner":"Golmote"},"protobuf":{"title":"Protocol Buffers","require":"clike","owner":"just-boris"},"pug":{"title":"Pug","require":["markup","javascript"],"optional":["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],"owner":"Golmote"},"puppet":{"title":"Puppet","owner":"Golmote"},"pure":{"title":"Pure","optional":["c","cpp","fortran"],"owner":"Golmote"},"purebasic":{"title":"PureBasic","require":"clike","alias":"pbfasm","owner":"HeX0R101"},"purescript":{"title":"PureScript","require":"haskell","alias":"purs","owner":"sriharshachilakapati"},"python":{"title":"Python","alias":"py","owner":"multipetros"},"qsharp":{"title":"Q#","require":"clike","alias":"qs","owner":"fedonman"},"q":{"title":"Q (kdb+ database)","owner":"Golmote"},"qml":{"title":"QML","require":"javascript","owner":"RunDevelopment"},"qore":{"title":"Qore","require":"clike","owner":"temnroegg"},"r":{"title":"R","owner":"Golmote"},"racket":{"title":"Racket","require":"scheme","alias":"rkt","owner":"RunDevelopment"},"cshtml":{"title":"Razor C#","alias":"razor","require":["markup","csharp"],"optional":["css","css-extras","javascript","js-extras"],"owner":"RunDevelopment"},"jsx":{"title":"React JSX","require":["markup","javascript"],"optional":["jsdoc","js-extras","js-templates"],"owner":"vkbansal"},"tsx":{"title":"React TSX","require":["jsx","typescript"]},"reason":{"title":"Reason","require":"clike","owner":"Golmote"},"regex":{"title":"Regex","owner":"RunDevelopment"},"rego":{"title":"Rego","owner":"JordanSh"},"renpy":{"title":"Ren'py","alias":"rpy","owner":"HyuchiaDiego"},"rescript":{"title":"ReScript","alias":"res","owner":"vmarcosp"},"rest":{"title":"reST (reStructuredText)","owner":"Golmote"},"rip":{"title":"Rip","owner":"ravinggenius"},"roboconf":{"title":"Roboconf","owner":"Golmote"},"robotframework":{"title":"Robot Framework","alias":"robot","owner":"RunDevelopment"},"ruby":{"title":"Ruby","require":"clike","alias":"rb","owner":"samflores"},"rust":{"title":"Rust","owner":"Golmote"},"sas":{"title":"SAS","optional":["groovy","lua","sql"],"owner":"Golmote"},"sass":{"title":"Sass (Sass)","require":"css","optional":"css-extras","owner":"Golmote"},"scss":{"title":"Sass (SCSS)","require":"css","optional":"css-extras","owner":"MoOx"},"scala":{"title":"Scala","require":"java","owner":"jozic"},"scheme":{"title":"Scheme","owner":"bacchus123"},"shell-session":{"title":"Shell session","require":"bash","alias":["sh-session","shellsession"],"owner":"RunDevelopment"},"smali":{"title":"Smali","owner":"RunDevelopment"},"smalltalk":{"title":"Smalltalk","owner":"Golmote"},"smarty":{"title":"Smarty","require":"markup-templating","optional":"php","owner":"Golmote"},"sml":{"title":"SML","alias":"smlnj","aliasTitles":{"smlnj":"SML/NJ"},"owner":"RunDevelopment"},"solidity":{"title":"Solidity (Ethereum)","alias":"sol","require":"clike","owner":"glachaud"},"solution-file":{"title":"Solution file","alias":"sln","owner":"RunDevelopment"},"soy":{"title":"Soy (Closure Template)","require":"markup-templating","owner":"Golmote"},"sparql":{"title":"SPARQL","require":"turtle","owner":"Triply-Dev","alias":"rq"},"splunk-spl":{"title":"Splunk SPL","owner":"RunDevelopment"},"sqf":{"title":"SQF: Status Quo Function (Arma 3)","require":"clike","owner":"RunDevelopment"},"sql":{"title":"SQL","owner":"multipetros"},"squirrel":{"title":"Squirrel","require":"clike","owner":"RunDevelopment"},"stan":{"title":"Stan","owner":"RunDevelopment"},"stata":{"title":"Stata Ado","require":["mata","java","python"],"owner":"RunDevelopment"},"iecst":{"title":"Structured Text (IEC 61131-3)","owner":"serhioromano"},"stylus":{"title":"Stylus","owner":"vkbansal"},"supercollider":{"title":"SuperCollider","alias":"sclang","owner":"RunDevelopment"},"swift":{"title":"Swift","owner":"chrischares"},"systemd":{"title":"Systemd configuration file","owner":"RunDevelopment"},"t4-templating":{"title":"T4 templating","owner":"RunDevelopment"},"t4-cs":{"title":"T4 Text Templates (C#)","require":["t4-templating","csharp"],"alias":"t4","owner":"RunDevelopment"},"t4-vb":{"title":"T4 Text Templates (VB)","require":["t4-templating","vbnet"],"owner":"RunDevelopment"},"tap":{"title":"TAP","owner":"isaacs","require":"yaml"},"tcl":{"title":"Tcl","owner":"PeterChaplin"},"tt2":{"title":"Template Toolkit 2","require":["clike","markup-templating"],"owner":"gflohr"},"textile":{"title":"Textile","require":"markup","optional":"css","owner":"Golmote"},"toml":{"title":"TOML","owner":"RunDevelopment"},"tremor":{"title":"Tremor","alias":["trickle","troy"],"owner":"darach","aliasTitles":{"trickle":"trickle","troy":"troy"}},"turtle":{"title":"Turtle","alias":"trig","aliasTitles":{"trig":"TriG"},"owner":"jakubklimek"},"twig":{"title":"Twig","require":"markup-templating","owner":"brandonkelly"},"typescript":{"title":"TypeScript","require":"javascript","optional":"js-templates","alias":"ts","owner":"vkbansal"},"typoscript":{"title":"TypoScript","alias":"tsconfig","aliasTitles":{"tsconfig":"TSConfig"},"owner":"dkern"},"unrealscript":{"title":"UnrealScript","alias":["uscript","uc"],"owner":"RunDevelopment"},"uorazor":{"title":"UO Razor Script","owner":"jaseowns"},"uri":{"title":"URI","alias":"url","aliasTitles":{"url":"URL"},"owner":"RunDevelopment"},"v":{"title":"V","require":"clike","owner":"taggon"},"vala":{"title":"Vala","require":"clike","optional":"regex","owner":"TemplarVolk"},"vbnet":{"title":"VB.Net","require":"basic","owner":"Bigsby"},"velocity":{"title":"Velocity","require":"markup","owner":"Golmote"},"verilog":{"title":"Verilog","owner":"a-rey"},"vhdl":{"title":"VHDL","owner":"a-rey"},"vim":{"title":"vim","owner":"westonganger"},"visual-basic":{"title":"Visual Basic","alias":["vb","vba"],"aliasTitles":{"vba":"VBA"},"owner":"Golmote"},"warpscript":{"title":"WarpScript","owner":"RunDevelopment"},"wasm":{"title":"WebAssembly","owner":"Golmote"},"web-idl":{"title":"Web IDL","alias":"webidl","owner":"RunDevelopment"},"wgsl":{"title":"WGSL","owner":"Dr4gonthree"},"wiki":{"title":"Wiki markup","require":"markup","owner":"Golmote"},"wolfram":{"title":"Wolfram language","alias":["mathematica","nb","wl"],"aliasTitles":{"mathematica":"Mathematica","nb":"Mathematica Notebook"},"owner":"msollami"},"wren":{"title":"Wren","owner":"clsource"},"xeora":{"title":"Xeora","require":"markup","alias":"xeoracube","aliasTitles":{"xeoracube":"XeoraCube"},"owner":"freakmaxi"},"xml-doc":{"title":"XML doc (.net)","require":"markup","modify":["csharp","fsharp","vbnet"],"owner":"RunDevelopment"},"xojo":{"title":"Xojo (REALbasic)","owner":"Golmote"},"xquery":{"title":"XQuery","require":"markup","owner":"Golmote"},"yaml":{"title":"YAML","alias":"yml","owner":"hason"},"yang":{"title":"YANG","owner":"RunDevelopment"},"zig":{"title":"Zig","owner":"RunDevelopment"}},"plugins":{"meta":{"path":"plugins/{id}/prism-{id}","link":"plugins/{id}/"},"line-highlight":{"title":"Line Highlight","description":"Highlights specific lines and/or line ranges."},"line-numbers":{"title":"Line Numbers","description":"Line number at the beginning of code lines.","owner":"kuba-kubula"},"show-invisibles":{"title":"Show Invisibles","description":"Show hidden characters such as tabs and line breaks.","optional":["autolinker","data-uri-highlight"]},"autolinker":{"title":"Autolinker","description":"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},"wpd":{"title":"WebPlatform Docs","description":"Makes tokens link to WebPlatform.org documentation. The links open in a new tab."},"custom-class":{"title":"Custom Class","description":"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.","owner":"dvkndn","noCSS":true},"file-highlight":{"title":"File Highlight","description":"Fetch external files and highlight them with Prism. Used on the Prism website itself.","noCSS":true},"show-language":{"title":"Show Language","description":"Display the highlighted language in code blocks (inline code does not show the label).","owner":"nauzilus","noCSS":true,"require":"toolbar"},"jsonp-highlight":{"title":"JSONP Highlight","description":"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).","noCSS":true,"owner":"nauzilus"},"highlight-keywords":{"title":"Highlight Keywords","description":"Adds special CSS classes for each keyword for fine-grained highlighting.","owner":"vkbansal","noCSS":true},"remove-initial-line-feed":{"title":"Remove initial line feed","description":"Removes the initial line feed in code blocks.","owner":"Golmote","noCSS":true},"inline-color":{"title":"Inline color","description":"Adds a small inline preview for colors in style sheets.","require":"css-extras","owner":"RunDevelopment"},"previewers":{"title":"Previewers","description":"Previewers for angles, colors, gradients, easing and time.","require":"css-extras","owner":"Golmote"},"autoloader":{"title":"Autoloader","description":"Automatically loads the needed languages to highlight the code blocks.","owner":"Golmote","noCSS":true},"keep-markup":{"title":"Keep Markup","description":"Prevents custom markup from being dropped out during highlighting.","owner":"Golmote","optional":"normalize-whitespace","noCSS":true},"command-line":{"title":"Command Line","description":"Display a command line with a prompt and, optionally, the output/response from the commands.","owner":"chriswells0"},"unescaped-markup":{"title":"Unescaped Markup","description":"Write markup without having to escape anything."},"normalize-whitespace":{"title":"Normalize Whitespace","description":"Supports multiple operations to normalize whitespace in code blocks.","owner":"zeitgeist87","optional":"unescaped-markup","noCSS":true},"data-uri-highlight":{"title":"Data-URI Highlight","description":"Highlights data-URI contents.","owner":"Golmote","noCSS":true},"toolbar":{"title":"Toolbar","description":"Attach a toolbar for plugins to easily register buttons on the top of a code block.","owner":"mAAdhaTTah"},"copy-to-clipboard":{"title":"Copy to Clipboard Button","description":"Add a button that copies the code block to the clipboard when clicked.","owner":"mAAdhaTTah","require":"toolbar","noCSS":true},"download-button":{"title":"Download Button","description":"A button in the toolbar of a code block adding a convenient way to download a code file.","owner":"Golmote","require":"toolbar","noCSS":true},"match-braces":{"title":"Match braces","description":"Highlights matching braces.","owner":"RunDevelopment"},"diff-highlight":{"title":"Diff Highlight","description":"Highlights the code inside diff blocks.","owner":"RunDevelopment","require":"diff"},"filter-highlight-all":{"title":"Filter highlightAll","description":"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.","owner":"RunDevelopment","noCSS":true},"treeview":{"title":"Treeview","description":"A language with special styles to highlight file system tree structures.","owner":"Golmote"}}}; if (typeof module !== 'undefined' && module.exports) { module.exports = components; } \ No newline at end of file diff --git a/components.json b/components.json index e25f8762d8..453d990126 100644 --- a/components.json +++ b/components.json @@ -239,6 +239,10 @@ }, "owner": "RunDevelopment" }, + "bbj": { + "title": "BBj", + "owner": "hyyan" + }, "bicep": { "title": "Bicep", "owner": "johnnyreilly" @@ -580,6 +584,11 @@ "alias": "go-mod", "owner": "RunDevelopment" }, + "gradle": { + "title": "Gradle", + "require": "clike", + "owner": "zeabdelkhalek-badido18" + }, "graphql": { "title": "GraphQL", "optional": "markdown", @@ -958,6 +967,10 @@ "title": "Mermaid", "owner": "RunDevelopment" }, + "metafont": { + "title": "METAFONT", + "owner": "LaeriExNihilo" + }, "mizar": { "title": "Mizar", "owner": "Golmote" @@ -1034,6 +1047,10 @@ "title": "OCaml", "owner": "Golmote" }, + "odin": { + "title": "Odin", + "owner": "edukisto" + }, "opencl": { "title": "OpenCL", "require": "c", @@ -1287,6 +1304,11 @@ "alias": "rpy", "owner": "HyuchiaDiego" }, + "rescript": { + "title": "ReScript", + "alias": "res", + "owner": "vmarcosp" + }, "rest": { "title": "reST (reStructuredText)", "owner": "Golmote" @@ -1330,7 +1352,7 @@ "owner": "Golmote" }, "scss": { - "title": "Sass (Scss)", + "title": "Sass (SCSS)", "require": "css", "optional": "css-extras", "owner": "MoOx" @@ -1614,6 +1636,10 @@ "alias": "webidl", "owner": "RunDevelopment" }, + "wgsl": { + "title": "WGSL", + "owner": "Dr4gonthree" + }, "wiki": { "title": "Wiki markup", "require": "markup", diff --git a/components/prism-asciidoc.js b/components/prism-asciidoc.js index b4818e5a4e..b639a1756e 100644 --- a/components/prism-asciidoc.js +++ b/components/prism-asciidoc.js @@ -28,7 +28,7 @@ var asciidoc = Prism.languages.asciidoc = { 'comment-block': { - pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m, + pattern: /^(\/{4,})$[\s\S]*?^\1/m, alias: 'comment' }, 'table': { @@ -47,7 +47,7 @@ }, 'passthrough-block': { - pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(\+{4,})$[\s\S]*?^\1$/m, inside: { 'punctuation': /^\++|\++$/ // See rest below @@ -55,7 +55,7 @@ }, // Literal blocks and listing blocks 'literal-block': { - pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(-{4,}|\.{4,})$[\s\S]*?^\1$/m, inside: { 'punctuation': /^(?:-+|\.+)|(?:-+|\.+)$/ // See rest below @@ -63,7 +63,7 @@ }, // Sidebar blocks, quote blocks, example blocks and open blocks 'other-block': { - pattern: /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m, inside: { 'punctuation': /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/ // See rest below diff --git a/components/prism-asciidoc.min.js b/components/prism-asciidoc.min.js index e1badd1aac..6ca04ca364 100644 --- a/components/prism-asciidoc.min.js +++ b/components/prism-asciidoc.min.js @@ -1 +1 @@ -!function(t){var n={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}},i=t.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*](?:[<^>](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:n,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{function:/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:n.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:n,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|R|TM)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}};function e(t){for(var n={},e=0,a=(t=t.split(" ")).length;e](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:n,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{function:/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:n.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:n,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|R|TM)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}};function e(t){for(var n={},e=0,a=(t=t.split(" ")).length;e]\()\w+(?=\+?=)/, + pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/, inside: { 'environment': { pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars), @@ -113,6 +113,12 @@ alias: 'variable', lookbehind: true }, + // Highlight parameter names as variables + 'parameter': { + pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/, + alias: 'variable', + lookbehind: true + }, 'string': [ // Support for Here-documents https://en.wikipedia.org/wiki/Here_document { @@ -160,7 +166,7 @@ }, 'variable': insideString.variable, 'function': { - pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, + pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, lookbehind: true }, 'keyword': { @@ -207,6 +213,7 @@ 'function-name', 'for-or-select', 'assign-left', + 'parameter', 'string', 'environment', 'function', diff --git a/components/prism-bash.min.js b/components/prism-bash.min.js index 5d6986f1f0..40151efb60 100644 --- a/components/prism-bash.min.js +++ b/components/prism-bash.min.js @@ -1 +1 @@ -!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],s=a.variable[1].inside,i=0;i>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=a.variable[1].inside,i=0;i]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i, + 'punctuation': /[.,;:()]/ + }; +}(Prism)); diff --git a/components/prism-bbj.min.js b/components/prism-bbj.min.js new file mode 100644 index 0000000000..839b4a9439 --- /dev/null +++ b/components/prism-bbj.min.js @@ -0,0 +1 @@ +!function(e){e.languages.bbj={comment:{pattern:/(^|[^\\:])rem\s+.*/i,lookbehind:!0,greedy:!0},string:{pattern:/(['"])(?:(?!\1|\\).|\\.)*\1/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i,function:/\b\w+(?=\()/,boolean:/\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i,punctuation:/[.,;:()]/}}(Prism); \ No newline at end of file diff --git a/components/prism-css-extras.js b/components/prism-css-extras.js index be82d17e98..d9a3541b2b 100644 --- a/components/prism-css-extras.js +++ b/components/prism-css-extras.js @@ -98,7 +98,7 @@ }, 'color': [ { - pattern: /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i, + pattern: /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i, lookbehind: true }, { diff --git a/components/prism-css-extras.min.js b/components/prism-css-extras.min.js index b420594f91..2047692cc7 100644 --- a/components/prism-css-extras.min.js +++ b/components/prism-css-extras.min.js @@ -1 +1 @@ -!function(e){var a,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:a={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=a,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:i})}(Prism); \ No newline at end of file +!function(e){var a,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:a={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=a,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:i})}(Prism); \ No newline at end of file diff --git a/components/prism-css.js b/components/prism-css.js index f1f32fed28..80d3463c90 100644 --- a/components/prism-css.js +++ b/components/prism-css.js @@ -5,7 +5,7 @@ Prism.languages.css = { 'comment': /\/\*[\s\S]*?\*\//, 'atrule': { - pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/, + pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source), inside: { 'rule': /^@[\w-]+/, 'selector-function-argument': { diff --git a/components/prism-css.min.js b/components/prism-css.min.js index 1d3fc4f9c9..3a9b628ebe 100644 --- a/components/prism-css.min.js +++ b/components/prism-css.min.js @@ -1 +1 @@ -!function(s){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(Prism); \ No newline at end of file +!function(s){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|"+e.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(Prism); \ No newline at end of file diff --git a/components/prism-gcsim.js b/components/prism-gcsim.js index b2db7c1600..8094e9d2a8 100644 --- a/components/prism-gcsim.js +++ b/components/prism-gcsim.js @@ -30,7 +30,7 @@ Prism.languages.gcsim = { }, characters: { pattern: - /\b(?:travelerelectro|traveleranemo|travelergeo|travelerhydro|travelercryo|travelerpyro|travelerdendro|albedo|aloy|amber|barbara|beidou|bennett|chongyun|diluc|diona|eula|fischl|ganyu|hutao|jean|kaedeharakazuha|kazuha|kaeya|kamisatoayaka|ayaka|kamisatoayato|ayato|keqing|klee|kujousara|kujosara|sara|lisa|mona|ningguang|noelle|qiqi|raidenshogun|raiden|razor|rosaria|sangonomiyakokomi|kokomi|sayu|sucrose|tartaglia|thoma|venti|xiangling|xiao|xingqiu|xinyan|yanfei|yoimiya|yunjin|zhongli|gorou|aratakiitto|itto|shenhe|yae(?:miko)?)\b/, + /\b(?:travelerelectro|traveleranemo|travelergeo|travelerhydro|travelercryo|travelerpyro|travelerdendro|albedo|aloy|amber|barbara|beidou|bennett|chongyun|diluc|diona|eula|fischl|ganyu|hutao|jean|kaedeharakazuha|kazuha|kaeya|kamisatoayaka|ayaka|kamisatoayato|ayato|keqing|klee|kujousara|kujosara|sara|lisa|mona|ningguang|noelle|qiqi|raidenshogun|raiden|razor|rosaria|sangonomiyakokomi|kokomi|sayu|sucrose|tartaglia|thoma|venti|xiangling|xiao|xingqiu|xinyan|yanfei|yoimiya|yunjin|zhongli|gorou|aratakiitto|itto|shenhe|yae(?:miko)?|yelan|kuki|kukishinobu|shikanoinheizou|heizou)\b/, alias: "constant", }, other: { @@ -58,4 +58,4 @@ Prism.languages.gcsim = { boolean: /\b(?:false|true)\b/, }; -// Prism.languages.webmanifest = Prism.languages.gcsim; +// Prism.languages.webmanifest = Prism.languages.gcsim; \ No newline at end of file diff --git a/components/prism-gcsim.min.js b/components/prism-gcsim.min.js index 94c3690a1e..fdcf377a92 100644 --- a/components/prism-gcsim.min.js +++ b/components/prism-gcsim.min.js @@ -1 +1 @@ -Prism.languages.gcsim={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\#.*/,greedy:!0},keywords:{pattern:/\b(?:chain|wait_for|wait(?: )|restart|reset_limit|hurt|target|energy|active|options|add|char|stats|weapon|set|lvl|refine|cons|talent|start_hp|count|\+params|until)\b/,alias:"keyword"},options:{pattern:/\b(?:debug|iteration|duration|workers|mode)\b/,alias:"tag"},abilities:{pattern:/\b(?:skill|burst|attack|charge|aim|high_plunge|low_plunge|jump|dash)\b/,alias:"function"},characters:{pattern:/\b(?:travelerelectro|traveleranemo|travelergeo|travelerhydro|travelercryo|travelerpyro|travelerdendro|albedo|aloy|amber|barbara|beidou|bennett|chongyun|diluc|diona|eula|fischl|ganyu|hutao|jean|kaedeharakazuha|kazuha|kaeya|kamisatoayaka|ayaka|kamisatoayato|ayato|keqing|klee|kujousara|kujosara|sara|lisa|mona|ningguang|noelle|qiqi|raidenshogun|raiden|razor|rosaria|sangonomiyakokomi|kokomi|sayu|sucrose|tartaglia|thoma|venti|xiangling|xiao|xingqiu|xinyan|yanfei|yoimiya|yunjin|zhongli|gorou|aratakiitto|itto|shenhe|yae(?:miko)?)\b/,alias:"constant"},other:{pattern:/\b(?:value|max|filler|interval|every|once|amount|ele(?:ctro)?(?:\%)?|resist|pyro(?:\%)?|dendro(?:\%)?|hydro(?:\%)?|geo(?:\%)?|anemo(?:\%)?|physical|cryo(?:\%)?)/,alias:"tag"},stats:{pattern:/\b(?:(?:hp(?:\%)?|atk(?:\%)?|def(?:\%)?|er|em|cr|cd|heal|phys\%))/,alias:"tag"},stringkeys:{pattern:/\b(?:sl|apl)\b/,alias:"string"},flags:{pattern:/(?:\+if|\+swap_to|\+swap_lock|\+is_onfield|\+needs|\+limit|\+timeout|\+try|\+drop|\+label)\b/,alias:"tag"},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/}; \ No newline at end of file +Prism.languages.gcsim={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\#.*/,greedy:!0},keywords:{pattern:/\b(?:chain|wait_for|wait(?: )|restart|reset_limit|hurt|target|energy|active|options|add|char|stats|weapon|set|lvl|refine|cons|talent|start_hp|count|\+params|until)\b/,alias:"keyword"},options:{pattern:/\b(?:debug|iteration|duration|workers|mode)\b/,alias:"tag"},abilities:{pattern:/\b(?:skill|burst|attack|charge|aim|high_plunge|low_plunge|jump|dash)\b/,alias:"function"},characters:{pattern:/\b(?:travelerelectro|traveleranemo|travelergeo|travelerhydro|travelercryo|travelerpyro|travelerdendro|albedo|aloy|amber|barbara|beidou|bennett|chongyun|diluc|diona|eula|fischl|ganyu|hutao|jean|kaedeharakazuha|kazuha|kaeya|kamisatoayaka|ayaka|kamisatoayato|ayato|keqing|klee|kujousara|kujosara|sara|lisa|mona|ningguang|noelle|qiqi|raidenshogun|raiden|razor|rosaria|sangonomiyakokomi|kokomi|sayu|sucrose|tartaglia|thoma|venti|xiangling|xiao|xingqiu|xinyan|yanfei|yoimiya|yunjin|zhongli|gorou|aratakiitto|itto|shenhe|yae(?:miko)?|yelan|kuki|kukishinobu|shikanoinheizou|heizou)\b/,alias:"constant"},other:{pattern:/\b(?:value|max|filler|interval|every|once|amount|ele(?:ctro)?(?:\%)?|resist|pyro(?:\%)?|dendro(?:\%)?|hydro(?:\%)?|geo(?:\%)?|anemo(?:\%)?|physical|cryo(?:\%)?)/,alias:"tag"},stats:{pattern:/\b(?:(?:hp(?:\%)?|atk(?:\%)?|def(?:\%)?|er|em|cr|cd|heal|phys\%))/,alias:"tag"},stringkeys:{pattern:/\b(?:sl|apl)\b/,alias:"string"},flags:{pattern:/(?:\+if|\+swap_to|\+swap_lock|\+is_onfield|\+needs|\+limit|\+timeout|\+try|\+drop|\+label)\b/,alias:"tag"},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/}; \ No newline at end of file diff --git a/components/prism-gradle.js b/components/prism-gradle.js new file mode 100644 index 0000000000..96020f64b2 --- /dev/null +++ b/components/prism-gradle.js @@ -0,0 +1,63 @@ +(function (Prism) { + var interpolation = { + pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + 'expression': { + pattern: /[\s\S]+/, + inside: null, + }, + }, + }; + + Prism.languages.gradle = Prism.languages.extend('clike', { + 'string': { + pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/, + greedy: true, + }, + 'keyword': + /\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/, + 'number': /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, + 'operator': { + pattern: + /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, + lookbehind: true, + }, + 'punctuation': /\.+|[{}[\];(),:$]/, + }); + + Prism.languages.insertBefore('gradle', 'string', { + 'shebang': { + pattern: /#!.+/, + alias: 'comment', + greedy: true, + }, + 'interpolation-string': { + pattern: + /"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, + greedy: true, + inside: { + 'interpolation': interpolation, + 'string': /[\s\S]+/, + }, + }, + }); + + Prism.languages.insertBefore('gradle', 'punctuation', { + 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, + }); + + Prism.languages.insertBefore('gradle', 'function', { + 'annotation': { + pattern: /(^|[^.])@\w+/, + lookbehind: true, + alias: 'punctuation', + }, + }); + + interpolation.inside.expression.inside = Prism.languages.gradle; +}(Prism)); diff --git a/components/prism-gradle.min.js b/components/prism-gradle.min.js new file mode 100644 index 0000000000..96aae9aa04 --- /dev/null +++ b/components/prism-gradle.min.js @@ -0,0 +1 @@ +!function(e){var n={pattern:/((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}};e.languages.gradle=e.languages.extend("clike",{string:{pattern:/'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,greedy:!0},keyword:/\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),e.languages.insertBefore("gradle","string",{shebang:{pattern:/#!.+/,alias:"comment",greedy:!0},"interpolation-string":{pattern:/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}}}),e.languages.insertBefore("gradle","punctuation",{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),e.languages.insertBefore("gradle","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),n.inside.expression.inside=e.languages.gradle}(Prism); \ No newline at end of file diff --git a/components/prism-hoon.js b/components/prism-hoon.js index 400a1bd290..57d1dd70c7 100644 --- a/components/prism-hoon.js +++ b/components/prism-hoon.js @@ -4,7 +4,7 @@ Prism.languages.hoon = { greedy: true }, 'string': { - pattern: /"[^"]*"|'[^']*'/, + pattern: /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/, greedy: true }, 'constant': /%(?:\.[ny]|[\w-]+)/, diff --git a/components/prism-hoon.min.js b/components/prism-hoon.min.js index 168915a445..7ffbe14847 100644 --- a/components/prism-hoon.min.js +++ b/components/prism-hoon.min.js @@ -1 +1 @@ -Prism.languages.hoon={comment:{pattern:/::.*/,greedy:!0},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},constant:/%(?:\.[ny]|[\w-]+)/,"class-name":/@(?:[a-z0-9-]*[a-z0-9])?|\*/i,function:/(?:\+[-+] {2})?(?:[a-z](?:[a-z0-9-]*[a-z0-9])?)/,keyword:/\.[\^\+\*=\?]|![><:\.=\?!]|=[>|:,\.\-\^<+;/~\*\?]|\?[>|:\.\-\^<\+&~=@!]|\|[\$_%:\.\-\^~\*=@\?]|\+[|\$\+\*]|:[_\-\^\+~\*]|%[_:\.\-\^\+~\*=]|\^[|:\.\-\+&~\*=\?]|\$[|_%:<>\-\^&~@=\?]|;[:<\+;\/~\*=]|~[>|\$_%<\+\/&=\?!]|--|==/}; \ No newline at end of file +Prism.languages.hoon={comment:{pattern:/::.*/,greedy:!0},string:{pattern:/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/,greedy:!0},constant:/%(?:\.[ny]|[\w-]+)/,"class-name":/@(?:[a-z0-9-]*[a-z0-9])?|\*/i,function:/(?:\+[-+] {2})?(?:[a-z](?:[a-z0-9-]*[a-z0-9])?)/,keyword:/\.[\^\+\*=\?]|![><:\.=\?!]|=[>|:,\.\-\^<+;/~\*\?]|\?[>|:\.\-\^<\+&~=@!]|\|[\$_%:\.\-\^~\*=@\?]|\+[|\$\+\*]|:[_\-\^\+~\*]|%[_:\.\-\^\+~\*=]|\^[|:\.\-\+&~\*=\?]|\$[|_%:<>\-\^&~@=\?]|;[:<\+;\/~\*=]|~[>|\$_%<\+\/&=\?!]|--|==/}; \ No newline at end of file diff --git a/components/prism-java.js b/components/prism-java.js index 9d10f2fe62..873154cfed 100644 --- a/components/prism-java.js +++ b/components/prism-java.js @@ -55,7 +55,8 @@ 'operator': { pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, lookbehind: true - } + }, + 'constant': /\b[A-Z][A-Z_\d]+\b/ }); Prism.languages.insertBefore('java', 'string', { diff --git a/components/prism-java.min.js b/components/prism-java.min.js index d240e5076e..9b90cf3cc3 100644 --- a/components/prism-java.min.js +++ b/components/prism-java.min.js @@ -1 +1 @@ -!function(e){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t="(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",s={pattern:RegExp("(^|[^\\w.])"+t+"[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b"),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp("(^|[^\\w.])"+t+"[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)"),lookbehind:!0,inside:s.inside},{pattern:RegExp("(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)"+t+"[A-Z]\\w*\\b"),lookbehind:!0,inside:s.inside}],keyword:n,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp("(\\bimport\\s+)"+t+"(?:[A-Z]\\w*|\\*)(?=\\s*;)"),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp("(\\bimport\\s+static\\s+)"+t+"(?:\\w+|\\*)(?=\\s*;)"),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp("(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?".replace(//g,(function(){return n.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism); \ No newline at end of file +!function(e){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t="(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",s={pattern:RegExp("(^|[^\\w.])"+t+"[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b"),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp("(^|[^\\w.])"+t+"[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)"),lookbehind:!0,inside:s.inside},{pattern:RegExp("(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)"+t+"[A-Z]\\w*\\b"),lookbehind:!0,inside:s.inside}],keyword:n,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp("(\\bimport\\s+)"+t+"(?:[A-Z]\\w*|\\*)(?=\\s*;)"),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp("(\\bimport\\s+static\\s+)"+t+"(?:\\w+|\\*)(?=\\s*;)"),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp("(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?".replace(//g,(function(){return n.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism); \ No newline at end of file diff --git a/components/prism-markup.js b/components/prism-markup.js index 7d4d2e2b4f..651c62ee08 100644 --- a/components/prism-markup.js +++ b/components/prism-markup.js @@ -51,7 +51,10 @@ Prism.languages.markup = { pattern: /^=/, alias: 'attr-equals' }, - /"|'/ + { + pattern: /^(\s*)["']|["']$/, + lookbehind: true + } ] } }, diff --git a/components/prism-markup.min.js b/components/prism-markup.min.js index ee4b23ac66..d39ab7faf9 100644 --- a/components/prism-markup.min.js +++ b/components/prism-markup.min.js @@ -1 +1 @@ -Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml; \ No newline at end of file +Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml; \ No newline at end of file diff --git a/components/prism-metafont.js b/components/prism-metafont.js new file mode 100644 index 0000000000..50a61b4b92 --- /dev/null +++ b/components/prism-metafont.js @@ -0,0 +1,84 @@ +Prism.languages.metafont = { + // Syntax of METAFONT with the added (public) elements of PlainMETAFONT. Except for internal quantities they are expected to be rarely redefined. Freely inspired by the syntax of Christophe Grandsire for the Crimson Editor. + 'comment': { + pattern: /%.*/, + greedy: true + }, + 'string': { + pattern: /"[^\r\n"]*"/, + greedy: true + }, + 'number': /\d*\.?\d+/, + 'boolean': /\b(?:false|true)\b/, + 'punctuation': [ + /[,;()]/, + { + pattern: /(^|[^{}])(?:\{|\})(?![{}])/, + lookbehind: true + }, + { + pattern: /(^|[^[])\[(?!\[)/, + lookbehind: true + }, + { + pattern: /(^|[^\]])\](?!\])/, + lookbehind: true + } + ], + 'constant': [ + { + pattern: /(^|[^!?])\?\?\?(?![!?])/, + lookbehind: true + }, + { + pattern: /(^|[^/*\\])(?:\\|\\\\)(?![/*\\])/, + lookbehind: true + }, + /\b(?:_|blankpicture|bp|cc|cm|dd|ditto|down|eps|epsilon|fullcircle|halfcircle|identity|in|infinity|left|mm|nullpen|nullpicture|origin|pc|penrazor|penspeck|pensquare|penstroke|proof|pt|quartercircle|relax|right|smoke|unitpixel|unitsquare|up)\b/ + ], + 'quantity': { + pattern: /\b(?:autorounding|blacker|boundarychar|charcode|chardp|chardx|chardy|charext|charht|charic|charwd|currentwindow|day|designsize|displaying|fillin|fontmaking|granularity|hppp|join_radius|month|o_correction|pausing|pen_(?:bot|lft|rt|top)|pixels_per_inch|proofing|showstopping|smoothing|time|tolerance|tracingcapsules|tracingchoices|tracingcommands|tracingedges|tracingequations|tracingmacros|tracingonline|tracingoutput|tracingpens|tracingrestores|tracingspecs|tracingstats|tracingtitles|turningcheck|vppp|warningcheck|xoffset|year|yoffset)\b/, + alias: 'keyword' + }, + 'command': { + pattern: /\b(?:addto|batchmode|charlist|cull|display|errhelp|errmessage|errorstopmode|everyjob|extensible|fontdimen|headerbyte|inner|interim|let|ligtable|message|newinternal|nonstopmode|numspecial|openwindow|outer|randomseed|save|scrollmode|shipout|show|showdependencies|showstats|showtoken|showvariable|special)\b/, + alias: 'builtin' + }, + 'operator': [ + { + pattern: /(^|[^>=<:|])(?:<|<=|=|=:|\|=:|\|=:>|=:\|>|=:\||\|=:\||\|=:\|>|\|=:\|>>|>|>=|:|:=|<>|::|\|\|:)(?![>=<:|])/, + lookbehind: true + }, + { + pattern: /(^|[^+-])(?:\+|\+\+|-{1,3}|\+-\+)(?![+-])/, + lookbehind: true + }, + { + pattern: /(^|[^/*\\])(?:\*|\*\*|\/)(?![/*\\])/, + lookbehind: true + }, + { + pattern: /(^|[^.])(?:\.{2,3})(?!\.)/, + lookbehind: true + }, + { + pattern: /(^|[^@#&$])&(?![@#&$])/, + lookbehind: true + }, + /\b(?:and|not|or)\b/ + ], + 'macro': { + pattern: /\b(?:abs|beginchar|bot|byte|capsule_def|ceiling|change_width|clear_pen_memory|clearit|clearpen|clearxy|counterclockwise|cullit|cutdraw|cutoff|decr|define_blacker_pixels|define_corrected_pixels|define_good_x_pixels|define_good_y_pixels|define_horizontal_corrected_pixels|define_pixels|define_whole_blacker_pixels|define_whole_pixels|define_whole_vertical_blacker_pixels|define_whole_vertical_pixels|dir|direction|directionpoint|div|dotprod|downto|draw|drawdot|endchar|erase|fill|filldraw|fix_units|flex|font_coding_scheme|font_extra_space|font_identifier|font_normal_shrink|font_normal_space|font_normal_stretch|font_quad|font_size|font_slant|font_x_height|gfcorners|gobble|gobbled|good\.(?:bot|lft|rt|top|x|y)|grayfont|hide|hround|imagerules|incr|interact|interpath|intersectionpoint|inverse|italcorr|killtext|labelfont|labels|lft|loggingall|lowres_fix|makegrid|makelabel(?:\.(?:bot|lft|rt|top)(?:\.nodot)?)?|max|min|mod|mode_def|mode_setup|nodisplays|notransforms|numtok|openit|penlabels|penpos|pickup|proofoffset|proofrule|proofrulethickness|range|reflectedabout|rotatedabout|rotatedaround|round|rt|savepen|screenchars|screenrule|screenstrokes|shipit|showit|slantfont|softjoin|solve|stop|superellipse|tensepath|thru|titlefont|top|tracingall|tracingnone|undraw|undrawdot|unfill|unfilldraw|upto|vround)\b/, + alias: 'function' + }, + 'builtin': /\b(?:ASCII|angle|char|cosd|decimal|directiontime|floor|hex|intersectiontimes|jobname|known|length|makepath|makepen|mexp|mlog|normaldeviate|oct|odd|pencircle|penoffset|point|postcontrol|precontrol|reverse|rotated|sind|sqrt|str|subpath|substring|totalweight|turningnumber|uniformdeviate|unknown|xpart|xxpart|xypart|ypart|yxpart|yypart)\b/, + 'keyword': /\b(?:also|at|atleast|begingroup|charexists|contour|controls|curl|cycle|def|delimiters|doublepath|dropping|dump|else|elseif|end|enddef|endfor|endgroup|endinput|exitif|exitunless|expandafter|fi|for|forever|forsuffixes|from|if|input|inwindow|keeping|kern|of|primarydef|quote|readstring|scaled|scantokens|secondarydef|shifted|skipto|slanted|step|tension|tertiarydef|to|transformed|until|vardef|withpen|withweight|xscaled|yscaled|zscaled)\b/, + 'type': { + pattern: /\b(?:boolean|expr|numeric|pair|path|pen|picture|primary|secondary|string|suffix|tertiary|text|transform)\b/, + alias: 'property' + }, + 'variable': { + pattern: /(^|[^@#&$])(?:@#|#@|#|@)(?![@#&$])|\b(?:aspect_ratio|currentpen|currentpicture|currenttransform|d|extra_beginchar|extra_endchar|extra_setup|h|localfont|mag|mode|screen_cols|screen_rows|w|whatever|x|y|z)\b/, + lookbehind: true + } +}; diff --git a/components/prism-metafont.min.js b/components/prism-metafont.min.js new file mode 100644 index 0000000000..ac9da74bcb --- /dev/null +++ b/components/prism-metafont.min.js @@ -0,0 +1 @@ +Prism.languages.metafont={comment:{pattern:/%.*/,greedy:!0},string:{pattern:/"[^\r\n"]*"/,greedy:!0},number:/\d*\.?\d+/,boolean:/\b(?:false|true)\b/,punctuation:[/[,;()]/,{pattern:/(^|[^{}])(?:\{|\})(?![{}])/,lookbehind:!0},{pattern:/(^|[^[])\[(?!\[)/,lookbehind:!0},{pattern:/(^|[^\]])\](?!\])/,lookbehind:!0}],constant:[{pattern:/(^|[^!?])\?\?\?(?![!?])/,lookbehind:!0},{pattern:/(^|[^/*\\])(?:\\|\\\\)(?![/*\\])/,lookbehind:!0},/\b(?:_|blankpicture|bp|cc|cm|dd|ditto|down|eps|epsilon|fullcircle|halfcircle|identity|in|infinity|left|mm|nullpen|nullpicture|origin|pc|penrazor|penspeck|pensquare|penstroke|proof|pt|quartercircle|relax|right|smoke|unitpixel|unitsquare|up)\b/],quantity:{pattern:/\b(?:autorounding|blacker|boundarychar|charcode|chardp|chardx|chardy|charext|charht|charic|charwd|currentwindow|day|designsize|displaying|fillin|fontmaking|granularity|hppp|join_radius|month|o_correction|pausing|pen_(?:bot|lft|rt|top)|pixels_per_inch|proofing|showstopping|smoothing|time|tolerance|tracingcapsules|tracingchoices|tracingcommands|tracingedges|tracingequations|tracingmacros|tracingonline|tracingoutput|tracingpens|tracingrestores|tracingspecs|tracingstats|tracingtitles|turningcheck|vppp|warningcheck|xoffset|year|yoffset)\b/,alias:"keyword"},command:{pattern:/\b(?:addto|batchmode|charlist|cull|display|errhelp|errmessage|errorstopmode|everyjob|extensible|fontdimen|headerbyte|inner|interim|let|ligtable|message|newinternal|nonstopmode|numspecial|openwindow|outer|randomseed|save|scrollmode|shipout|show|showdependencies|showstats|showtoken|showvariable|special)\b/,alias:"builtin"},operator:[{pattern:/(^|[^>=<:|])(?:<|<=|=|=:|\|=:|\|=:>|=:\|>|=:\||\|=:\||\|=:\|>|\|=:\|>>|>|>=|:|:=|<>|::|\|\|:)(?![>=<:|])/,lookbehind:!0},{pattern:/(^|[^+-])(?:\+|\+\+|-{1,3}|\+-\+)(?![+-])/,lookbehind:!0},{pattern:/(^|[^/*\\])(?:\*|\*\*|\/)(?![/*\\])/,lookbehind:!0},{pattern:/(^|[^.])(?:\.{2,3})(?!\.)/,lookbehind:!0},{pattern:/(^|[^@#&$])&(?![@#&$])/,lookbehind:!0},/\b(?:and|not|or)\b/],macro:{pattern:/\b(?:abs|beginchar|bot|byte|capsule_def|ceiling|change_width|clear_pen_memory|clearit|clearpen|clearxy|counterclockwise|cullit|cutdraw|cutoff|decr|define_blacker_pixels|define_corrected_pixels|define_good_x_pixels|define_good_y_pixels|define_horizontal_corrected_pixels|define_pixels|define_whole_blacker_pixels|define_whole_pixels|define_whole_vertical_blacker_pixels|define_whole_vertical_pixels|dir|direction|directionpoint|div|dotprod|downto|draw|drawdot|endchar|erase|fill|filldraw|fix_units|flex|font_coding_scheme|font_extra_space|font_identifier|font_normal_shrink|font_normal_space|font_normal_stretch|font_quad|font_size|font_slant|font_x_height|gfcorners|gobble|gobbled|good\.(?:bot|lft|rt|top|x|y)|grayfont|hide|hround|imagerules|incr|interact|interpath|intersectionpoint|inverse|italcorr|killtext|labelfont|labels|lft|loggingall|lowres_fix|makegrid|makelabel(?:\.(?:bot|lft|rt|top)(?:\.nodot)?)?|max|min|mod|mode_def|mode_setup|nodisplays|notransforms|numtok|openit|penlabels|penpos|pickup|proofoffset|proofrule|proofrulethickness|range|reflectedabout|rotatedabout|rotatedaround|round|rt|savepen|screenchars|screenrule|screenstrokes|shipit|showit|slantfont|softjoin|solve|stop|superellipse|tensepath|thru|titlefont|top|tracingall|tracingnone|undraw|undrawdot|unfill|unfilldraw|upto|vround)\b/,alias:"function"},builtin:/\b(?:ASCII|angle|char|cosd|decimal|directiontime|floor|hex|intersectiontimes|jobname|known|length|makepath|makepen|mexp|mlog|normaldeviate|oct|odd|pencircle|penoffset|point|postcontrol|precontrol|reverse|rotated|sind|sqrt|str|subpath|substring|totalweight|turningnumber|uniformdeviate|unknown|xpart|xxpart|xypart|ypart|yxpart|yypart)\b/,keyword:/\b(?:also|at|atleast|begingroup|charexists|contour|controls|curl|cycle|def|delimiters|doublepath|dropping|dump|else|elseif|end|enddef|endfor|endgroup|endinput|exitif|exitunless|expandafter|fi|for|forever|forsuffixes|from|if|input|inwindow|keeping|kern|of|primarydef|quote|readstring|scaled|scantokens|secondarydef|shifted|skipto|slanted|step|tension|tertiarydef|to|transformed|until|vardef|withpen|withweight|xscaled|yscaled|zscaled)\b/,type:{pattern:/\b(?:boolean|expr|numeric|pair|path|pen|picture|primary|secondary|string|suffix|tertiary|text|transform)\b/,alias:"property"},variable:{pattern:/(^|[^@#&$])(?:@#|#@|#|@)(?![@#&$])|\b(?:aspect_ratio|currentpen|currentpicture|currenttransform|d|extra_beginchar|extra_endchar|extra_setup|h|localfont|mag|mode|screen_cols|screen_rows|w|whatever|x|y|z)\b/,lookbehind:!0}}; \ No newline at end of file diff --git a/components/prism-nsis.js b/components/prism-nsis.js index f012f09f05..ff755aa1cc 100644 --- a/components/prism-nsis.js +++ b/components/prism-nsis.js @@ -14,7 +14,7 @@ Prism.languages.nsis = { greedy: true }, 'keyword': { - pattern: /(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m, + pattern: /(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|KnownFolderPath|LabelAddress|TempFileName|WinVer)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|RtlLanguage|ShellVarContextAll|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Target|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m, lookbehind: true }, 'property': /\b(?:ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY|admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user)\b/, diff --git a/components/prism-nsis.min.js b/components/prism-nsis.min.js index 6e577777ab..9aa0719a0a 100644 --- a/components/prism-nsis.min.js +++ b/components/prism-nsis.min.js @@ -1 +1 @@ -Prism.languages.nsis={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,lookbehind:!0,greedy:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:{pattern:/(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m,lookbehind:!0},property:/\b(?:ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY|admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user)\b/,constant:/\$\{[!\w\.:\^-]+\}|\$\([!\w\.:\^-]+\)/,variable:/\$\w[\w\.]*/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|\+\+?|<=?|>=?|==?=?|&&?|\|\|?|[?*\/~^%]/,punctuation:/[{}[\];(),.:]/,important:{pattern:/(^[\t ]*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|if|ifdef|ifmacrodef|ifmacrondef|ifndef|include|insertmacro|macro|macroend|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|warning)\b/im,lookbehind:!0}}; \ No newline at end of file +Prism.languages.nsis={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,lookbehind:!0,greedy:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:{pattern:/(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|KnownFolderPath|LabelAddress|TempFileName|WinVer)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|RtlLanguage|ShellVarContextAll|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Target|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m,lookbehind:!0},property:/\b(?:ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY|admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user)\b/,constant:/\$\{[!\w\.:\^-]+\}|\$\([!\w\.:\^-]+\)/,variable:/\$\w[\w\.]*/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|\+\+?|<=?|>=?|==?=?|&&?|\|\|?|[?*\/~^%]/,punctuation:/[{}[\];(),.:]/,important:{pattern:/(^[\t ]*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|if|ifdef|ifmacrodef|ifmacrondef|ifndef|include|insertmacro|macro|macroend|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|warning)\b/im,lookbehind:!0}}; \ No newline at end of file diff --git a/components/prism-odin.js b/components/prism-odin.js new file mode 100644 index 0000000000..39e8d920be --- /dev/null +++ b/components/prism-odin.js @@ -0,0 +1,99 @@ +(function (Prism) { + var escapes = /\\(?:["'\\abefnrtv]|0[0-7]{2}|U[\dA-Fa-f]{6}|u[\dA-Fa-f]{4}|x[\dA-Fa-f]{2})/; + + Prism.languages.odin = { + /** + * The current implementation supports only 1 level of nesting. + * + * @author Michael Schmidt + * @author edukisto + */ + 'comment': [ + { + pattern: /\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:\*(?!\/)|[^*])*(?:\*\/|$))*(?:\*\/|$)/, + greedy: true + }, + { + pattern: /#![^\n\r]*/, + greedy: true + }, + { + pattern: /\/\/[^\n\r]*/, + greedy: true + } + ], + + /** + * Should be found before strings because of '"'"- and '`'`-like sequences. + */ + 'char': { + pattern: /'(?:\\(?:.|[0Uux][0-9A-Fa-f]{1,6})|[^\n\r'\\])'/, + greedy: true, + inside: { + 'symbol': escapes + } + }, + + 'string': [ + { + pattern: /`[^`]*`/, + greedy: true + }, + { + pattern: /"(?:\\.|[^\n\r"\\])*"/, + greedy: true, + inside: { + 'symbol': escapes + } + } + ], + + 'directive': { + pattern: /#\w+/, + alias: 'property' + }, + + 'number': /\b0(?:b[01_]+|d[\d_]+|h_*(?:(?:(?:[\dA-Fa-f]_*){8}){1,2}|(?:[\dA-Fa-f]_*){4})|o[0-7_]+|x[\dA-F_a-f]+|z[\dAB_ab]+)\b|(?:\b\d+(?:\.(?!\.)\d*)?|\B\.\d+)(?:[Ee][+-]?\d*)?[ijk]?(?!\w)/, + + 'discard': { + pattern: /\b_\b/, + alias: 'keyword' + }, + + 'procedure-definition': { + pattern: /\b\w+(?=[ \t]*(?::\s*){2}proc\b)/, + alias: 'function' + }, + + 'keyword': /\b(?:asm|auto_cast|bit_set|break|case|cast|context|continue|defer|distinct|do|dynamic|else|enum|fallthrough|for|foreign|if|import|in|map|matrix|not_in|or_else|or_return|package|proc|return|struct|switch|transmute|typeid|union|using|when|where)\b/, + + /** + * false, nil, true can be used as procedure names. "_" and keywords can't. + */ + 'procedure-name': { + pattern: /\b\w+(?=[ \t]*\()/, + alias: 'function' + }, + + 'boolean': /\b(?:false|nil|true)\b/, + + 'constant-parameter-sign': { + pattern: /\$/, + alias: 'important' + }, + + 'undefined': { + pattern: /---/, + alias: 'operator' + }, + + 'arrow': { + pattern: /->/, + alias: 'punctuation' + }, + + 'operator': /\+\+|--|\.\.[<=]?|(?:&~|[-!*+/=~]|[%&<>|]{1,2})=?|[?^]/, + + 'punctuation': /[(),.:;@\[\]{}]/ + }; +}(Prism)); diff --git a/components/prism-odin.min.js b/components/prism-odin.min.js new file mode 100644 index 0000000000..5abcdf70c8 --- /dev/null +++ b/components/prism-odin.min.js @@ -0,0 +1 @@ +!function(e){var t=/\\(?:["'\\abefnrtv]|0[0-7]{2}|U[\dA-Fa-f]{6}|u[\dA-Fa-f]{4}|x[\dA-Fa-f]{2})/;e.languages.odin={comment:[{pattern:/\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:\*(?!\/)|[^*])*(?:\*\/|$))*(?:\*\/|$)/,greedy:!0},{pattern:/#![^\n\r]*/,greedy:!0},{pattern:/\/\/[^\n\r]*/,greedy:!0}],char:{pattern:/'(?:\\(?:.|[0Uux][0-9A-Fa-f]{1,6})|[^\n\r'\\])'/,greedy:!0,inside:{symbol:t}},string:[{pattern:/`[^`]*`/,greedy:!0},{pattern:/"(?:\\.|[^\n\r"\\])*"/,greedy:!0,inside:{symbol:t}}],directive:{pattern:/#\w+/,alias:"property"},number:/\b0(?:b[01_]+|d[\d_]+|h_*(?:(?:(?:[\dA-Fa-f]_*){8}){1,2}|(?:[\dA-Fa-f]_*){4})|o[0-7_]+|x[\dA-F_a-f]+|z[\dAB_ab]+)\b|(?:\b\d+(?:\.(?!\.)\d*)?|\B\.\d+)(?:[Ee][+-]?\d*)?[ijk]?(?!\w)/,discard:{pattern:/\b_\b/,alias:"keyword"},"procedure-definition":{pattern:/\b\w+(?=[ \t]*(?::\s*){2}proc\b)/,alias:"function"},keyword:/\b(?:asm|auto_cast|bit_set|break|case|cast|context|continue|defer|distinct|do|dynamic|else|enum|fallthrough|for|foreign|if|import|in|map|matrix|not_in|or_else|or_return|package|proc|return|struct|switch|transmute|typeid|union|using|when|where)\b/,"procedure-name":{pattern:/\b\w+(?=[ \t]*\()/,alias:"function"},boolean:/\b(?:false|nil|true)\b/,"constant-parameter-sign":{pattern:/\$/,alias:"important"},undefined:{pattern:/---/,alias:"operator"},arrow:{pattern:/->/,alias:"punctuation"},operator:/\+\+|--|\.\.[<=]?|(?:&~|[-!*+/=~]|[%&<>|]{1,2})=?|[?^]/,punctuation:/[(),.:;@\[\]{}]/}}(Prism); \ No newline at end of file diff --git a/components/prism-rescript.js b/components/prism-rescript.js new file mode 100644 index 0000000000..9502a77d64 --- /dev/null +++ b/components/prism-rescript.js @@ -0,0 +1,60 @@ +Prism.languages.rescript = { + 'comment': { + pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: true + }, + 'char': { pattern: /'(?:[^\r\n\\]|\\(?:.|\w+))'/, greedy: true }, + 'string': { + pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, + greedy: true + }, + 'class-name': /\b[A-Z]\w*|@[a-z.]*|#[A-Za-z]\w*|#\d/, + 'function': { + pattern: /[a-zA-Z]\w*(?=\()|(\.)[a-z]\w*/, + lookbehind: true, + }, + 'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, + 'boolean': /\b(?:false|true)\b/, + 'attr-value': /[A-Za-z]\w*(?==)/, + 'constant': { + pattern: /(\btype\s+)[a-z]\w*/, + lookbehind: true + }, + 'tag': { + pattern: /(<)[a-z]\w*|(?:<\/)[a-z]\w*/, + lookbehind: true, + inside: { + 'operator': /<|>|\//, + }, + }, + 'keyword': /\b(?:and|as|assert|begin|bool|class|constraint|do|done|downto|else|end|exception|external|float|for|fun|function|if|in|include|inherit|initializer|int|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|string|switch|then|to|try|type|when|while|with)\b/, + 'operator': /\.{3}|:[:=]?|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/, + 'punctuation': /[(){}[\],;.]/ +}; + +Prism.languages.insertBefore('rescript', 'string', { + 'template-string': { + pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, + greedy: true, + inside: { + 'template-punctuation': { + pattern: /^`|`$/, + alias: 'string' + }, + 'interpolation': { + pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'tag' + }, + rest: Prism.languages.rescript + } + }, + 'string': /[\s\S]+/ + } + }, +}); + +Prism.languages.res = Prism.languages.rescript; diff --git a/components/prism-rescript.min.js b/components/prism-rescript.min.js new file mode 100644 index 0000000000..5d00666f43 --- /dev/null +++ b/components/prism-rescript.min.js @@ -0,0 +1 @@ +Prism.languages.rescript={comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},char:{pattern:/'(?:[^\r\n\\]|\\(?:.|\w+))'/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*|@[a-z.]*|#[A-Za-z]\w*|#\d/,function:{pattern:/[a-zA-Z]\w*(?=\()|(\.)[a-z]\w*/,lookbehind:!0},number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,boolean:/\b(?:false|true)\b/,"attr-value":/[A-Za-z]\w*(?==)/,constant:{pattern:/(\btype\s+)[a-z]\w*/,lookbehind:!0},tag:{pattern:/(<)[a-z]\w*|(?:<\/)[a-z]\w*/,lookbehind:!0,inside:{operator:/<|>|\//}},keyword:/\b(?:and|as|assert|begin|bool|class|constraint|do|done|downto|else|end|exception|external|float|for|fun|function|if|in|include|inherit|initializer|int|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|string|switch|then|to|try|type|when|while|with)\b/,operator:/\.{3}|:[:=]?|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/,punctuation:/[(){}[\],;.]/},Prism.languages.insertBefore("rescript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"tag"},rest:Prism.languages.rescript}},string:/[\s\S]+/}}}),Prism.languages.res=Prism.languages.rescript; \ No newline at end of file diff --git a/components/prism-scala.js b/components/prism-scala.js index 40b96fa15c..b12f2e6bbf 100644 --- a/components/prism-scala.js +++ b/components/prism-scala.js @@ -8,7 +8,7 @@ Prism.languages.scala = Prism.languages.extend('java', { pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: true }, - 'keyword': /<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/, + 'keyword': /<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/, 'number': /\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i, 'builtin': /\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/, 'symbol': /'[^\d\s\\]\w*/ @@ -47,3 +47,4 @@ Prism.languages.insertBefore('scala', 'triple-quoted-string', { delete Prism.languages.scala['class-name']; delete Prism.languages.scala['function']; +delete Prism.languages.scala['constant']; diff --git a/components/prism-scala.min.js b/components/prism-scala.min.js index 1f3db0b8bd..560000f43a 100644 --- a/components/prism-scala.min.js +++ b/components/prism-scala.min.js @@ -1 +1 @@ -Prism.languages.scala=Prism.languages.extend("java",{"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,number:/\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,builtin:/\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,symbol:/'[^\d\s\\]\w*/}),Prism.languages.insertBefore("scala","triple-quoted-string",{"string-interpolation":{pattern:/\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i,greedy:!0,inside:{id:{pattern:/^\w+/,greedy:!0,alias:"function"},escape:{pattern:/\\\$"|\$[$"]/,greedy:!0,alias:"symbol"},interpolation:{pattern:/\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,greedy:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:Prism.languages.scala}}},string:/[\s\S]+/}}}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala.function; \ No newline at end of file +Prism.languages.scala=Prism.languages.extend("java",{"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/,number:/\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,builtin:/\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,symbol:/'[^\d\s\\]\w*/}),Prism.languages.insertBefore("scala","triple-quoted-string",{"string-interpolation":{pattern:/\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i,greedy:!0,inside:{id:{pattern:/^\w+/,greedy:!0,alias:"function"},escape:{pattern:/\\\$"|\$[$"]/,greedy:!0,alias:"symbol"},interpolation:{pattern:/\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,greedy:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:Prism.languages.scala}}},string:/[\s\S]+/}}}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala.function,delete Prism.languages.scala.constant; \ No newline at end of file diff --git a/components/prism-wgsl.js b/components/prism-wgsl.js new file mode 100644 index 0000000000..68a5e0c371 --- /dev/null +++ b/components/prism-wgsl.js @@ -0,0 +1,69 @@ +Prism.languages.wgsl = { + 'comment': { + pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: true, + }, + 'builtin-attribute': { + pattern: /(@)builtin\(.*?\)/, + lookbehind: true, + inside: { + 'attribute': { + pattern: /^builtin/, + alias: 'attr-name', + }, + 'punctuation': /[(),]/, + 'built-in-values': { + pattern: /\b(?:frag_depth|front_facing|global_invocation_id|instance_index|local_invocation_id|local_invocation_index|num_workgroups|position|sample_index|sample_mask|vertex_index|workgroup_id)\b/, + alias: 'attr-value', + }, + }, + }, + 'attributes': { + pattern: /(@)(?:align|binding|compute|const|fragment|group|id|interpolate|invariant|location|size|vertex|workgroup_size)/i, + lookbehind: true, + alias: 'attr-name', + }, + 'functions': { + pattern: /\b(fn\s+)[_a-zA-Z]\w*(?=[(<])/, + lookbehind: true, + alias: 'function', + }, + 'keyword': /\b(?:bitcast|break|case|const|continue|continuing|default|discard|else|enable|fallthrough|fn|for|function|if|let|loop|private|return|storage|struct|switch|type|uniform|var|while|workgroup)\b/, + 'builtin': /\b(?:abs|acos|acosh|all|any|array|asin|asinh|atan|atan2|atanh|atomic|atomicAdd|atomicAnd|atomicCompareExchangeWeak|atomicExchange|atomicLoad|atomicMax|atomicMin|atomicOr|atomicStore|atomicSub|atomicXor|bool|ceil|clamp|cos|cosh|countLeadingZeros|countOneBits|countTrailingZeros|cross|degrees|determinant|distance|dot|dpdx|dpdxCoarse|dpdxFine|dpdy|dpdyCoarse|dpdyFine|exp|exp2|extractBits|f32|f64|faceForward|firstLeadingBit|floor|fma|fract|frexp|fwidth|fwidthCoarse|fwidthFine|i32|i64|insertBits|inverseSqrt|ldexp|length|log|log2|mat[2-4]x[2-4]|max|min|mix|modf|normalize|override|pack2x16float|pack2x16snorm|pack2x16unorm|pack4x8snorm|pack4x8unorm|pow|ptr|quantizeToF16|radians|reflect|refract|reverseBits|round|sampler|sampler_comparison|select|shiftLeft|shiftRight|sign|sin|sinh|smoothstep|sqrt|staticAssert|step|storageBarrier|tan|tanh|textureDimensions|textureGather|textureGatherCompare|textureLoad|textureNumLayers|textureNumLevels|textureNumSamples|textureSample|textureSampleBias|textureSampleCompare|textureSampleCompareLevel|textureSampleGrad|textureSampleLevel|textureStore|texture_1d|texture_2d|texture_2d_array|texture_3d|texture_cube|texture_cube_array|texture_depth_2d|texture_depth_2d_array|texture_depth_cube|texture_depth_cube_array|texture_depth_multisampled_2d|texture_multisampled_2d|texture_storage_1d|texture_storage_2d|texture_storage_2d_array|texture_storage_3d|transpose|trunc|u32|u64|unpack2x16float|unpack2x16snorm|unpack2x16unorm|unpack4x8snorm|unpack4x8unorm|vec[2-4]|workgroupBarrier)\b/, + 'function-calls': { + pattern: /\b[_a-z]\w*(?=\()/i, + alias: 'function', + }, + 'class-name': /\b(?:[A-Z][A-Za-z0-9]*)\b/, + 'bool-literal': { + pattern: /\b(?:false|true)\b/, + alias: 'boolean', + }, + 'hex-int-literal': { + pattern: /\b0[xX][0-9a-fA-F]+[iu]?\b(?![.pP])/, + alias: 'number', + }, + 'hex-float-literal': { + pattern: /\b0[xX][0-9a-fA-F]*(?:\.[0-9a-fA-F]*)?(?:[pP][+-]?\d+[fh]?)?/, alias: 'number' + }, + 'decimal-float-literal': [ + { pattern: /\d*\.\d+(?:[eE](?:\+|-)?\d+)?[fh]?/, alias: 'number' }, + { pattern: /\d+\.\d*(?:[eE](?:\+|-)?\d+)?[fh]?/, alias: 'number' }, + { pattern: /\d+[eE](?:\+|-)?\d+[fh]?/, alias: 'number' }, + { pattern: /\b\d+[fh]\b/, alias: 'number' }, + ], + 'int-literal': { + pattern: /\b\d+[iu]?\b/, + alias: 'number', + }, + 'operator': [ + { pattern: /(?:\^|~|\|(?!\|)|\|\||&&|<<|>>|!)(?!=)/ }, + { pattern: /&(?![&=])/ }, + { pattern: /(?:\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/ }, + { pattern: /(^|[^<>=!])=(?![=>])/, lookbehind: true }, + { pattern: /(?:==|!=|<=|\+\+|--|(^|[^=])>=)/, lookbehind: true }, + { pattern: /(?:(?:[+%]|(?:\*(?!\w)))(?!=))|(?:-(?!>))|(?:\/(?!\/))/ }, + { pattern: /->/ }, + ], + 'punctuation': /[@(){}[\],;<>:.]/, +}; diff --git a/components/prism-wgsl.min.js b/components/prism-wgsl.min.js new file mode 100644 index 0000000000..d3b7f3cdc5 --- /dev/null +++ b/components/prism-wgsl.min.js @@ -0,0 +1 @@ +Prism.languages.wgsl={comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"builtin-attribute":{pattern:/(@)builtin\(.*?\)/,lookbehind:!0,inside:{attribute:{pattern:/^builtin/,alias:"attr-name"},punctuation:/[(),]/,"built-in-values":{pattern:/\b(?:frag_depth|front_facing|global_invocation_id|instance_index|local_invocation_id|local_invocation_index|num_workgroups|position|sample_index|sample_mask|vertex_index|workgroup_id)\b/,alias:"attr-value"}}},attributes:{pattern:/(@)(?:align|binding|compute|const|fragment|group|id|interpolate|invariant|location|size|vertex|workgroup_size)/i,lookbehind:!0,alias:"attr-name"},functions:{pattern:/\b(fn\s+)[_a-zA-Z]\w*(?=[(<])/,lookbehind:!0,alias:"function"},keyword:/\b(?:bitcast|break|case|const|continue|continuing|default|discard|else|enable|fallthrough|fn|for|function|if|let|loop|private|return|storage|struct|switch|type|uniform|var|while|workgroup)\b/,builtin:/\b(?:abs|acos|acosh|all|any|array|asin|asinh|atan|atan2|atanh|atomic|atomicAdd|atomicAnd|atomicCompareExchangeWeak|atomicExchange|atomicLoad|atomicMax|atomicMin|atomicOr|atomicStore|atomicSub|atomicXor|bool|ceil|clamp|cos|cosh|countLeadingZeros|countOneBits|countTrailingZeros|cross|degrees|determinant|distance|dot|dpdx|dpdxCoarse|dpdxFine|dpdy|dpdyCoarse|dpdyFine|exp|exp2|extractBits|f32|f64|faceForward|firstLeadingBit|floor|fma|fract|frexp|fwidth|fwidthCoarse|fwidthFine|i32|i64|insertBits|inverseSqrt|ldexp|length|log|log2|mat[2-4]x[2-4]|max|min|mix|modf|normalize|override|pack2x16float|pack2x16snorm|pack2x16unorm|pack4x8snorm|pack4x8unorm|pow|ptr|quantizeToF16|radians|reflect|refract|reverseBits|round|sampler|sampler_comparison|select|shiftLeft|shiftRight|sign|sin|sinh|smoothstep|sqrt|staticAssert|step|storageBarrier|tan|tanh|textureDimensions|textureGather|textureGatherCompare|textureLoad|textureNumLayers|textureNumLevels|textureNumSamples|textureSample|textureSampleBias|textureSampleCompare|textureSampleCompareLevel|textureSampleGrad|textureSampleLevel|textureStore|texture_1d|texture_2d|texture_2d_array|texture_3d|texture_cube|texture_cube_array|texture_depth_2d|texture_depth_2d_array|texture_depth_cube|texture_depth_cube_array|texture_depth_multisampled_2d|texture_multisampled_2d|texture_storage_1d|texture_storage_2d|texture_storage_2d_array|texture_storage_3d|transpose|trunc|u32|u64|unpack2x16float|unpack2x16snorm|unpack2x16unorm|unpack4x8snorm|unpack4x8unorm|vec[2-4]|workgroupBarrier)\b/,"function-calls":{pattern:/\b[_a-z]\w*(?=\()/i,alias:"function"},"class-name":/\b(?:[A-Z][A-Za-z0-9]*)\b/,"bool-literal":{pattern:/\b(?:false|true)\b/,alias:"boolean"},"hex-int-literal":{pattern:/\b0[xX][0-9a-fA-F]+[iu]?\b(?![.pP])/,alias:"number"},"hex-float-literal":{pattern:/\b0[xX][0-9a-fA-F]*(?:\.[0-9a-fA-F]*)?(?:[pP][+-]?\d+[fh]?)?/,alias:"number"},"decimal-float-literal":[{pattern:/\d*\.\d+(?:[eE](?:\+|-)?\d+)?[fh]?/,alias:"number"},{pattern:/\d+\.\d*(?:[eE](?:\+|-)?\d+)?[fh]?/,alias:"number"},{pattern:/\d+[eE](?:\+|-)?\d+[fh]?/,alias:"number"},{pattern:/\b\d+[fh]\b/,alias:"number"}],"int-literal":{pattern:/\b\d+[iu]?\b/,alias:"number"},operator:[{pattern:/(?:\^|~|\|(?!\|)|\|\||&&|<<|>>|!)(?!=)/},{pattern:/&(?![&=])/},{pattern:/(?:\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/},{pattern:/(^|[^<>=!])=(?![=>])/,lookbehind:!0},{pattern:/(?:==|!=|<=|\+\+|--|(^|[^=])>=)/,lookbehind:!0},{pattern:/(?:(?:[+%]|(?:\*(?!\w)))(?!=))|(?:-(?!>))|(?:\/(?!\/))/},{pattern:/->/}],punctuation:/[@(){}[\],;<>:.]/}; \ No newline at end of file diff --git a/examples/prism-bbj.html b/examples/prism-bbj.html new file mode 100644 index 0000000000..a04366bb26 --- /dev/null +++ b/examples/prism-bbj.html @@ -0,0 +1,63 @@ +

Routines example

+

+use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget
+use com.basiscomponents.db.ResultSet
+use com.basiscomponents.bc.SqlQueryBC
+
+declare auto BBjTopLevelWindow wnd!
+wnd! = BBjAPI().openSysGui("X0").addWindow(10, 10, 800, 600, "My First Grid")
+wnd!.setCallback(BBjAPI.ON_CLOSE,"byebye")
+
+gosub main
+process_events
+
+rem Retrieve the data from the database and configure the grid
+main:
+	declare SqlQueryBC sbc!
+	declare ResultSet rs!
+	declare BBjGridExWidget grid!
+
+	sbc! = new SqlQueryBC(BBjAPI().getJDBCConnection("CDStore"))
+	rs! = sbc!.retrieve("SELECT * FROM CDINVENTORY")
+
+	grid! = new BBjGridExWidget(wnd!, 100, 0, 0, 800, 600)
+	grid!.setData(rs!)
+return
+
+byebye:
+bye
+
+ +

OOP example

+

+use java.util.Arrays
+use java.util.ArrayList
+use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget
+
+rem /**
+rem  * This file is part of the MyPackage.
+rem  *
+rem  * For the full copyright and license information, please view the LICENSE
+rem  * file that was distributed with this source code.
+rem  */
+rem /**
+
+class public Employee
+  field public BBjNumber ID
+  field public BBjString Name$
+classend
+
+class public Salaried extends Employee implements Payable
+  field public BBjNumber MonthlySalary
+  method public BBjNumber pay()
+    methodret #MonthlySalary
+  methodend
+  method public void print()
+    print "Employee",#getID(),": ",#getName()
+    print #pay():"($###,###.00)"
+  methodend
+  method public BBjNumber account()
+    methodret 11111
+  methodend
+classend
+
diff --git a/examples/prism-django.html b/examples/prism-django.html index ac9cf0df73..3a8829af49 100644 --- a/examples/prism-django.html +++ b/examples/prism-django.html @@ -11,7 +11,7 @@

Template Tag

Full Example

-
{# This a Django template example #}
+
{# This is a Django template example #}
 {% extends "base_generic.html" %}
 
 {% block title %}{{ section.title }}{% endblock %}
diff --git a/examples/prism-gradle.html b/examples/prism-gradle.html
new file mode 100644
index 0000000000..ce3b010766
--- /dev/null
+++ b/examples/prism-gradle.html
@@ -0,0 +1,54 @@
+

Full example

+
apply plugin: "java"
+apply plugin: "eclipse"
+apply plugin: "idea"
+
+group = "com.mycompany.hadoopproject"
+version = "1.0"
+
+repositories {
+    // Standard Maven 
+    mavenCentral()
+    maven {
+        url "https://repository.cloudera.com/artifactory/cloudera-repos/"
+    }
+}
+
+// Mimic Maven 'provided' configuration, as suggested in GRADLE-784
+configurations {
+    provided
+}
+sourceSets {
+    main {
+        compileClasspath += configurations.provided
+    }
+}
+
+ext.hadoopVersion = "2.0.0-mr1-cdh4.0.1"
+dependencies {
+    provided "org.apache.hadoop:hadoop-client:${hadoopVersion}"
+
+    // Example of adding a specific compile time dependency
+    compile "com.google.guava:guava:11.0.2"
+
+    testCompile "junit:junit:4.8.2"
+}
+
+// Java version selection
+sourceCompatibility = 1.6
+targetCompatibility = 1.6
+
+eclipse {
+    classpath {
+        // Ensure Eclipse build output appears in build directory
+        defaultOutputDir = file("${buildDir}/eclipse-classes")
+        // Ensure the provided configuration jars are available in Eclipse
+        plusConfigurations += configurations.provided
+    }
+}
+
+// Emulate Maven shade plugin with a fat jar.
+// http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-Creatingafatjar
+jar {
+    from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
+}
diff --git a/examples/prism-metafont.html b/examples/prism-metafont.html new file mode 100644 index 0000000000..9a6a5b0c07 --- /dev/null +++ b/examples/prism-metafont.html @@ -0,0 +1,21 @@ +

Comments and strings

+
%This makes a comment.
+"While this is a string."
+ +

Numbers

+
0 1.2 .3
+ +

Operators

+
eps*256>=1<>true
+""&ditto
+z1..z2--z3
+5+-+4=3
+ +

Types

+
path p[],q[]
+ +

Concrete example

+
% From plain.mf
+vardef penpos@#(expr b,d) =
+(x@#r-x@#l,y@#r-y@#l)=(b,0) rotated d;
+x@#=.5(x@#l+x@#r); y@#=.5(y@#l+y@#r) enddef;
\ No newline at end of file diff --git a/examples/prism-odin.html b/examples/prism-odin.html new file mode 100644 index 0000000000..03290e8da8 --- /dev/null +++ b/examples/prism-odin.html @@ -0,0 +1,12 @@ +

Example

+ +
package main
+
+import "core:fmt"
+
+main :: proc() {
+  i: int
+  for i := 0; i < 100; i += 1 {
+    fmt.println(i, " bottles of beer on the wall.\n")
+  }
+}
diff --git a/examples/prism-rescript.html b/examples/prism-rescript.html new file mode 100644 index 0000000000..e36f10a769 --- /dev/null +++ b/examples/prism-rescript.html @@ -0,0 +1,52 @@ +

Comments

+
/* This is a comment */
+// Another comment
+
+ +

Let bindings

+
let name = "Alonzo Church"
+let message = `Hello ${name}`
+let message2 = `Hello ${person.name}`
+let result = `Testing => ${Module.Another.value}`
+let value = 1
+let result = 1 + 1
+let langs = ["ReScript", "JavaScript"]
+let person = ("Alonzo", 32)
+ +

Type declarations & Functions

+
type role = | Admin | Editor | Viewer 
+type numeric = #1 | #2 | #3
+type normal = #Poly | #Variant
+type myPolyVar = [ #"poly-variant" | #"test-chars" ]
+
+type person = {
+ name: string,
+ age: int,
+ role: role
+}
+
+type record = {
+  "field": string
+}
+
+let sum = (a, b) => a + b
+let sum2 = (a:int, b: int) => a + b
+ +

Modules, JSX & Components

+
%%raw(``)
+module Button = {
+  @react.component
+  let make = (~count: int) =>{
+    let times = switch count {
+    | 1 => "once"
+    | 2 => "twice"
+    | n => Belt.Int.toString(n) ++ " times"
+    }
+    let msg = "Click me " ++ times
+
+	<button onClick={Js.log}>{msg->React.string}</button>;
+  }
+}
+
+@react.component
+let make = () => <MyModule.Button count=1 />
diff --git a/examples/prism-wgsl.html b/examples/prism-wgsl.html new file mode 100644 index 0000000000..16626c0e8c --- /dev/null +++ b/examples/prism-wgsl.html @@ -0,0 +1,60 @@ +

Full example

+
// Vertex shader
+struct CameraUniform {
+    view_proj: mat4x4<f32>;
+};
+[[group(1), binding(0)]]
+var<uniform> camera: CameraUniform;
+
+struct InstanceInput {
+    [[location(5)]] model_matrix_0: vec4<f32>;
+    [[location(6)]] model_matrix_1: vec4<f32>;
+    [[location(7)]] model_matrix_2: vec4<f32>;
+    [[location(8)]] model_matrix_3: vec4<f32>;
+};
+
+struct VertexInput {
+    [[location(0)]] position: vec3<f32>; 
+    [[location(1)]] tex_coords: vec2<f32>;
+};
+
+struct VertexOutput {
+    [[builtin(position)]] clip_position: vec4<f32>;
+    [[location(0)]] tex_coords: vec2<f32>;
+};
+
+@vertex
+[[stage(vertex)]]
+fn vs_main(
+    model: VertexInput,
+    instance: InstanceInput,
+) -> VertexOutput {
+    let model_matrix = mat4x4<f32>(
+        instance.model_matrix_0,
+        instance.model_matrix_1,
+        instance.model_matrix_2,
+        instance.model_matrix_3,
+    );
+
+    bool mybool1 = true;
+    bool mybool2 = false;
+
+    var out: VertexOutput;
+    out.tex_coords = model.tex_coords;
+    out.clip_position = camera.view_proj * model_matrix * vec4<f32>(model.position, 1.0);
+    return out;
+}
+
+// Fragment shader
+
+[[group(0), binding(0)]]
+var t_diffuse: texture_2d<f32>;
+[[group(0), binding(1)]]
+var s_diffuse: sampler;
+
+@fragment
+[[stage(fragment)]]
+fn fs_main(in: VertexOutput) -> [[location(0)]] vec4<f32> {
+    return textureSample(t_diffuse, s_diffuse, in.tex_coords);
+}
+
\ No newline at end of file diff --git a/extending.html b/extending.html index 606c2816fb..2015bb87c9 100644 --- a/extending.html +++ b/extending.html @@ -31,71 +31,328 @@

Extending Prism

Language definitions

-

Every language is defined as a set of tokens, which are expressed as regular expressions. For example, this is the language definition for CSS:

-

+	

Every language is defined as a set of tokens, which are expressed as regular expressions. For example, this is the language definition for JSON:

+

 
-	

A regular expression literal is the simplest way to express a token. An alternative way, with more options, is by using an object literal. With that notation, the regular expression describing the token would be the pattern attribute:

-
...
-'tokenname': {
-	pattern: /regex/
-}
-...
-

So far the functionality is exactly the same between the short and extended notations. However, the extended notation allows for additional options:

+

At its core, a language definition is just a JavaScript object, and a token is just an entry of the language definition. The simplest language definition is an empty object:

+
Prism.languages['some-language'] = { };
+ +

Unfortunately, an empty language definition isn't very useful, so let's add a token. The simplest way to express a token is using a regular expression literal:

+
Prism.languages['some-language'] = {
+	'token-name': /regex/,
+};
+ +

Alternatively, an object literal can also be used. With this notation, the regular expression describing the token is the pattern property of the object:

+
Prism.languages['some-language'] = {
+	'token-name': {
+		pattern: /regex/
+	},
+};
+ +

So far, the functionality is exactly the same between the regex and object notations. However, the object notation allows for additional options. More on that later.

+ +

The name of a token can theoretically be any string that is also a valid CSS class, but there are some guidelines to follow. More on that later.

+ +

Language definitions can have any number of tokens, but the name of each token must be unique:

+
Prism.languages['some-language'] = {
+	'token-1': /I love regexes!/,
+	'token-2': /regex/,
+};
+ +

Prism will match tokens against the input text one after the other, in order, and tokens cannot overlap with the matches of previous tokens. So in the above example, token-2 will not match the substring "regex" inside of matches of token-1. More information about Prism's matching algorithm later.

+ +

Lastly, in many languages, there are multiple different ways of declaring the same constructs (e.g. comments, strings, ...) and sometimes it is difficult or unpractical to match all of them with one single regular expression. To add multiple regular expressions for one token name, an array can be used:

+
Prism.languages['some-language'] = {
+	'token-name': [
+		/regex 1/,
+		/regex 2/,
+		{ pattern: /regex 3/ }
+	],
+};
+ +

Note: An array cannot be used in the pattern property.

+ + +

Object notation

+ +

Instead of using just plain regular expressions, Prism also supports an object notation for tokens. This notation enables the following options:

-
inside
-
This property accepts another object literal, with tokens that are allowed to be nested in this token. - This makes it easier to define certain languages. However, keep in mind that they’re slower and if coded poorly, can even result in infinite recursion. - For an example of nested tokens, check out the Markup language definition: -
- -
lookbehind
-
This option mitigates JavaScript’s lack of lookbehind. When set to true, - the first capturing group in the regex pattern is discarded when matching this token, so it effectively behaves - as if it was lookbehind. For an example of this, check out the C-like language definition, in particular the comment and class-name tokens: -
- -
rest
-
Accepts an object literal with tokens and appends them to the end of the current object literal. Useful for referring to tokens defined elsewhere. For an example where rest is useful, check the Markup definitions above.
- -
alias
-
This option can be used to define one or more aliases for the matched token. The result will be, that - the styles of the token and its aliases are combined. This can be useful, to combine the styling of a standard - token, which is already supported by most of the themes, with a semantically correct token name. The option - can be set to a string literal or an array of string literals. In the following example the token - name latex-equation is not supported by any theme, but it will be highlighted the same as a string. -
{
+		
pattern: RegExp
+
+

This is the only required option. It holds the regular expression of the token.

+
+ +
lookbehind: boolean
+
+

This option mitigates JavaScript's poor browser support for lookbehinds. When set to true, the first capturing group in the pattern regex is discarded when matching this token, so it effectively functions as a lookbehind.

+ +

For an example of this, check out how the C-like language definition finds class-name tokens:

+
Prism.languages.clike = {
+	// ...
+	'class-name': {
+		pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+)\w+/i,
+		lookbehind: true
+	}
+};
+
+ +
greedy: boolean
+
+

This option enables greedy matching for the token. For more information, see the section about the matching algorithm.

+
+ +
alias: string | string[]
+
+

This option can be used to define one or more aliases for the token. The result will be that the styles of the token name and the alias(es) are combined. This can be useful to combine the styling of a standard token, which is already supported by most of the themes, with a more precise token name. For more information on this topic, see granular highlighting.

+ +

E.g. the token name latex-equation is not supported by most themes, but it will be highlighted the same as a string in the following example:

+
Prism.languages.latex = {
+	// ...
 	'latex-equation': {
-		pattern: /\$(\\?.)*?\$/g,
+		pattern: /\$.*?\$/,
 		alias: 'string'
 	}
-}
- -
greedy
-
This is a boolean attribute. It is intended to solve a common problem with - patterns that match long strings like comments, regex or string literals. For example, - comments are parsed first, but if the string /* foo */ - appears inside a string, you would not want it to be highlighted as a comment. - The greedy-property allows a pattern to ignore previous matches of other patterns, and - overwrite them when necessary. Use this flag with restraint, as it incurs a small performance overhead. - The following example demonstrates its usage: -
'string': {
-	pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
-	greedy: true
-}
+};
+
+ +
inside: Grammar
+
+

This option accepts another object literal, with tokens that are allowed to be nested in this token. All tokens in the inside grammar will be encapsulated by this token. This makes it easier to define certain languages.

+ +

For an example of nested tokens, check out the url token in the CSS language definition:

+
Prism.languages.css = {
+	// ...
+	'url': {
+		// e.g. url(https://example.com)
+		pattern: /\burl\(.*?\)/i,
+		inside: {
+			'function': /^url/i,
+			'punctuation': /^\(|\)$/
+		}
+	}
+};
+ +

The inside option can also be used to create recursive languages. This is useful for languages where one token can contain arbitrary expressions, e.g. languages with a string interpolation syntax.

+ +

For example, here is how JavaScript implements template string interpolation:

+
Prism.languages.javascript = {
+	// ...
+	'template-string': {
+		pattern: /`(?:\\.|\$\{[^{}]*\}|(?!\$\{)[^\\`])*`/,
+		inside: {
+			'interpolation': {
+				pattern: /\$\{[^{}]*\}/,
+				inside: {
+					'punctuation': /^\$\{|\}$/,
+					'expression': {
+						pattern: /[\s\S]+/,
+						inside: null // see below
+					}
+				}
+			}
+		}
+	}
+};
+Prism.languages.javascript['template-string'].inside['interpolation'].inside['expression'].inside = Prism.languages.javascript;
+ +

Be careful when creating recursive grammars as they might lead to infinite recursion which will cause a stack overflow.

+
-

Unless explicitly allowed through the inside property, each token cannot contain other tokens, so their order is significant. Although per the ECMAScript specification, objects are not required to have a specific ordering of their properties, in practice they do in every modern browser.

-

In most languages there are multiple different ways of declaring the same constructs (e.g. comments, strings, ...) and sometimes it is difficult or unpractical to match all of them with one single regular expression. To add multiple regular expressions for one token name an array can be used:

+

Token names

+ +

The name of a token determines the semantic meaning of matched text of the token. Tokens can capture anything from simple language constructs, like comments, to more complex ones, like template string interpolation expressions. Token names differentiate these language constructs.

+ +

A token name can theoretically be any string that is a valid CSS class name. However, in practice, it makes sense for token names to follow some rules. In Prism's code, we enforce that all token names use kebab case (foo-bar) and contain only lower-case ASCII letters, digits, and hyphen characters. E.g. class-name is allowed but Class_name is not.

+ +

Prism also defines some standard tokens names that should be used for most tokens.

+ +

Themes

+ +

Prism's themes assign color (and other styles) to tokens based on their name (and aliases). This means that the language definition does not control the color of tokens, themes do.

+ +

However, themes only support a limited number of known token names. If a theme does not know a particular token name, no styles will be applied. While different themes may support different token names, all themes are guaranteed to support Prism's standard tokens. Standard tokens as special token names with specific semantic meanings. They are the common ground all language definitions and themes agree on and must follow. Standard tokens should be preferred when choosing token names.

+ +

Granular highlighting

+ +

While standard tokens should be the preferred choice, they are also quite general. This is by design as they have to apply to a large number and variety of different languages, but sometimes more fine-grained tokenization (and subsequent highlighting) is desirable.

+ +

Granular highlighting is a method of choosing token names to enable fine control for themes, while also ensuring compatibility with all themes.

+ +

Let's look at an example. Say we had a language that supported both decimal and binary literals for numbers, and we wanted to give binary number special highlighting. We might implement it like this:

+
Prism.languages['my-language'] = {
+	// ...
+	'number': /\b\d+(?:\.\d+)?\b/,
+	'binary-number': /\b0b[01]+\b/,
+};
+ +

But this has a problem. binary-number is not a standard token, so almost no theme is going to given binary numbers any color.

+ +

The solution to this problem is to use an alias:

+
Prism.languages['my-language'] = {
+	// ...
+	'number': /\b\d+(?:\.\d+)?\b/,
+	'binary-number': {
+		pattern: /\b0b[01]+\b/,
+		alias: 'number'
+	},
+};
+ +

Aliases allow themes to apply the styles of multiple names to one token. This means that themes that do support the binary-number token name can assign a special color, and themes don't support it will fallback to their usual color for numbers.

+ +

This is granular highlighting: using a non-standard token name and a standard token as an alias.

+ + +

The matching algorithm

+ +

The job of Prism's matching algorithm is to produce a token stream given a language definition and some text. A token stream is Prism's representation of (partially or fully) tokenized text and is implemented as a list of strings (representing literal text) and tokens (representing tokenized text).

+ +

Note: The word "token" is ambiguous here. We use "token" to refer to both the entry of a language definition (as described in above sections) and a Token object inside a token stream. Which type of "token" is meant can be inferred from context.

+ +

The simplified token stream notation will be used in this section. Briefly, the notation uses JSON to represent a token stream. E.g. ["foo ", ["keyword", "bar"], " baz"] is the simplified token stream notation for the token stream that starts with the string foo , is followed by a token of type keyword and text bar, and ends with the string baz.

+ +

Back to the matching algorithm: Prism's matching algorithm is a hybrid with two modes: first-come, first-served (FCFS) matching and greedy matching.

+ +

FCFS matching

+ +

This is Prism default matching mode. All tokens are matched one after the other, in order, tokens cannot overlap, and tokens cannot match text that is already matched by previous tokens.

+ +

The algorithm itself is quite simple. Let's say we wanted to tokenize the JS code max(3, 5, exp2(7)); and that function tokens had already been processed. The current token stream would be:

+
[
+	["function", "max"],
+	"(3, 5, ",
+	["function", "exp2"],
+	"(7));"
+]
+ +

Next, we would tokenize numbers with the token 'number': /[0-9]+/.

+ +

FCFS matching will go through all strings in the current token stream to find matches for the number regex. The first string is "(3, 5, ", so the match 3 is found. A new token is created for 3 and inserted into the token stream to replace the matching text. The token stream is now:

+
[
+	["function", "max"],
+	"(",
+	["number", "3"],
+	", 5, ",
+	["function", "exp2"],
+	"(7));"
+]
+ +

Now, the algorithm goes to the next string ", 5, " and finds another match. A new token is created for 5 and the token stream is now:

+
[
+	["function", "max"],
+	"(",
+	["number", "3"],
+	", ",
+	["number", "5"],
+	", ",
+	["function", "exp2"],
+	"(7));"
+]
-
...
-'tokenname': [ /regex0/, /regex1/, { pattern: /regex2/ } ]
-...
+

The next string is ", " and no matches are found. The string after that is "(7));" and a new token is create for 7: +

[
+	["function", "max"],
+	"(",
+	["number", "3"],
+	", ",
+	["number", "5"],
+	", ",
+	["function", "exp2"],
+	"(",
+	["number", "7"],
+	"));"
+]
+ +

The last string to check is "));" and no matches are found. The number token has now been processed and the algorithm will go process the next token in the language definition.

+ +

Notice how FCFS matching did not find the 2 in exp2. Since FCFS matching completely ignores existing tokens in the token stream, the number regex cannot see already-tokenized text. This is a very useful property. In the above example, 2 is a part of the function name exp2, so highlighting it as a number would be incorrect.

+ +

Greedy matching

+ +

Greedy matching is very similar to FCFS matching. All tokens are matched in order and tokens cannot overlap. The defining difference is that greedy tokens can match the text of previous tokens.

+ +

Let's look at an example to see why greedy matching is useful and how it works conceptually. A very simplified version of JavaScript's comment and string syntax might be implemented like this:

+
Prism.languages.javascript = {
+	'comment': /\/\/.*/,
+	'string': /'(?:\\.|[^\\\r\n])*'/
+};
+ +

To understand why greedy matching is useful, let's look at how FCFS matching would tokenize the text 'http://example.com':

+ +

FCFS matching starts with the token stream ["'http://example.com'"] and tries to find matches for 'comment': /\/\/.*/. The match //example.com' is found and inserted into the token stream:

+
[
+	"'http:",
+	["comment", "//example.com'"]
+]
+ +

Then FCFS matching will search for matches for 'string': /'(?:\\.|[^'\\\r\n])*'/. The first string of the token stream, "'http:", does not match the string regex, so the token stream remains unchanged. The string token has now been processed and the above token stream is the final result.

+ +

Obviously, this is bad. The code 'http://example.com' is clearly just a string containing a URL, but FCFS matching doesn't understand this.

+ +

An obvious, but incorrect, fix might be to swap the order of comment and string. This would fix 'http://example.com'. However, the problem was merely moved. Comments like // it's my co-worker's code (note the two single quotes) will now be tokenized incorrectly.

+ +

This is the problem greedy matching solves. Let's make the tokens greedy and then see how this affects the result:

+
Prism.languages.javascript = {
+	'comment': {
+		pattern: /\/\/.*/,
+		greedy: true
+	},
+	'string': {
+		pattern: /'(?:\\.|[^'\\\r\n])*'/,
+		greedy: true
+	}
+};
+ +

While the actual greedy matching algorithm is quite complex and littered with subtle edge cases, its effect quite simple: a list of greedy tokens will behave as if they were matched by a single regex. This is how greedy matching works conceptually and how you should think about greedy tokens.

+ +

This means that the greedy comment and string tokens will behave like the following language definition, but the combined token will result in the correct token names of the original greedy tokens:

+
Prism.languages.javascript = {
+	'comment-or-string': /\/\/.*|'(?:\\.|[^'\\\r\n])*'/
+};
+ +

In the above example, 'http://example.com' will be matched by /\/\/.*|'(?:\\.|[^'\\\r\n])*'/ completely. Since the '(?:\\.|[^'\\\r\n])*' part of the regex caused the match, a token of type string will be created and the following token stream will be produced:

+
[
+	["string", "'http://example.com'"]
+]
+ +

Similarly, the tokenization will also be correct for the // it's my co-worker's code example.

+ +

When deciding whether a token should be greedy, use the following guide lines:

+ +
    +
  1. +

    Most tokens are not greedy.

    + +

    Most tokens in most languages are not greedy, because they don't need to be. Typically only the comment, string, and regex literal tokens need to be greedy. All other tokens can use FCFS matching.

    + +

    Generally, a token should only be greedy if it can contain the start of another token.

    +
  2. +
  3. +

    All tokens before a greedy token should also be greedy.

    + +

    Greedy matching works subtly differently if there are non-greedy tokens before a greedy token. This typically leads to subtle and hard-to-catch bugs that sometimes take years to uncover.

    + +

    To make sure that greedy matching works as expected, the greedy tokens should be the first tokens of a language.

    +
  4. +
  5. +

    Greedy tokens come in groups.

    + +

    If a language definition contains only a single greedy token, then the greedy token shouldn't be greedy. As explained above, greedy matching conceptually combines the regexes of all greedy tokens into one. If there is only one greedy token, greedy matching will behave like FCFS matching.

    +
  6. +

Helper functions

Prism also provides some useful function for creating and modifying language definitions. Prism.languages.insertBefore can be used to modify existing languages definitions. Prism.languages.extend is useful for when your language is very similar to another existing language.

+ + +

The rest property

+ +

The rest property in language definitions is special. Prism expects this property to be another language definition instead of a token. The tokens of the grammar in the rest property will be appended to the end of the language definition with the rest property. It can be thought of as a built-in object spread operator.

+ +

This is useful for referring to tokens defined elsewhere. However, the rest property should be used sparingly. When referencing another language, it is typically better to encapsulate the text of the language into a token and use the inside property instead.

@@ -120,7 +377,7 @@

Creating a new language definition

"owner": "Your GitHub name" }
-

If your language definition depends any other languages, you have to specify this here as well by adding a "require" property. E.g. "require": "clike", or "require" : ["markup", "css"]. For more information on dependencies read the declaring dependencies section.

+

If your language definition depends any other languages, you have to specify this here as well by adding a "require" property. E.g. "require": "clike", or "require": ["markup", "css"]. For more information on dependencies read the declaring dependencies section.

Note: Any changes made to components.json require a rebuild (see step 3).

diff --git a/package-lock.json b/package-lock.json index c08c1ad634..cb04025fb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prismjs", - "version": "1.27.0", + "version": "1.28.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prismjs", - "version": "1.27.0", + "version": "1.28.0", "license": "MIT", "devDependencies": { "@types/node-fetch": "^2.5.5", @@ -179,6 +179,64 @@ "node": ">=4" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@kwsites/file-exists": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", @@ -240,14 +298,68 @@ } }, "node_modules/@octokit/auth-token": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", - "integrity": "sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", + "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", + "dev": true, + "dependencies": { + "@octokit/types": "^6.0.3" + } + }, + "node_modules/@octokit/auth-token/node_modules/@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^11.2.0" + } + }, + "node_modules/@octokit/core": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", + "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", + "dev": true, + "peer": true, + "dependencies": { + "@octokit/auth-token": "^2.4.4", + "@octokit/graphql": "^4.5.8", + "@octokit/request": "^5.6.3", + "@octokit/request-error": "^2.0.5", + "@octokit/types": "^6.0.3", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/core/node_modules/@octokit/request-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", "dev": true, + "peer": true, "dependencies": { - "@octokit/types": "^5.0.0" + "@octokit/types": "^6.0.3", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "node_modules/@octokit/core/node_modules/@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "peer": true, + "dependencies": { + "@octokit/openapi-types": "^11.2.0" } }, + "node_modules/@octokit/core/node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true, + "peer": true + }, "node_modules/@octokit/endpoint": { "version": "6.0.8", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.8.tgz", @@ -274,6 +386,41 @@ "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", "dev": true }, + "node_modules/@octokit/graphql": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", + "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", + "dev": true, + "peer": true, + "dependencies": { + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/graphql/node_modules/@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "peer": true, + "dependencies": { + "@octokit/openapi-types": "^11.2.0" + } + }, + "node_modules/@octokit/graphql/node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true, + "peer": true + }, + "node_modules/@octokit/openapi-types": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", + "integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==", + "dev": true + }, "node_modules/@octokit/plugin-paginate-rest": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", @@ -321,18 +468,16 @@ } }, "node_modules/@octokit/request": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz", - "integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", + "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", "dev": true, "dependencies": { "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^5.0.0", - "deprecation": "^2.0.0", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.1", - "once": "^1.4.0", + "node-fetch": "^2.6.7", "universal-user-agent": "^6.0.0" } }, @@ -357,16 +502,25 @@ } }, "node_modules/@octokit/request/node_modules/@octokit/request-error": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz", - "integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", "dev": true, "dependencies": { - "@octokit/types": "^5.0.1", + "@octokit/types": "^6.0.3", "deprecation": "^2.0.0", "once": "^1.4.0" } }, + "node_modules/@octokit/request/node_modules/@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^11.2.0" + } + }, "node_modules/@octokit/request/node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -951,9 +1105,9 @@ } }, "node_modules/async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "dependencies": { "lodash": "^4.17.14" @@ -1141,9 +1295,9 @@ } }, "node_modules/before-after-hook": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", - "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", "dev": true }, "node_modules/benchmark": { @@ -6519,9 +6673,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/minimist-options": { @@ -7080,9 +7234,9 @@ } }, "node_modules/moment": { - "version": "2.27.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", - "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==", + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", "dev": true, "engines": { "node": "*" @@ -8903,9 +9057,9 @@ } }, "node_modules/shell-quote": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", - "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", + "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", "dev": true }, "node_modules/signal-exit": { @@ -8915,9 +9069,9 @@ "dev": true }, "node_modules/simple-git": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.3.0.tgz", - "integrity": "sha512-K9qcbbZwPHhk7MLi0k0ekvSFXJIrRoXgHhqMXAFM75qS68vdHTcuzmul1ilKI02F/4lXshVgBoDll2t++JK0PQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.5.0.tgz", + "integrity": "sha512-fZsaq5nzdxQRhMNs6ESGLpMUHoL5GRP+boWPhq9pMYMKwOGZV2jHOxi8AbFFA2Y/6u4kR99HoULizSbpzaODkA==", "dev": true, "dependencies": { "@kwsites/file-exists": "^1.1.1", @@ -9808,14 +9962,14 @@ "dev": true }, "node_modules/terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "dependencies": { + "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "bin": { @@ -9831,15 +9985,6 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "node_modules/terser/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -11121,6 +11266,55 @@ } } }, + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@kwsites/file-exists": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", @@ -11170,12 +11364,70 @@ "dev": true }, "@octokit/auth-token": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", - "integrity": "sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", + "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", + "dev": true, + "requires": { + "@octokit/types": "^6.0.3" + }, + "dependencies": { + "@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "requires": { + "@octokit/openapi-types": "^11.2.0" + } + } + } + }, + "@octokit/core": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", + "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", "dev": true, + "peer": true, "requires": { - "@octokit/types": "^5.0.0" + "@octokit/auth-token": "^2.4.4", + "@octokit/graphql": "^4.5.8", + "@octokit/request": "^5.6.3", + "@octokit/request-error": "^2.0.5", + "@octokit/types": "^6.0.3", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "@octokit/request-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", + "dev": true, + "peer": true, + "requires": { + "@octokit/types": "^6.0.3", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "peer": true, + "requires": { + "@octokit/openapi-types": "^11.2.0" + } + }, + "universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true, + "peer": true + } } }, "@octokit/endpoint": { @@ -11203,6 +11455,43 @@ } } }, + "@octokit/graphql": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", + "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", + "dev": true, + "peer": true, + "requires": { + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", + "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "peer": true, + "requires": { + "@octokit/openapi-types": "^11.2.0" + } + }, + "universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true, + "peer": true + } + } + }, + "@octokit/openapi-types": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", + "integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==", + "dev": true + }, "@octokit/plugin-paginate-rest": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", @@ -11252,32 +11541,39 @@ } }, "@octokit/request": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz", - "integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", + "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", "dev": true, "requires": { "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^5.0.0", - "deprecation": "^2.0.0", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.1", - "once": "^1.4.0", + "node-fetch": "^2.6.7", "universal-user-agent": "^6.0.0" }, "dependencies": { "@octokit/request-error": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz", - "integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", "dev": true, "requires": { - "@octokit/types": "^5.0.1", + "@octokit/types": "^6.0.3", "deprecation": "^2.0.0", "once": "^1.4.0" } }, + "@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "requires": { + "@octokit/openapi-types": "^11.2.0" + } + }, "is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -11771,9 +12067,9 @@ "dev": true }, "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "requires": { "lodash": "^4.17.14" @@ -11927,9 +12223,9 @@ } }, "before-after-hook": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", - "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", "dev": true }, "benchmark": { @@ -16210,9 +16506,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "minimist-options": { @@ -16614,9 +16910,9 @@ } }, "moment": { - "version": "2.27.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", - "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==", + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", "dev": true }, "ms": { @@ -18038,9 +18334,9 @@ "dev": true }, "shell-quote": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", - "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", + "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", "dev": true }, "signal-exit": { @@ -18050,9 +18346,9 @@ "dev": true }, "simple-git": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.3.0.tgz", - "integrity": "sha512-K9qcbbZwPHhk7MLi0k0ekvSFXJIrRoXgHhqMXAFM75qS68vdHTcuzmul1ilKI02F/4lXshVgBoDll2t++JK0PQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.5.0.tgz", + "integrity": "sha512-fZsaq5nzdxQRhMNs6ESGLpMUHoL5GRP+boWPhq9pMYMKwOGZV2jHOxi8AbFFA2Y/6u4kR99HoULizSbpzaODkA==", "dev": true, "requires": { "@kwsites/file-exists": "^1.1.1", @@ -18751,14 +19047,14 @@ "dev": true }, "terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "dependencies": { @@ -18767,12 +19063,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true } } }, diff --git a/package.json b/package.json index 0478ec7e06..1ea530334f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prismjs", - "version": "1.27.0", + "version": "1.28.0", "description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.", "main": "prism.js", "style": "themes/prism.css", diff --git a/plugins/autoloader/prism-autoloader.js b/plugins/autoloader/prism-autoloader.js index feb0283d28..50df2e5025 100644 --- a/plugins/autoloader/prism-autoloader.js +++ b/plugins/autoloader/prism-autoloader.js @@ -58,6 +58,7 @@ "gml": "clike", "glsl": "c", "go": "clike", + "gradle": "clike", "groovy": "clike", "haml": "ruby", "handlebars": "markup-templating", @@ -244,6 +245,7 @@ "rkt": "racket", "razor": "cshtml", "rpy": "renpy", + "res": "rescript", "robot": "robotframework", "rb": "ruby", "sh-session": "shell-session", diff --git a/plugins/autoloader/prism-autoloader.min.js b/plugins/autoloader/prism-autoloader.min.js index 24758edd91..647670b5f5 100644 --- a/plugins/autoloader/prism-autoloader.min.js +++ b/plugins/autoloader/prism-autoloader.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e={javascript:"clike",actionscript:"javascript",apex:["clike","sql"],arduino:"cpp",aspnet:["markup","csharp"],birb:"clike",bison:"c",c:"clike",csharp:"clike",cpp:"c",cfscript:"clike",chaiscript:["clike","cpp"],coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",django:"markup-templating",ejs:["javascript","markup-templating"],etlua:["lua","markup-templating"],erb:["ruby","markup-templating"],fsharp:"clike","firestore-security-rules":"clike",flow:"javascript",ftl:"markup-templating",gml:"clike",glsl:"c",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",hlsl:"c",idris:"haskell",java:"clike",javadoc:["markup","java","javadoclike"],jolie:"clike",jsdoc:["javascript","javadoclike","typescript"],"js-extras":"javascript",json5:"json",jsonp:"json","js-templates":"javascript",kotlin:"clike",latte:["clike","markup-templating","php"],less:"css",lilypond:"scheme",liquid:"markup-templating",markdown:"markup","markup-templating":"markup",mongodb:"javascript",n4js:"javascript",objectivec:"c",opencl:"c",parser:"markup",php:"markup-templating",phpdoc:["php","javadoclike"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:["markup","javascript"],purebasic:"clike",purescript:"haskell",qsharp:"clike",qml:"javascript",qore:"clike",racket:"scheme",cshtml:["markup","csharp"],jsx:["markup","javascript"],tsx:["jsx","typescript"],reason:"clike",ruby:"clike",sass:"css",scss:"css",scala:"java","shell-session":"bash",smarty:"markup-templating",solidity:"clike",soy:"markup-templating",sparql:"turtle",sqf:"clike",squirrel:"clike",stata:["mata","java","python"],"t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","vbnet"],tap:"yaml",tt2:["clike","markup-templating"],textile:"markup",twig:"markup-templating",typescript:"javascript",v:"clike",vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup","xml-doc":"markup",xquery:"markup"},a={html:"markup",xml:"markup",svg:"markup",mathml:"markup",ssml:"markup",atom:"markup",rss:"markup",js:"javascript",g4:"antlr4",ino:"arduino","arm-asm":"armasm",art:"arturo",adoc:"asciidoc",avs:"avisynth",avdl:"avro-idl",gawk:"awk",shell:"bash",shortcode:"bbcode",rbnf:"bnf",oscript:"bsl",cs:"csharp",dotnet:"csharp",cfc:"cfscript",coffee:"coffeescript",conc:"concurnas",jinja2:"django","dns-zone":"dns-zone-file",dockerfile:"docker",gv:"dot",eta:"ejs",xlsx:"excel-formula",xls:"excel-formula",gamemakerlanguage:"gml",po:"gettext",gni:"gn",ld:"linker-script","go-mod":"go-module",hbs:"handlebars",mustache:"handlebars",hs:"haskell",idr:"idris",gitignore:"ignore",hgignore:"ignore",npmignore:"ignore",webmanifest:"json",kt:"kotlin",kts:"kotlin",kum:"kumir",tex:"latex",context:"latex",ly:"lilypond",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",moon:"moonscript",n4jsd:"n4js",nani:"naniscript",objc:"objectivec",qasm:"openqasm",objectpascal:"pascal",px:"pcaxis",pcode:"peoplecode",plantuml:"plant-uml",pq:"powerquery",mscript:"powerquery",pbfasm:"purebasic",purs:"purescript",py:"python",qs:"qsharp",rkt:"racket",razor:"cshtml",rpy:"renpy",robot:"robotframework",rb:"ruby","sh-session":"shell-session",shellsession:"shell-session",smlnj:"sml",sol:"solidity",sln:"solution-file",rq:"sparql",sclang:"supercollider",t4:"t4-cs",trickle:"tremor",troy:"tremor",trig:"turtle",ts:"typescript",tsconfig:"typoscript",uscript:"unrealscript",uc:"unrealscript",url:"uri",vb:"visual-basic",vba:"visual-basic",webidl:"web-idl",mathematica:"wolfram",nb:"wolfram",wl:"wolfram",xeoracube:"xeora",yml:"yaml"},r={},s="components/",t=Prism.util.currentScript();if(t){var i=/\bplugins\/autoloader\/prism-autoloader\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i,l=/(^|\/)[\w-]+\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i,c=t.getAttribute("data-autoloader-path");if(null!=c)s=c.trim().replace(/\/?$/,"/");else{var n=t.src;i.test(n)?s=n.replace(i,"components/"):l.test(n)&&(s=n.replace(l,"$1components/"))}}var p=Prism.plugins.autoloader={languages_path:s,use_minified:!0,loadLanguages:m};Prism.hooks.add("complete",(function(e){var a=e.element,r=e.language;if(a&&r&&"none"!==r){var s=function(e){var a=(e.getAttribute("data-dependencies")||"").trim();if(!a){var r=e.parentElement;r&&"pre"===r.tagName.toLowerCase()&&(a=(r.getAttribute("data-dependencies")||"").trim())}return a?a.split(/\s*,\s*/g):[]}(a);/^diff-./i.test(r)?(s.push("diff"),s.push(r.substr("diff-".length))):s.push(r),s.every(o)||m(s,(function(){Prism.highlightElement(a)}))}}))}function o(e){if(e.indexOf("!")>=0)return!1;if((e=a[e]||e)in Prism.languages)return!0;var s=r[e];return s&&!s.error&&!1===s.loading}function m(s,t,i){"string"==typeof s&&(s=[s]);var l=s.length,c=0,n=!1;function k(){n||++c===l&&t&&t(s)}0!==l?s.forEach((function(s){!function(s,t,i){var l=s.indexOf("!")>=0;function c(){var e=r[s];e||(e=r[s]={callbacks:[]}),e.callbacks.push({success:t,error:i}),!l&&o(s)?u(s,"success"):!l&&e.error?u(s,"error"):!l&&e.loading||(e.loading=!0,e.error=!1,function(e,a,r){var s=document.createElement("script");s.src=e,s.async=!0,s.onload=function(){document.body.removeChild(s),a&&a()},s.onerror=function(){document.body.removeChild(s),r&&r()},document.body.appendChild(s)}(function(e){return p.languages_path+"prism-"+e+(p.use_minified?".min":"")+".js"}(s),(function(){e.loading=!1,u(s,"success")}),(function(){e.loading=!1,e.error=!0,u(s,"error")})))}s=s.replace("!","");var n=e[s=a[s]||s];n&&n.length?m(n,c,i):c()}(s,k,(function(){n||(n=!0,i&&i(s))}))})):t&&setTimeout(t,0)}function u(e,a){if(r[e]){for(var s=r[e].callbacks,t=0,i=s.length;t=0)return!1;if((e=a[e]||e)in Prism.languages)return!0;var s=r[e];return s&&!s.error&&!1===s.loading}function m(s,t,i){"string"==typeof s&&(s=[s]);var l=s.length,c=0,n=!1;function k(){n||++c===l&&t&&t(s)}0!==l?s.forEach((function(s){!function(s,t,i){var l=s.indexOf("!")>=0;function c(){var e=r[s];e||(e=r[s]={callbacks:[]}),e.callbacks.push({success:t,error:i}),!l&&o(s)?u(s,"success"):!l&&e.error?u(s,"error"):!l&&e.loading||(e.loading=!0,e.error=!1,function(e,a,r){var s=document.createElement("script");s.src=e,s.async=!0,s.onload=function(){document.body.removeChild(s),a&&a()},s.onerror=function(){document.body.removeChild(s),r&&r()},document.body.appendChild(s)}(function(e){return p.languages_path+"prism-"+e+(p.use_minified?".min":"")+".js"}(s),(function(){e.loading=!1,u(s,"success")}),(function(){e.loading=!1,e.error=!0,u(s,"error")})))}s=s.replace("!","");var n=e[s=a[s]||s];n&&n.length?m(n,c,i):c()}(s,k,(function(){n||(n=!0,i&&i(s))}))})):t&&setTimeout(t,0)}function u(e,a){if(r[e]){for(var s=r[e].callbacks,t=0,i=s.length;t void)[]} */ ([]); - + var lineBreakMatch = codeElement.textContent.match(NEW_LINE_EXP); + var numberOfLines = lineBreakMatch ? lineBreakMatch.length + 1 : 1; /** * The top offset between the content box of the element and the content box of the parent element of * the line highlight element (either `
` or ``).
@@ -154,6 +156,11 @@
 
 				var start = +range[0];
 				var end = +range[1] || start;
+				end = Math.min(numberOfLines, end);
+
+				if (end < start) {
+					return;
+				}
 
 				/** @type {HTMLElement} */
 				var line = pre.querySelector('.line-highlight[data-range="' + currentRange + '"]') || document.createElement('div');
diff --git a/plugins/line-highlight/prism-line-highlight.min.js b/plugins/line-highlight/prism-line-highlight.min.js
index 7d38b6b424..ade269d855 100644
--- a/plugins/line-highlight/prism-line-highlight.min.js
+++ b/plugins/line-highlight/prism-line-highlight.min.js
@@ -1 +1 @@
-!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document&&document.querySelector){var e,t="line-numbers",i="linkable-line-numbers",n=!0;Prism.plugins.lineHighlight={highlightLines:function(r,a,u){var c=(a="string"==typeof a?a:r.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),d=+r.getAttribute("data-line-offset")||0,h=(function(){if(void 0===e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding="0",t.style.border="0",t.innerHTML=" 
 ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}()?parseInt:parseFloat)(getComputedStyle(r).lineHeight),f=Prism.util.isActive(r,t),p=r.querySelector("code"),g=f?r:p||r,m=[],v=p&&g!=p?function(e,t){var i=getComputedStyle(e),n=getComputedStyle(t);function r(e){return+e.substr(0,e.length-2)}return t.offsetTop+r(n.borderTopWidth)+r(n.paddingTop)-r(i.paddingTop)}(r,p):0;c.forEach((function(e){var t=e.split("-"),i=+t[0],n=+t[1]||i,o=r.querySelector('.line-highlight[data-range="'+e+'"]')||document.createElement("div");if(m.push((function(){o.setAttribute("aria-hidden","true"),o.setAttribute("data-range",e),o.className=(u||"")+" line-highlight"})),f&&Prism.plugins.lineNumbers){var s=Prism.plugins.lineNumbers.getLine(r,i),l=Prism.plugins.lineNumbers.getLine(r,n);if(s){var a=s.offsetTop+v+"px";m.push((function(){o.style.top=a}))}if(l){var c=l.offsetTop-s.offsetTop+l.offsetHeight+"px";m.push((function(){o.style.height=c}))}}else m.push((function(){o.setAttribute("data-start",String(i)),n>i&&o.setAttribute("data-end",String(n)),o.style.top=(i-d-1)*h+v+"px",o.textContent=new Array(n-i+2).join(" \n")}));m.push((function(){o.style.width=r.scrollWidth+"px"})),m.push((function(){g.appendChild(o)}))}));var y=r.id;if(f&&Prism.util.isActive(r,i)&&y){s(r,i)||m.push((function(){r.classList.add(i)}));var b=parseInt(r.getAttribute("data-start")||"1");o(".line-numbers-rows > span",r).forEach((function(e,t){var i=t+b;e.onclick=function(){var e=y+"."+i;n=!1,location.hash=e,setTimeout((function(){n=!0}),1)}}))}return function(){m.forEach(l)}}};var r=0;Prism.hooks.add("before-sanity-check",(function(e){var t=e.element.parentElement;if(a(t)){var i=0;o(".line-highlight",t).forEach((function(e){i+=e.textContent.length,e.parentNode.removeChild(e)})),i&&/^(?: \n)+$/.test(e.code.slice(-i))&&(e.code=e.code.slice(0,-i))}})),Prism.hooks.add("complete",(function e(i){var n=i.element.parentElement;if(a(n)){clearTimeout(r);var o=Prism.plugins.lineNumbers,l=i.plugins&&i.plugins.lineNumbers;s(n,t)&&o&&!l?Prism.hooks.add("line-numbers",e):(Prism.plugins.lineHighlight.highlightLines(n)(),r=setTimeout(u,1))}})),window.addEventListener("hashchange",u),window.addEventListener("resize",(function(){o("pre").filter(a).map((function(e){return Prism.plugins.lineHighlight.highlightLines(e)})).forEach(l)}))}function o(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function s(e,t){return e.classList.contains(t)}function l(e){e()}function a(e){return!!(e&&/pre/i.test(e.nodeName)&&(e.hasAttribute("data-line")||e.id&&Prism.util.isActive(e,i)))}function u(){var e=location.hash.slice(1);o(".temporary.line-highlight").forEach((function(e){e.parentNode.removeChild(e)}));var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var i=e.slice(0,e.lastIndexOf(".")),r=document.getElementById(i);r&&(r.hasAttribute("data-line")||r.setAttribute("data-line",""),Prism.plugins.lineHighlight.highlightLines(r,t,"temporary ")(),n&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}}(); \ No newline at end of file +!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document&&document.querySelector){var e,t="line-numbers",i="linkable-line-numbers",n=/\n(?!$)/g,r=!0;Prism.plugins.lineHighlight={highlightLines:function(o,u,c){var h=(u="string"==typeof u?u:o.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),d=+o.getAttribute("data-line-offset")||0,f=(function(){if(void 0===e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding="0",t.style.border="0",t.innerHTML=" 
 ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}()?parseInt:parseFloat)(getComputedStyle(o).lineHeight),p=Prism.util.isActive(o,t),g=o.querySelector("code"),m=p?o:g||o,v=[],y=g.textContent.match(n),b=y?y.length+1:1,A=g&&m!=g?function(e,t){var i=getComputedStyle(e),n=getComputedStyle(t);function r(e){return+e.substr(0,e.length-2)}return t.offsetTop+r(n.borderTopWidth)+r(n.paddingTop)-r(i.paddingTop)}(o,g):0;h.forEach((function(e){var t=e.split("-"),i=+t[0],n=+t[1]||i;if(!((n=Math.min(b,n))i&&r.setAttribute("data-end",String(n)),r.style.top=(i-d-1)*f+A+"px",r.textContent=new Array(n-i+2).join(" \n")}));v.push((function(){r.style.width=o.scrollWidth+"px"})),v.push((function(){m.appendChild(r)}))}}));var P=o.id;if(p&&Prism.util.isActive(o,i)&&P){l(o,i)||v.push((function(){o.classList.add(i)}));var E=parseInt(o.getAttribute("data-start")||"1");s(".line-numbers-rows > span",o).forEach((function(e,t){var i=t+E;e.onclick=function(){var e=P+"."+i;r=!1,location.hash=e,setTimeout((function(){r=!0}),1)}}))}return function(){v.forEach(a)}}};var o=0;Prism.hooks.add("before-sanity-check",(function(e){var t=e.element.parentElement;if(u(t)){var i=0;s(".line-highlight",t).forEach((function(e){i+=e.textContent.length,e.parentNode.removeChild(e)})),i&&/^(?: \n)+$/.test(e.code.slice(-i))&&(e.code=e.code.slice(0,-i))}})),Prism.hooks.add("complete",(function e(i){var n=i.element.parentElement;if(u(n)){clearTimeout(o);var r=Prism.plugins.lineNumbers,s=i.plugins&&i.plugins.lineNumbers;l(n,t)&&r&&!s?Prism.hooks.add("line-numbers",e):(Prism.plugins.lineHighlight.highlightLines(n)(),o=setTimeout(c,1))}})),window.addEventListener("hashchange",c),window.addEventListener("resize",(function(){s("pre").filter(u).map((function(e){return Prism.plugins.lineHighlight.highlightLines(e)})).forEach(a)}))}function s(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function l(e,t){return e.classList.contains(t)}function a(e){e()}function u(e){return!!(e&&/pre/i.test(e.nodeName)&&(e.hasAttribute("data-line")||e.id&&Prism.util.isActive(e,i)))}function c(){var e=location.hash.slice(1);s(".temporary.line-highlight").forEach((function(e){e.parentNode.removeChild(e)}));var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var i=e.slice(0,e.lastIndexOf(".")),n=document.getElementById(i);n&&(n.hasAttribute("data-line")||n.setAttribute("data-line",""),Prism.plugins.lineHighlight.highlightLines(n,t,"temporary ")(),r&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}}(); \ No newline at end of file diff --git a/plugins/normalize-whitespace/demo.html b/plugins/normalize-whitespace/demo.html index a6bcf22bea..068cdd76f5 100644 --- a/plugins/normalize-whitespace/demo.html +++ b/plugins/normalize-whitespace/demo.html @@ -17,6 +17,21 @@
+
+
+	
+
+
+		var there_is_a_very_very_very_very_long_line_it_can_break_it_for_you = true;
+
+		if (there_is_a_very_very_very_very_long_line_it_can_break_it_for_you === true) {
+		};
+
+
+	
+
+
+ diff --git a/plugins/normalize-whitespace/index.html b/plugins/normalize-whitespace/index.html index ce049d8f55..a145fc6332 100644 --- a/plugins/normalize-whitespace/index.html +++ b/plugins/normalize-whitespace/index.html @@ -57,7 +57,7 @@

How to use

});
-

The following settings are available:

+

The following settings are available and can be set via the data-[setting] attribute on the <pre< element:

remove-trailing
@@ -103,6 +103,16 @@

Examples

}; + var + there_is_a_very_very_very_very_long_line_it_can_break_it_for_you + = true; + + if + (there_is_a_very_very_very_very_long_line_it_can_break_it_for_you + === true) { + }; + +
diff --git a/plugins/normalize-whitespace/prism-normalize-whitespace.js b/plugins/normalize-whitespace/prism-normalize-whitespace.js index c8bc361bbd..4dc89bcf2d 100644 --- a/plugins/normalize-whitespace/prism-normalize-whitespace.js +++ b/plugins/normalize-whitespace/prism-normalize-whitespace.js @@ -33,6 +33,18 @@ return str.length + res; } + var settingsConfig = { + 'remove-trailing': 'boolean', + 'remove-indent': 'boolean', + 'left-trim': 'boolean', + 'right-trim': 'boolean', + 'break-lines': 'number', + 'indent': 'number', + 'remove-initial-line-feed': 'boolean', + 'tabs-to-spaces': 'number', + 'spaces-to-tabs': 'number', + }; + NormalizeWhitespace.prototype = { setDefaults: function (defaults) { this.defaults = assign(this.defaults, defaults); @@ -161,6 +173,25 @@ return; } + if (env.settings == null) { env.settings = {}; } + + // Read settings from 'data-' attributes + for (var key in settingsConfig) { + if (Object.hasOwnProperty.call(settingsConfig, key)) { + var settingType = settingsConfig[key]; + if (pre.hasAttribute('data-' + key)) { + try { + var value = JSON.parse(pre.getAttribute('data-' + key) || 'true'); + if (typeof value === settingType) { + env.settings[key] = value; + } + } catch (_error) { + // ignore error + } + } + } + } + var children = pre.childNodes; var before = ''; var after = ''; diff --git a/plugins/normalize-whitespace/prism-normalize-whitespace.min.js b/plugins/normalize-whitespace/prism-normalize-whitespace.min.js index db661cd737..56918926b3 100644 --- a/plugins/normalize-whitespace/prism-normalize-whitespace.min.js +++ b/plugins/normalize-whitespace/prism-normalize-whitespace.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof Prism){var e=Object.assign||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e};n.prototype={setDefaults:function(n){this.defaults=e(this.defaults,n)},normalize:function(n,t){for(var r in t=e(this.defaults,t)){var i=r.replace(/-(\w)/g,(function(e,n){return n.toUpperCase()}));"normalize"!==r&&"setDefaults"!==i&&t[r]&&this[i]&&(n=this[i].call(this,n,t[r]))}return n},leftTrim:function(e){return e.replace(/^\s+/,"")},rightTrim:function(e){return e.replace(/\s+$/,"")},tabsToSpaces:function(e,n){return n=0|n||4,e.replace(/\t/g,new Array(++n).join(" "))},spacesToTabs:function(e,n){return n=0|n||4,e.replace(RegExp(" {"+n+"}","g"),"\t")},removeTrailing:function(e){return e.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(e){return e.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(e){var n=e.match(/^[^\S\n\r]*(?=\S)/gm);return n&&n[0].length?(n.sort((function(e,n){return e.length-n.length})),n[0].length?e.replace(RegExp("^"+n[0],"gm"),""):e):e},indent:function(e,n){return e.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++n).join("\t")+"$&")},breakLines:function(e,n){n=!0===n?80:0|n||80;for(var r=e.split("\n"),i=0;in&&(o[l]="\n"+o[l],a=s)}r[i]=o.join("")}return r.join("\n")}},"undefined"!=typeof module&&module.exports&&(module.exports=n),Prism.plugins.NormalizeWhitespace=new n({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",(function(e){var n=Prism.plugins.NormalizeWhitespace;if((!e.settings||!1!==e.settings["whitespace-normalization"])&&Prism.util.isActive(e.element,"whitespace-normalization",!0))if(e.element&&e.element.parentNode||!e.code){var t=e.element.parentNode;if(e.code&&t&&"pre"===t.nodeName.toLowerCase()){for(var r=t.childNodes,i="",o="",a=!1,l=0;lt&&(o[l]="\n"+o[l],a=s)}n[i]=o.join("")}return n.join("\n")}},"undefined"!=typeof module&&module.exports&&(module.exports=n),Prism.plugins.NormalizeWhitespace=new n({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",(function(e){var n=Prism.plugins.NormalizeWhitespace;if((!e.settings||!1!==e.settings["whitespace-normalization"])&&Prism.util.isActive(e.element,"whitespace-normalization",!0))if(e.element&&e.element.parentNode||!e.code){var r=e.element.parentNode;if(e.code&&r&&"pre"===r.nodeName.toLowerCase()){for(var i in null==e.settings&&(e.settings={}),t)if(Object.hasOwnProperty.call(t,i)){var o=t[i];if(r.hasAttribute("data-"+i))try{var a=JSON.parse(r.getAttribute("data-"+i)||"true");typeof a===o&&(e.settings[i]=a)}catch(e){}}for(var l=r.childNodes,s="",c="",u=!1,m=0;m} */ diff --git a/tests/languages/arturo!+shell/sh-string_feature.test b/tests/languages/arturo!+shell/sh-string_feature.test index 1289e65e0b..357cb43632 100644 --- a/tests/languages/arturo!+shell/sh-string_feature.test +++ b/tests/languages/arturo!+shell/sh-string_feature.test @@ -9,7 +9,8 @@ ["string", "{!sh"], ["embedded", [ ["function", "ls"], - " -la test/*x\r\n" + ["parameter", "-la"], + " test/*x\r\n" ]], ["string", "}"] ]] diff --git a/tests/languages/asciidoc/issue3480.test b/tests/languages/asciidoc/issue3480.test new file mode 100644 index 0000000000..2b6bdaeef9 --- /dev/null +++ b/tests/languages/asciidoc/issue3480.test @@ -0,0 +1,1068 @@ +// View this document online at https://asciidoctor.org/docs/asciidoc-writers-guide/ += AsciiDoc Writer's Guide +Dan Allen ; Sarah White +:description: This guide describes the basic structure of an AsciiDoc document, how to create your first AsciiDoc document, how to add other structural elements such as lists, block quotes and source code, and how to convert an AsciiDoc document to HTML, DocBook and PDF. +:keywords: AsciiDoc, Asciidoctor, syntax, reference, learn, how to, writers, authors +:page-description: {description} +:page-keywords: {keywords} +:page-layout: docs +ifndef::env-site[] +:toc: left +:icons: font +:idprefix: +:idseparator: - +:sectanchors: +:source-highlighter: highlightjs +endif::[] +:experimental: +:mdash: — +:language: asciidoc +:source-language: {language} +:table-caption!: +:example-caption!: +:figure-caption!: +:imagesdir: ../images +// Refs +:url-docs-asciidoc: https://docs.asciidoctor.org/asciidoc/latest/ +:url-quickref: {url-docs-asciidoc}syntax-quick-reference/ +:user-ref: https://asciidoctor.org/docs/user-manual +:asciidoctor-ref: https://asciidoctor.org/ +:asciidoctor-gem-ref: https://rubygems.org/gems/asciidoctor +:uri-install: https://asciidoctor.org/docs/install-toolchain/ +:fopub-doc-ref: https://github.com/asciidoctor/asciidoctor-fopub#readme +:docs-ref: https://asciidoctor.org/docs +:gist-ref: https://gist.github.com +:snippets-ref: https://gitlab.com/explore/snippets +:publican-ref: https://fedorahosted.org/publican + +This guide provides a gentle introduction to AsciiDoc, a _plain text_ documentation *syntax* and *processor*. +This introduction is intended for anyone who wants to reduce the effort required to write and publish content, whether for technical documentation, articles, web pages or good ol'-fashioned prose. + +TIP: If you want to know what AsciiDoc is all about, find the answer in {url-docs-asciidoc}#about-asciidoc[About AsciiDoc]. +If you're looking for a concise survey of the AsciiDoc syntax, consult the {url-quickref}[AsciiDoc Syntax Quick Reference]. + +In this guide, you'll learn: + +- The basic structure of an AsciiDoc document +- How to create your first AsciiDoc document +- How to add other structural elements such as lists, block quotes and source code +- How to convert an AsciiDoc document to HTML, DocBook and PDF + +In addition to covering the AsciiDoc basics, this guide also suggests a set of conventions to help you create more consistent documents and maximize your writing productivity. + +Let's dive in to AsciiDoc! + +== Writing in AsciiDoc + +The goal of this section is to teach you how to compose your first AsciiDoc document. +Hopefully, when you look back, you'll agree it just makes sense. + +Your adventure with AsciiDoc begins in your favorite text editor. + +=== It's just text, mate. + +Since AsciiDoc syntax is just _plain text_, you can write an AsciiDoc document using _any_ text editor. +You don't need complex word processing programs like Microsoft Word, OpenOffice Writer or Google Docs. +In fact, you _shouldn't_ use these programs because they add cruft to your document (that you can't see) and makes conversion tedious. + +TIP: While it's true any text editor will do, I recommend selecting an editor that supports syntax highlighting for AsciiDoc. +The *[red]##c##[green]##o##[purple]##l##[fuchsia]##o##[blue]##r##* brings contrast to the text, making it easier to read. +The highlighting also confirms when you've entered the correct syntax for an inline or block element. + +The most popular application for editing plain text on macOS is *TextMate*. +A similar choice on Linux is *GEdit*. +On Windows, stay away from Notepad and Wordpad because they produce plain text which is not cross-platform friendly. +Opt instead for a competent text editor like *Notepad++*. +If you're a programmer (or a writer with an inner geek), you'll likely prefer *Vim*, *Emacs*, or *Sublime Text*, all of which are available cross-platform. +The key feature all these editors share is syntax highlighting for AsciiDoc. + +Open up your favorite text editor and get ready to write some AsciiDoc! + +=== Content is king! + +The bulk of the content in a document is paragraph text. +This is why Asciidoctor doesn't require any special markup or attributes to specify paragraph content. +You can just start typing. + +In Asciidoctor, adjacent or consecutive lines of text form a paragraph element. +To start a new paragraph after another element, such as a section title or table, hit the kbd:[RETURN] key twice to insert a blank line, and then continue typing your content. + +.Two paragraphs in an AsciiDoc document +[source] +---- +This journey begins one late Monday afternoon in Antwerp. +Our team desperately needs coffee, but none of us dare open the office door. + +To leave means code dismemberment and certain death. +---- + +.The two paragraphs rendered using the default (html5) converter and stylesheet (asciidoctor.css) +==== +This journey begins one late Monday afternoon in Antwerp. +Our team desperately needs coffee, but none of us dare open the office door. + +To leave means code dismemberment and certain death. +==== + +Just like that, *you're writing in AsciiDoc!* +As you can see, it's just like writing an e-mail. + +Save the file with a file extension of `.adoc`. + +TIP: If you want to find out how to convert the document to HTML, DocBook or PDF, skip ahead to the section on <>. + +==== Wrapped text and hard line breaks + +Since adjacent lines of text are combined into a single paragraph when Asciidoctor converts a document, that means you can wrap paragraph text or put each sentence or phrase on a separate line. +The line breaks won't appear in the output. + +However, if you want the line breaks in a paragraph to be preserved, you can either use a space followed by a plus sign (`{plus}`) or set the `hardbreaks` option on the paragraph. +This results in a visible line break (e.g., `
`) following each line. + +[source] +.Line breaks preserved using a space followed by the plus sign ({plus}) +---- +Rubies are red, + +Topazes are blue. +---- + +==== +Rubies are red, + +Topazes are blue. +==== + +[source] +.Line breaks preserved using the hardbreaks option +---- +[%hardbreaks] +Ruby is red. +Java is black. +---- + +==== +[%hardbreaks] +Ruby is red. +Java is black. +==== + +To preserve line breaks throughout your whole document, add the `hardbreaks` attribute to the document's header. + +.Line breaks preserved throughout the document using the hardbreaks attribute +[source] +---- += Line Break Doc Title +:hardbreaks: + +Rubies are red, +Topazes are blue. +---- + +=== Admonitions + +There are certain statements you may want to draw attention to by taking them out of the content's flow and labeling them with a priority. +These are called admonitions. +It's rendered style is determined by the assigned label (i.e., value). +Asciidoctor provides five admonition style labels: + +* `NOTE` +* `TIP` +* `IMPORTANT` +* `CAUTION` +* `WARNING` + +.Caution vs. Warning +[#caution-vs-warning] +**** +When choosing the admonition type, you may find yourself getting confused between "caution" and "warning" as these words are often used interchangeably. +Here's a simple rule to help you differentiate the two: + +* Use *CAUTION* to advise the reader to _act_ carefully (i.e., exercise care). +* Use *WARNING* to inform the reader of danger, harm, or consequences that exist. + +To find a deeper analysis, see https://www.differencebetween.com/difference-between-caution-and-vs-warning/. +**** + +When you want to call attention to a single paragraph, start the first line of the paragraph with the label you want to use. +The label must be uppercase and followed by a colon (`:`). + +.Admonition paragraph syntax +[source] +---- +WARNING: Wolpertingers are known to nest in server racks. <1> <2> +Enter at your own risk. +---- +<1> The label must be uppercase and immediately followed by a colon (`:`). +<2> Separate the first line of the paragraph from the label by a single space. + +.Result: Admonition paragraph +==== +WARNING: Wolpertingers are known to nest in server racks. +Enter at your own risk. +==== + +An admonition paragraph is rendered in a callout box with the admonition label--or its corresponding icon--in the gutter. +Icons are enabled by setting the `icons` attribute on the document. + +NOTE: Admonitions can also encapsulate any block content, which we'll cover later. + +=== Mild punctuation, strong impact + +Just as we emphasize certain words and phrases when we speak, we can emphasize them in text by surrounding them with punctuation. +AsciiDoc refers to this markup as _quoted text_. + +==== Quoted text + +For instance, in an e-mail, you might "`speak`" a word louder by enclosing it in asterisks. + +[source] +I can't believe it, we *won*! + +As you would expect, the asterisks make the text *won* bold. +You can almost sense the emotion. +This is one example of quoted (i.e., formatted) text. + +NOTE: The term "`quote`" is used liberally here to apply to any symbols that surround text in order to apply emphasis or special meaning. + +Here are the forms of quoted text that AsciiDoc recognizes: + +.Bold, italic, and monospace formatting syntax +[source] +---- +bold *constrained* & **un**constrained + +italic _constrained_ & __un__constrained + +bold italic *_constrained_* & **__un__**constrained + +monospace `constrained` & ``un``constrained + +monospace bold `*constrained*` & ``**un**``constrained + +monospace italic `_constrained_` & ``__un__``constrained + +monospace bold italic `*_constrained_*` & ``**__un__**``constrained +---- + +When you want to quote text (e.g., place emphasis) somewhere other than at the boundaries of a word, you need to double up the punctuation. + +.Result: Bold, italic, and monospace text +==== +bold *constrained* & **un**constrained + +italic _constrained_ & __un__constrained + +bold italic *_constrained_* & **__un__**constrained + +monospace `constrained` & ``un``constrained + +monospace bold `*constrained*` & ``**un**``constrained + +monospace italic `_constrained_` & ``__un__``constrained + +monospace bold italic `*_constrained_*` & ``**__un__**``constrained +==== + +Any quoted text can be prefixed with an attribute list. +The first positional attribute is treated as a role. +The role can be used to apply custom styling to the text. +For instance: + +[source] +Type the word [.userinput]#asciidoc# into the search bar. + +When converting to HTML, the word "`asciidoc`" is wrapped in `` tags and the role is used as the element's CSS class: + +[source,xml] +asciidoc + +You can apply styles to the text using CSS. + +You may not always want these substitutions to take place. +In those cases, you'll need to use markup to escape the text. + +---------------------------------------------------- + +[ + ["comment", "// View this document online at https://asciidoctor.org/docs/asciidoc-writers-guide/"], + ["title", [ + ["punctuation", "="], + " AsciiDoc Writer's Guide" + ]], + "\r\nDan Allen <", + ["macro", [ + ["function", "https"], + ["punctuation", ":"], + "//github.com/mojavelinux", + ["attributes", [ + ["punctuation", "["], + ["attr-value", "@mojavelinux"], + ["punctuation", "]"] + ]] + ]], + ">; Sarah White <", + ["macro", [ + ["function", "https"], + ["punctuation", ":"], + "//github.com/graphitefriction", + ["attributes", [ + ["punctuation", "["], + ["attr-value", "@graphitefriction"], + ["punctuation", "]"] + ]] + ]], + ">\r\n", + ["attribute-entry", ":description: This guide describes the basic structure of an AsciiDoc document, how to create your first AsciiDoc document, how to add other structural elements such as lists, block quotes and source code, and how to convert an AsciiDoc document to HTML, DocBook and PDF."], + ["attribute-entry", ":keywords: AsciiDoc, Asciidoctor, syntax, reference, learn, how to, writers, authors"], + ["attribute-entry", ":page-description: {description}"], + ["attribute-entry", ":page-keywords: {keywords}"], + ["attribute-entry", ":page-layout: docs"], + ["macro", [ + ["function", "ifndef"], + ["punctuation", "::"], + "env-site", + ["attributes", [ + ["punctuation", "["], + ["punctuation", "]"] + ]] + ]], + ["attribute-entry", ":toc: left"], + ["attribute-entry", ":icons: font"], + ["attribute-entry", ":idprefix:"], + ["attribute-entry", ":idseparator: -"], + ["attribute-entry", ":sectanchors:"], + ["attribute-entry", ":source-highlighter: highlightjs"], + ["macro", [ + ["function", "endif"], + ["punctuation", "::"], + ["attributes", [ + ["punctuation", "["], + ["punctuation", "]"] + ]] + ]], + ["attribute-entry", ":experimental:"], + ["attribute-entry", ":mdash: —"], + ["attribute-entry", ":language: asciidoc"], + ["attribute-entry", ":source-language: {language}"], + ["attribute-entry", ":table-caption!:"], + ["attribute-entry", ":example-caption!:"], + ["attribute-entry", ":figure-caption!:"], + ["attribute-entry", ":imagesdir: ../images"], + ["comment", "// Refs"], + ["attribute-entry", ":url-docs-asciidoc: https://docs.asciidoctor.org/asciidoc/latest/"], + ["attribute-entry", ":url-quickref: {url-docs-asciidoc}syntax-quick-reference/"], + ["attribute-entry", ":user-ref: https://asciidoctor.org/docs/user-manual"], + ["attribute-entry", ":asciidoctor-ref: https://asciidoctor.org/"], + ["attribute-entry", ":asciidoctor-gem-ref: https://rubygems.org/gems/asciidoctor"], + ["attribute-entry", ":uri-install: https://asciidoctor.org/docs/install-toolchain/"], + ["attribute-entry", ":fopub-doc-ref: https://github.com/asciidoctor/asciidoctor-fopub#readme"], + ["attribute-entry", ":docs-ref: https://asciidoctor.org/docs"], + ["attribute-entry", ":gist-ref: https://gist.github.com"], + ["attribute-entry", ":snippets-ref: https://gitlab.com/explore/snippets"], + ["attribute-entry", ":publican-ref: https://fedorahosted.org/publican"], + + "\r\n\r\nThis guide provides a gentle introduction to AsciiDoc, a ", + ["inline", [ + ["italic", [ + ["punctuation", "_"], + "plain text", + ["punctuation", "_"] + ]] + ]], + " documentation ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "syntax", + ["punctuation", "*"] + ]] + ]], + " and ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "processor", + ["punctuation", "*"] + ]] + ]], + ".\r\nThis introduction is intended for anyone who wants to reduce the effort required to write and publish content, whether for technical documentation, articles, web pages or good ol'-fashioned prose.\r\n\r\n", + + ["admonition", "TIP:"], + " If you want to know what AsciiDoc is all about, find the answer in ", + ["inline", [ + ["attribute-ref", [ + ["punctuation", "{"], + ["variable", "url-docs-asciidoc"], + ["punctuation", "}"] + ]] + ]], + "#about-asciidoc[About AsciiDoc].\r\nIf you're looking for a concise survey of the AsciiDoc syntax, consult the ", + ["inline", [ + ["attribute-ref", [ + ["punctuation", "{"], + ["variable", "url-quickref"], + ["punctuation", "}"] + ]] + ]], + "[AsciiDoc Syntax Quick Reference].\r\n\r\nIn this guide, you'll learn:\r\n\r\n", + + ["list-punctuation", "-"], + " The basic structure of an AsciiDoc document\r\n", + + ["list-punctuation", "-"], + " How to create your first AsciiDoc document\r\n", + + ["list-punctuation", "-"], + " How to add other structural elements such as lists, block quotes and source code\r\n", + + ["list-punctuation", "-"], + " How to convert an AsciiDoc document to HTML, DocBook and PDF\r\n\r\nIn addition to covering the AsciiDoc basics, this guide also suggests a set of conventions to help you create more consistent documents and maximize your writing productivity.\r\n\r\nLet's dive in to AsciiDoc!\r\n\r\n", + + ["title", [ + ["punctuation", "=="], + " Writing in AsciiDoc" + ]], + + "\r\n\r\nThe goal of this section is to teach you how to compose your first AsciiDoc document.\r\nHopefully, when you look back, you'll agree it just makes sense.\r\n\r\nYour adventure with AsciiDoc begins in your favorite text editor.\r\n\r\n", + + ["title", [ + ["punctuation", "==="], + " It's just text, mate." + ]], + + "\r\n\r\nSince AsciiDoc syntax is just ", + ["inline", [ + ["italic", [ + ["punctuation", "_"], + "plain text", + ["punctuation", "_"] + ]] + ]], + ", you can write an AsciiDoc document using ", + ["inline", [ + ["italic", [ + ["punctuation", "_"], + "any", + ["punctuation", "_"] + ]] + ]], + " text editor.\r\nYou don't need complex word processing programs like Microsoft Word, OpenOffice Writer or Google Docs.\r\nIn fact, you ", + ["inline", [ + ["italic", [ + ["punctuation", "_"], + "shouldn't", + ["punctuation", "_"] + ]] + ]], + " use these programs because they add cruft to your document (that you can't see) and makes conversion tedious.\r\n\r\n", + + ["admonition", "TIP:"], + " While it's true any text editor will do, I recommend selecting an editor that supports syntax highlighting for AsciiDoc.\r\nThe ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "[red]##c##[green]##o##[purple]##l##[fuchsia]##o##[blue]##r##", + ["punctuation", "*"] + ]] + ]], + " brings contrast to the text, making it easier to read.\r\nThe highlighting also confirms when you've entered the correct syntax for an inline or block element.\r\n\r\nThe most popular application for editing plain text on macOS is ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "TextMate", + ["punctuation", "*"] + ]] + ]], + ".\r\nA similar choice on Linux is ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "GEdit", + ["punctuation", "*"] + ]] + ]], + ".\r\nOn Windows, stay away from Notepad and Wordpad because they produce plain text which is not cross-platform friendly.\r\nOpt instead for a competent text editor like ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "Notepad++", + ["punctuation", "*"] + ]] + ]], + ".\r\nIf you're a programmer (or a writer with an inner geek), you'll likely prefer ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "Vim", + ["punctuation", "*"] + ]] + ]], + ", ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "Emacs", + ["punctuation", "*"] + ]] + ]], + ", or ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "Sublime Text", + ["punctuation", "*"] + ]] + ]], + ", all of which are available cross-platform.\r\nThe key feature all these editors share is syntax highlighting for AsciiDoc.\r\n\r\nOpen up your favorite text editor and get ready to write some AsciiDoc!\r\n\r\n", + + ["title", [ + ["punctuation", "==="], + " Content is king!" + ]], + + "\r\n\r\nThe bulk of the content in a document is paragraph text.\r\nThis is why Asciidoctor doesn't require any special markup or attributes to specify paragraph content.\r\nYou can just start typing.\r\n\r\nIn Asciidoctor, adjacent or consecutive lines of text form a paragraph element.\r\nTo start a new paragraph after another element, such as a section title or table, hit the ", + ["macro", [ + ["function", "kbd"], + ["punctuation", ":"], + ["attributes", [ + ["punctuation", "["], + ["attr-value", "RETURN"], + ["punctuation", "]"] + ]] + ]], + " key twice to insert a blank line, and then continue typing your content.\r\n\r\n", + + ["title", [ + ["punctuation", "."], + "Two paragraphs in an AsciiDoc document" + ]], + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", "]"] + ]], + ["literal-block", [ + ["punctuation", "----"], + "\r\nThis journey begins one late Monday afternoon in Antwerp.\r\nOur team desperately needs coffee, but none of us dare open the office door.\r\n\r\nTo leave means code dismemberment and certain death.\r\n", + ["punctuation", "----"] + ]], + + ["title", [ + ["punctuation", "."], + "The two paragraphs rendered using the default (html5) converter and stylesheet (asciidoctor.css)" + ]], + ["other-block", [ + ["punctuation", "===="], + "\r\nThis journey begins one late Monday afternoon in Antwerp.\r\nOur team desperately needs coffee, but none of us dare open the office door.\r\n\r\nTo leave means code dismemberment and certain death.\r\n", + ["punctuation", "===="] + ]], + + "\r\n\r\nJust like that, ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "you're writing in AsciiDoc!", + ["punctuation", "*"] + ]] + ]], + + "\r\nAs you can see, it's just like writing an e-mail.\r\n\r\nSave the file with a file extension of ", + ["inline", [ + ["punctuation", "`"], + ".adoc", + ["punctuation", "`"] + ]], + ".\r\n\r\n", + + ["admonition", "TIP:"], + " If you want to find out how to convert the document to HTML, DocBook or PDF, skip ahead to the section on ", + ["inline", [ + ["url", [ + ["punctuation", "<<"], + "converting-your-document", + ["punctuation", ">>"] + ]] + ]], + ".\r\n\r\n", + + ["title", [ + ["punctuation", "===="], + " Wrapped text and hard line breaks" + ]], + + "\r\n\r\nSince adjacent lines of text are combined into a single paragraph when Asciidoctor converts a document, that means you can wrap paragraph text or put each sentence or phrase on a separate line.\r\nThe line breaks won't appear in the output.\r\n\r\nHowever, if you want the line breaks in a paragraph to be preserved, you can either use a space followed by a plus sign (", + ["inline", [ + ["punctuation", "`"], + "{plus}", + ["punctuation", "`"] + ]], + ") or set the ", + ["inline", [ + ["punctuation", "`"], + "hardbreaks", + ["punctuation", "`"] + ]], + " option on the paragraph.\r\nThis results in a visible line break (e.g., ", + ["inline", [ + ["punctuation", "`"], + "
", + ["punctuation", "`"] + ]], + ") following each line.\r\n\r\n", + + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", "]"] + ]], + ["title", [ + ["punctuation", "."], + "Line breaks preserved using a space followed by the plus sign (", + ["inline", [ + ["attribute-ref", [ + ["punctuation", "{"], + ["variable", "plus"], + ["punctuation", "}"] + ]] + ]], + ")" + ]], + ["literal-block", [ + ["punctuation", "----"], + "\r\nRubies are red, +\r\nTopazes are blue.\r\n", + ["punctuation", "----"] + ]], + + ["other-block", [ + ["punctuation", "===="], + "\r\nRubies are red, ", ["line-continuation", "+"], + "\r\nTopazes are blue.\r\n", + ["punctuation", "===="] + ]], + + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", "]"] + ]], + ["title", [ + ["punctuation", "."], + "Line breaks preserved using the hardbreaks option" + ]], + ["literal-block", [ + ["punctuation", "----"], + "\r\n[%hardbreaks]\r\nRuby is red.\r\nJava is black.\r\n", + ["punctuation", "----"] + ]], + + ["other-block", [ + ["punctuation", "===="], + ["attributes", [ + ["punctuation", "["], + ["attr-value", "%hardbreaks"], + ["punctuation", "]"] + ]], + "\r\nRuby is red.\r\nJava is black.\r\n", + ["punctuation", "===="] + ]], + + "\r\n\r\nTo preserve line breaks throughout your whole document, add the ", + ["inline", [ + ["punctuation", "`"], + "hardbreaks", + ["punctuation", "`"] + ]], + " attribute to the document's header.\r\n\r\n", + + ["title", [ + ["punctuation", "."], + "Line breaks preserved throughout the document using the hardbreaks attribute" + ]], + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", "]"] + ]], + ["literal-block", [ + ["punctuation", "----"], + "\r\n= Line Break Doc Title\r\n:hardbreaks:\r\n\r\nRubies are red,\r\nTopazes are blue.\r\n", + ["punctuation", "----"] + ]], + + ["title", [ + ["punctuation", "==="], + " Admonitions" + ]], + + "\r\n\r\nThere are certain statements you may want to draw attention to by taking them out of the content's flow and labeling them with a priority.\r\nThese are called admonitions.\r\nIt's rendered style is determined by the assigned label (i.e., value).\r\nAsciidoctor provides five admonition style labels:\r\n\r\n", + + ["list-punctuation", "*"], + ["inline", [ + ["punctuation", "`"], + "NOTE", + ["punctuation", "`"] + ]], + + ["list-punctuation", "*"], + ["inline", [ + ["punctuation", "`"], + "TIP", + ["punctuation", "`"] + ]], + + ["list-punctuation", "*"], + ["inline", [ + ["punctuation", "`"], + "IMPORTANT", + ["punctuation", "`"] + ]], + + ["list-punctuation", "*"], + ["inline", [ + ["punctuation", "`"], + "CAUTION", + ["punctuation", "`"] + ]], + + ["list-punctuation", "*"], + ["inline", [ + ["punctuation", "`"], + "WARNING", + ["punctuation", "`"] + ]], + + ["title", [ + ["punctuation", "."], + "Caution vs. Warning" + ]], + + ["attributes", [ + ["punctuation", "["], + ["attr-value", "#caution-vs-warning"], + ["punctuation", "]"] + ]], + + ["other-block", [ + ["punctuation", "****"], + "\r\nWhen choosing the admonition type, you may find yourself getting confused between \"caution\" and \"warning\" as these words are often used interchangeably.\r\nHere's a simple rule to help you differentiate the two:\r\n\r\n", + + ["list-punctuation", "*"], + " Use ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "CAUTION", + ["punctuation", "*"] + ]] + ]], + " to advise the reader to ", + ["inline", [ + ["italic", [ + ["punctuation", "_"], + "act", + ["punctuation", "_"] + ]] + ]], + " carefully (i.e., exercise care).\r\n", + + ["list-punctuation", "*"], + " Use ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "WARNING", + ["punctuation", "*"] + ]] + ]], + " to inform the reader of danger, harm, or consequences that exist.\r\n\r\nTo find a deeper analysis, see https://www.differencebetween.com/difference-between-caution-and-vs-warning/.\r\n", + + ["punctuation", "****"] + ]], + + "\r\n\r\nWhen you want to call attention to a single paragraph, start the first line of the paragraph with the label you want to use.\r\nThe label must be uppercase and followed by a colon (", + ["inline", [ + ["punctuation", "`"], + ":", + ["punctuation", "`"] + ]], + ").\r\n\r\n", + + ["title", [ + ["punctuation", "."], + "Admonition paragraph syntax" + ]], + + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", "]"] + ]], + + ["literal-block", [ + ["punctuation", "----"], + "\r\nWARNING: Wolpertingers are known to nest in server racks. ", + ["callout", "<1>"], + ["callout", "<2>"], + "\r\nEnter at your own risk.\r\n", + ["punctuation", "----"] + ]], + + ["callout", "<1>"], + " The label must be uppercase and immediately followed by a colon (", + ["inline", [ + ["punctuation", "`"], + ":", + ["punctuation", "`"] + ]], + ").\r\n", + + ["callout", "<2>"], + " Separate the first line of the paragraph from the label by a single space.\r\n\r\n", + + ["title", [ + ["punctuation", "."], + "Result: Admonition paragraph" + ]], + ["other-block", [ + ["punctuation", "===="], + ["admonition", "WARNING:"], + " Wolpertingers are known to nest in server racks.\r\nEnter at your own risk.\r\n", + ["punctuation", "===="] + ]], + + "\r\n\r\nAn admonition paragraph is rendered in a callout box with the admonition label--or its corresponding icon--in the gutter.\r\nIcons are enabled by setting the ", + ["inline", [ + ["punctuation", "`"], + "icons", + ["punctuation", "`"] + ]], + " attribute on the document.\r\n\r\n", + + ["admonition", "NOTE:"], + " Admonitions can also encapsulate any block content, which we'll cover later.\r\n\r\n", + + ["title", [ + ["punctuation", "==="], + " Mild punctuation, strong impact" + ]], + + "\r\n\r\nJust as we emphasize certain words and phrases when we speak, we can emphasize them in text by surrounding them with punctuation.\r\nAsciiDoc refers to this markup as ", + ["inline", [ + ["italic", [ + ["punctuation", "_"], + "quoted text", + ["punctuation", "_"] + ]] + ]], + ".\r\n\r\n", + + ["title", [ + ["punctuation", "===="], + " Quoted text" + ]], + + "\r\n\r\nFor instance, in an e-mail, you might \"", + ["inline", [ + ["punctuation", "`"], + "speak", + ["punctuation", "`"] + ]], + "\" a word louder by enclosing it in asterisks.\r\n\r\n", + + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", "]"] + ]], + + "\r\nI can't believe it, we ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "won", + ["punctuation", "*"] + ]] + ]], + "!\r\n\r\nAs you would expect, the asterisks make the text ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "won", + ["punctuation", "*"] + ]] + ]], + " bold.\r\nYou can almost sense the emotion.\r\nThis is one example of quoted (i.e., formatted) text.\r\n\r\n", + + ["admonition", "NOTE:"], + " The term \"", + ["inline", [ + ["punctuation", "`"], + "quote", + ["punctuation", "`"] + ]], + "\" is used liberally here to apply to any symbols that surround text in order to apply emphasis or special meaning.\r\n\r\nHere are the forms of quoted text that AsciiDoc recognizes:\r\n\r\n", + + ["title", [ + ["punctuation", "."], + "Bold, italic, and monospace formatting syntax" + ]], + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", "]"] + ]], + ["literal-block", [ + ["punctuation", "----"], + "\r\nbold *constrained* & **un**constrained\r\n\r\nitalic _constrained_ & __un__constrained\r\n\r\nbold italic *_constrained_* & **__un__**constrained\r\n\r\nmonospace `constrained` & ``un``constrained\r\n\r\nmonospace bold `*constrained*` & ``**un**``constrained\r\n\r\nmonospace italic `_constrained_` & ``__un__``constrained\r\n\r\nmonospace bold italic `*_constrained_*` & ``**__un__**``constrained\r\n", + ["punctuation", "----"] + ]], + + "\r\n\r\nWhen you want to quote text (e.g., place emphasis) somewhere other than at the boundaries of a word, you need to double up the punctuation.\r\n\r\n", + + ["title", [ + ["punctuation", "."], + "Result: Bold, italic, and monospace text" + ]], + + ["other-block", [ + ["punctuation", "===="], + + "\r\nbold ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "constrained", + ["punctuation", "*"] + ]] + ]], + " & ", + ["inline", [ + ["bold", [ + ["punctuation", "**"], + "un", + ["punctuation", "**"] + ]] + ]], + "constrained\r\n\r\nitalic ", + ["inline", [ + ["italic", [ + ["punctuation", "_"], + "constrained", + ["punctuation", "_"] + ]] + ]], + " & ", + ["inline", [ + ["italic", [ + ["punctuation", "__"], + "un", + ["punctuation", "__"] + ]] + ]], + "constrained\r\n\r\nbold italic ", + ["inline", [ + ["bold", [ + ["punctuation", "*"], + "_constrained_", + ["punctuation", "*"] + ]] + ]], + " & ", + ["inline", [ + ["bold", [ + ["punctuation", "**"], + "__un__", + ["punctuation", "**"] + ]] + ]], + "constrained\r\n\r\nmonospace ", + ["inline", [ + ["punctuation", "`"], + "constrained", + ["punctuation", "`"] + ]], + " & `", + ["inline", [ + ["punctuation", "`"], + "un", + ["punctuation", "`"] + ]], + ["inline", [ + ["punctuation", "`"], + "constrained\r\n\r\nmonospace bold `*constrained*", + ["punctuation", "`"] + ]], + " & `", + ["inline", [ + ["punctuation", "`"], + "**un**", + ["punctuation", "`"] + ]], + ["inline", [ + ["punctuation", "`"], + "constrained\r\n\r\nmonospace italic `_constrained_", + ["punctuation", "`"] + ]], + " & `", + ["inline", [ + ["punctuation", "`"], + "__un__", + ["punctuation", "`"] + ]], + ["inline", [ + ["punctuation", "`"], + "constrained\r\n\r\nmonospace bold italic `*_constrained_*", + ["punctuation", "`"] + ]], + " & `", + ["inline", [ + ["punctuation", "`"], + "**__un__**", + ["punctuation", "`"] + ]], + "`constrained\r\n", + + ["punctuation", "===="] + ]], + + "\r\n\r\nAny quoted text can be prefixed with an attribute list.\r\nThe first positional attribute is treated as a role.\r\nThe role can be used to apply custom styling to the text.\r\nFor instance:\r\n\r\n", + + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", "]"] + ]], + + "\r\nType the word ", + ["inline", [ + ["attributes", [ + ["punctuation", "["], + ["attr-value", ".userinput"], + ["punctuation", "]"] + ]], + ["punctuation", "#"], + "asciidoc", + ["punctuation", "#"] + ]], + " into the search bar.\r\n\r\nWhen converting to HTML, the word \"", + ["inline", [ + ["punctuation", "`"], + "asciidoc", + ["punctuation", "`"] + ]], + "\" is wrapped in ", + ["inline", [ + ["punctuation", "`"], + "", + ["punctuation", "`"] + ]], + " tags and the role is used as the element's CSS class:\r\n\r\n", + + ["attributes", [ + ["punctuation", "["], + ["attr-value", "source"], + ["punctuation", ","], + ["attr-value", "xml"], + ["punctuation", "]"] + ]], + "\r\nasciidoc\r\n\r\nYou can apply styles to the text using CSS.\r\n\r\nYou may not always want these substitutions to take place.\r\nIn those cases, you'll need to use markup to escape the text." +] diff --git a/tests/languages/bash/function_feature.test b/tests/languages/bash/function_feature.test index 16471489b6..3243942d99 100644 --- a/tests/languages/bash/function_feature.test +++ b/tests/languages/bash/function_feature.test @@ -93,6 +93,7 @@ ifup import install ip +java jobs join kill @@ -198,6 +199,7 @@ sum suspend swapon sync +sysctl tac tail tar @@ -283,7 +285,7 @@ zypper ["function", "host"], ["function", "hostname"], ["function", "htop"], ["function", "iconv"], ["function", "id"], ["function", "ifconfig"], ["function", "ifdown"], ["function", "ifup"], ["function", "import"], - ["function", "install"], ["function", "ip"], ["function", "jobs"], + ["function", "install"], ["function", "ip"], ["function", "java"], ["function", "jobs"], ["function", "join"], ["function", "kill"], ["function", "killall"], ["function", "less"], ["function", "link"], ["function", "ln"], ["function", "locate"], ["function", "logname"], ["function", "logrotate"], @@ -317,7 +319,7 @@ zypper ["function", "slocate"], ["function", "sort"], ["function", "split"], ["function", "ssh"], ["function", "stat"], ["function", "strace"], ["function", "su"], ["function", "sudo"], ["function", "sum"], ["function", - "suspend"], ["function", "swapon"], ["function", "sync"], ["function", + "suspend"], ["function", "swapon"], ["function", "sync"], ["function", "sysctl"], ["function", "tac"], ["function", "tail"], ["function", "tar"], ["function", "tee"], ["function", "time"], ["function", "timeout"], ["function", "top"], ["function", "touch"], ["function", "tr"], ["function", "traceroute"], diff --git a/tests/languages/bash/parameter_feature.test b/tests/languages/bash/parameter_feature.test new file mode 100644 index 0000000000..000a040703 --- /dev/null +++ b/tests/languages/bash/parameter_feature.test @@ -0,0 +1,40 @@ +docker run +--name elk \ +-p 5601:5601 \ +--restart=always \ +--privileged \ +-dit \ +easyj/elk:7.12.1 + +---------------------------------------------------- + +[ + ["function", "docker"], + " run\r\n", + + ["parameter", "--name"], + " elk ", + ["punctuation", "\\"], + + ["parameter", "-p"], + ["number", "5601"], + ":5601 ", + ["punctuation", "\\"], + + ["parameter", "--restart"], + ["operator", ["="]], + "always ", + ["punctuation", "\\"], + + ["parameter", "--privileged"], + ["punctuation", "\\"], + + ["parameter", "-dit"], + ["punctuation", "\\"], + + "\r\neasyj/elk:7.12.1" +] + +---------------------------------------------------- + +Checks for variable assignments. diff --git a/tests/languages/bbj/boolean_feature.test b/tests/languages/bbj/boolean_feature.test new file mode 100644 index 0000000000..f5c2ca0a43 --- /dev/null +++ b/tests/languages/bbj/boolean_feature.test @@ -0,0 +1,13 @@ +BBjAPI.FALSE +BBjAPI.TRUE + +---------------------------------------------------- + +[ + ["boolean", "BBjAPI.FALSE"], + ["boolean", "BBjAPI.TRUE"] +] + +---------------------------------------------------- + +Checks for booleans. diff --git a/tests/languages/bbj/comment_feature.test b/tests/languages/bbj/comment_feature.test new file mode 100644 index 0000000000..a8dfffe08f --- /dev/null +++ b/tests/languages/bbj/comment_feature.test @@ -0,0 +1,25 @@ +rem Single line comment + +rem /** +rem * This file is part of the X plugin. +rem * +rem * For the full copyright and license information, please view the LICENSE +rem * file that was distributed with this source code. +rem */ + +---------------------------------------------------- + +[ + ["comment", "rem Single line comment"], + + ["comment", "rem /**"], + ["comment", "rem * This file is part of the X plugin."], + ["comment", "rem *"], + ["comment", "rem * For the full copyright and license information, please view the LICENSE"], + ["comment", "rem * file that was distributed with this source code."], + ["comment", "rem */"] +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/bbj/keyword_feature.test b/tests/languages/bbj/keyword_feature.test new file mode 100644 index 0000000000..4948ebd873 --- /dev/null +++ b/tests/languages/bbj/keyword_feature.test @@ -0,0 +1,98 @@ +abstract all argc begin bye callback case chn class classend ctl day delete dim dom +dread dsz else end endif err exitto extends fi field for from gosub goto if implements +interface interfaceend iol iolist let list load method methodend methodret on opts pfx +print private process_events protected psz public read read_resource release remove_callback +repeat restore return rev seterr setesc sqlchn sqlunt ssn start static swend switch sys then +tim unt until use void wend where while declare + +---------------------------------------------------- + +[ + ["keyword", "abstract"], + ["keyword", "all"], + ["keyword", "argc"], + ["keyword", "begin"], + ["keyword", "bye"], + ["keyword", "callback"], + ["keyword", "case"], + ["keyword", "chn"], + ["keyword", "class"], + ["keyword", "classend"], + ["keyword", "ctl"], + ["keyword", "day"], + ["keyword", "delete"], + ["keyword", "dim"], + ["keyword", "dom"], + + ["keyword", "dread"], + ["keyword", "dsz"], + ["keyword", "else"], + ["keyword", "end"], + ["keyword", "endif"], + ["keyword", "err"], + ["keyword", "exitto"], + ["keyword", "extends"], + ["keyword", "fi"], + ["keyword", "field"], + ["keyword", "for"], + ["keyword", "from"], + ["keyword", "gosub"], + ["keyword", "goto"], + ["keyword", "if"], + ["keyword", "implements"], + + ["keyword", "interface"], + ["keyword", "interfaceend"], + ["keyword", "iol"], + ["keyword", "iolist"], + ["keyword", "let"], + ["keyword", "list"], + ["keyword", "load"], + ["keyword", "method"], + ["keyword", "methodend"], + ["keyword", "methodret"], + ["keyword", "on"], + ["keyword", "opts"], + ["keyword", "pfx"], + + ["keyword", "print"], + ["keyword", "private"], + ["keyword", "process_events"], + ["keyword", "protected"], + ["keyword", "psz"], + ["keyword", "public"], + ["keyword", "read"], + ["keyword", "read_resource"], + ["keyword", "release"], + ["keyword", "remove_callback"], + + ["keyword", "repeat"], + ["keyword", "restore"], + ["keyword", "return"], + ["keyword", "rev"], + ["keyword", "seterr"], + ["keyword", "setesc"], + ["keyword", "sqlchn"], + ["keyword", "sqlunt"], + ["keyword", "ssn"], + ["keyword", "start"], + ["keyword", "static"], + ["keyword", "swend"], + ["keyword", "switch"], + ["keyword", "sys"], + ["keyword", "then"], + + ["keyword", "tim"], + ["keyword", "unt"], + ["keyword", "until"], + ["keyword", "use"], + ["keyword", "void"], + ["keyword", "wend"], + ["keyword", "where"], + ["keyword", "while"], + ["keyword", "declare"] +] + +---------------------------------------------------- + +Checks for keywords. diff --git a/tests/languages/bbj/number_feature.test b/tests/languages/bbj/number_feature.test new file mode 100644 index 0000000000..fea76d1298 --- /dev/null +++ b/tests/languages/bbj/number_feature.test @@ -0,0 +1,19 @@ +42 +3.14159 +2e8 +3.4E-9 +0.7E+12 + +---------------------------------------------------- + +[ + ["number", "42"], + ["number", "3.14159"], + ["number", "2e8"], + ["number", "3.4E-9"], + ["number", "0.7E+12"] +] + +---------------------------------------------------- + +Checks for numbers. \ No newline at end of file diff --git a/tests/languages/bbj/operator_feature.test b/tests/languages/bbj/operator_feature.test new file mode 100644 index 0000000000..431968232a --- /dev/null +++ b/tests/languages/bbj/operator_feature.test @@ -0,0 +1,21 @@ +or xor not and > >= < <= + =* + +---------------------------------------------------- + +[ + ["operator", "or"], + ["operator", "xor"], + ["operator", "not"], + ["operator", "and"], + ["operator", ">"], + ["operator", ">="], + ["operator", "<"], + ["operator", "<="], + ["operator", "+"], + ["operator", "="], + ["operator", "*"] +] + +---------------------------------------------------- + +Checks for operators. diff --git a/tests/languages/bbj/punctuation_feature.test b/tests/languages/bbj/punctuation_feature.test new file mode 100644 index 0000000000..d55efe932e --- /dev/null +++ b/tests/languages/bbj/punctuation_feature.test @@ -0,0 +1,12 @@ +, ; : ( ) . + +---------------------------------------------------- + +[ + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "."] +] diff --git a/tests/languages/bbj/string_feature.test b/tests/languages/bbj/string_feature.test new file mode 100644 index 0000000000..1d635e704f --- /dev/null +++ b/tests/languages/bbj/string_feature.test @@ -0,0 +1,27 @@ +"" +'' +"f\"oo" +'b\'ar' + +"foo rem comment bar" +"foo ""rem"" comment bar" +"foo rem /* *rem comment bar" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "''"], + ["string", "\"f\\\"oo\""], + ["string", "'b\\'ar'"], + + ["string", "\"foo rem comment bar\""], + ["string", "\"foo \""], + ["string", "\"rem\""], + ["string", "\" comment bar\""], + ["string", "\"foo rem /* *rem comment bar\""] +] + +---------------------------------------------------- + +Checks for strings. diff --git a/tests/languages/css!+css-extras/color_feature.test b/tests/languages/css!+css-extras/color_feature.test index 261b6690e0..0c76970bd4 100644 --- a/tests/languages/css!+css-extras/color_feature.test +++ b/tests/languages/css!+css-extras/color_feature.test @@ -111,6 +111,7 @@ Pink Plum PowderBlue Purple +RebeccaPurple Red RosyBrown RoyalBlue @@ -261,6 +262,7 @@ hsla(120,100%,50%,0.3) ["color", "Plum"], ["color", "PowderBlue"], ["color", "Purple"], + ["color", "RebeccaPurple"], ["color", "Red"], ["color", "RosyBrown"], ["color", "RoyalBlue"], diff --git a/tests/languages/css/atrule_feature.test b/tests/languages/css/atrule_feature.test index adb84ab093..d5ca5d2c1e 100644 --- a/tests/languages/css/atrule_feature.test +++ b/tests/languages/css/atrule_feature.test @@ -4,6 +4,7 @@ @supports (top: 50vmax) or (top: 50vw) {} @main-color: red; +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); ---------------------------------------------------- @@ -18,12 +19,14 @@ ]], ["punctuation", ";"] ]], + ["atrule", [ ["rule", "@media"], " print" ]], ["punctuation", "{"], ["punctuation", "}"], + ["atrule", [ ["rule", "@media"], ["punctuation", "("], @@ -40,6 +43,7 @@ ]], ["punctuation", "{"], ["punctuation", "}"], + ["atrule", [ ["rule", "@supports"], ["punctuation", "("], @@ -47,6 +51,7 @@ ["punctuation", ":"], " 50vmax", ["punctuation", ")"], + ["keyword", "or"], ["punctuation", "("], ["property", "top"], @@ -56,11 +61,23 @@ ]], ["punctuation", "{"], ["punctuation", "}"], + ["atrule", [ ["rule", "@main-color"], ["punctuation", ":"], " red", ["punctuation", ";"] + ]], + + ["atrule", [ + ["rule", "@import"], + ["url", [ + ["function", "url"], + ["punctuation", "("], + ["string", "'https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'"], + ["punctuation", ")"] + ]], + ["punctuation", ";"] ]] ] diff --git a/tests/languages/gradle/annotation_feature.test b/tests/languages/gradle/annotation_feature.test new file mode 100644 index 0000000000..3957bcff8d --- /dev/null +++ b/tests/languages/gradle/annotation_feature.test @@ -0,0 +1,17 @@ +@BaseScript MyBaseClass baseScript +@DelegatesTo(EmailSpec) + +---------------------------------------------------- + +[ + ["annotation", "@BaseScript"], + " MyBaseClass baseScript\r\n", + ["annotation", "@DelegatesTo"], + ["punctuation", "("], + "EmailSpec", + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks for annotations. \ No newline at end of file diff --git a/tests/languages/gradle/keyword_feature.test b/tests/languages/gradle/keyword_feature.test new file mode 100644 index 0000000000..9366abcdf0 --- /dev/null +++ b/tests/languages/gradle/keyword_feature.test @@ -0,0 +1,30 @@ +implementation +val tasks dependencies project plugin plugins +repository repositories apply def sourceSets import +if else +---------------------------------------------------- + +[ + ["keyword", "implementation"], + + ["keyword", "val"], + ["keyword", "tasks"], + ["keyword", "dependencies"], + ["keyword", "project"], + ["keyword", "plugin"], + ["keyword", "plugins"], + + ["keyword", "repository"], + ["keyword", "repositories"], + ["keyword", "apply"], + ["keyword", "def"], + ["keyword", "sourceSets"], + ["keyword", "import"], + + ["keyword", "if"], + ["keyword", "else"] +] + +---------------------------------------------------- + +Checks for all keywords. diff --git a/tests/languages/gradle/number_feature.test b/tests/languages/gradle/number_feature.test new file mode 100644 index 0000000000..e5f880aac9 --- /dev/null +++ b/tests/languages/gradle/number_feature.test @@ -0,0 +1,43 @@ +0b0110 +0b0110_1111_0000 +0b01G 0b01L 0b01I +0b01D 0b01F + +0xBABE +0xBad_Face +0x1.8p1 +0xa.fp-2 + +42_000 +3.14_15_9 +1.2e3 +3E+1 +4E-2 +42g 42l 42i +42d 42f + +---------------------------------------------------- + +[ + ["number", "0b0110"], + ["number", "0b0110_1111_0000"], + ["number", "0b01G"], ["number", "0b01L"], ["number", "0b01I"], + ["number", "0b01D"], ["number", "0b01F"], + + ["number", "0xBABE"], + ["number", "0xBad_Face"], + ["number", "0x1.8p1"], + ["number", "0xa.fp-2"], + + ["number", "42_000"], + ["number", "3.14_15_9"], + ["number", "1.2e3"], + ["number", "3E+1"], + ["number", "4E-2"], + ["number", "42g"], ["number", "42l"], ["number", "42i"], + ["number", "42d"], ["number", "42f"] +] + +---------------------------------------------------- + +Checks for binary, hexadecimal and decimal numbers. \ No newline at end of file diff --git a/tests/languages/gradle/operator_feature.test b/tests/languages/gradle/operator_feature.test new file mode 100644 index 0000000000..be0bd53316 --- /dev/null +++ b/tests/languages/gradle/operator_feature.test @@ -0,0 +1,45 @@ +~ += == =~ ==~ +? ?. ?: +* ** *. *= **= +.@ .& +5..8 +5..<8 +- -- -= -> ++ ++ += +! != +< << <<= <= <=> +> >> >>> >>= >>>= >= +& && &= +| || |= +/ +/= +^ ^= +% %= + +---------------------------------------------------- + +[ + ["operator", "~"], + ["operator", "="], ["operator", "=="], ["operator", "=~"], ["operator", "==~"], + ["operator", "?"], ["operator", "?."], ["operator", "?:"], + ["operator", "*"], ["operator", "**"], ["operator", "*."], ["operator", "*="], ["operator", "**="], + ["operator", ".@"], ["operator", ".&"], + ["number", "5"], ["operator", ".."], ["number", "8"], + ["number", "5"], ["operator", "..<"], ["number", "8"], + ["operator", "-"], ["operator", "--"], ["operator", "-="], ["operator", "->"], + ["operator", "+"], ["operator", "++"], ["operator", "+="], + ["operator", "!"], ["operator", "!="], + ["operator", "<"], ["operator", "<<"], ["operator", "<<="], ["operator", "<="], ["operator", "<=>"], + ["operator", ">"], ["operator", ">>"], ["operator", ">>>"], ["operator", ">>="], ["operator", ">>>="], ["operator", ">="], + ["operator", "&"], ["operator", "&&"], ["operator", "&="], + ["operator", "|"], ["operator", "||"], ["operator", "|="], + ["operator", "/"], + ["operator", "/="], + ["operator", "^"], ["operator", "^="], + ["operator", "%"], ["operator", "%="] +] + +---------------------------------------------------- + +Checks for all operators. diff --git a/tests/languages/gradle/shebang_feature.test b/tests/languages/gradle/shebang_feature.test new file mode 100644 index 0000000000..4e72445898 --- /dev/null +++ b/tests/languages/gradle/shebang_feature.test @@ -0,0 +1,13 @@ +#!foobar +#!/usr/bin/env groovy + +---------------------------------------------------- + +[ + ["shebang", "#!foobar"], + ["shebang", "#!/usr/bin/env groovy"] +] + +---------------------------------------------------- + +Check for shebang comments. \ No newline at end of file diff --git a/tests/languages/gradle/spock-block_feature.test b/tests/languages/gradle/spock-block_feature.test new file mode 100644 index 0000000000..1808e94d2b --- /dev/null +++ b/tests/languages/gradle/spock-block_feature.test @@ -0,0 +1,25 @@ +setup: +given: +when: +then: +and: +cleanup: +expect: +where: + +---------------------------------------------------- + +[ + ["spock-block", "setup:"], + ["spock-block", "given:"], + ["spock-block", "when:"], + ["spock-block", "then:"], + ["spock-block", "and:"], + ["spock-block", "cleanup:"], + ["spock-block", "expect:"], + ["spock-block", "where:"] +] + +---------------------------------------------------- + +Checks for all spock blocks. \ No newline at end of file diff --git a/tests/languages/gradle/string-interpolation_feature.html.test b/tests/languages/gradle/string-interpolation_feature.html.test new file mode 100644 index 0000000000..17c502bd9e --- /dev/null +++ b/tests/languages/gradle/string-interpolation_feature.html.test @@ -0,0 +1,129 @@ +// Double quoted: interpolation +"$foo" +"${42}" + +// Triple double quoted: interpolation +"""$foo""" +"""${42}""" + +// Slashy string: interpolation +/$foo/ +/${42}/ + +// Dollar slashy string: interpolation +$/$foo/$ +$/${42}/$ + +// Double quoted: no interpolation (escaped) +"\$foo \${42}" + +// Triple double quoted: no interpolation (escaped) +"""\$foo \${42}""" + +// Slashy string: no interpolation (escaped) +/\$foo \${42}/ + +// Dollar slashy string: no interpolation (escaped) +$/$$foo $${42}/$ + +// Single quoted string: no interpolation +'$foo ${42}' + +// Triple single quoted string: no interpolation +'''$foo ${42}''' + +---------------------------------------------------- + +// Double quoted: interpolation + + " + + $ + foo + + " + + + " + + ${ + 42 + } + + " + + +// Triple double quoted: interpolation + + """ + + $ + foo + + """ + + + """ + + ${ + 42 + } + + """ + + +// Slashy string: interpolation + + / + + $ + foo + + / + + + / + + ${ + 42 + } + + / + + +// Dollar slashy string: interpolation + + $/ + + $ + foo + + /$ + + + $/ + + ${ + 42 + } + + /$ + + +// Double quoted: no interpolation (escaped) +"\$foo \${42}" + +// Triple double quoted: no interpolation (escaped) +"""\$foo \${42}""" + +// Slashy string: no interpolation (escaped) +/\$foo \${42}/ + +// Dollar slashy string: no interpolation (escaped) +$/$$foo $${42}/$ + +// Single quoted string: no interpolation +'$foo ${42}' + +// Triple single quoted string: no interpolation +'''$foo ${42}''' diff --git a/tests/languages/gradle/string_feature.test b/tests/languages/gradle/string_feature.test new file mode 100644 index 0000000000..7893dc658a --- /dev/null +++ b/tests/languages/gradle/string_feature.test @@ -0,0 +1,94 @@ +"""""" +"""foo""" +"""foo +bar""" + +'''''' +'''foo''' +'''foo +bar''' + +"" +"fo\"o" +'' +'fo\'o' + +/foo/ +/fo\/o/ + +$/fo$/$o/$ +$/foo +bar/$ +"foo /* comment */ bar" +'foo // bar' +'''foo +/* comment */ +bar''' +'''hell\'''o''' +"""foo +// comment +bar""" +"""hell\"""o""" + +---------------------------------------------------- + +[ + ["interpolation-string", [ + ["string", "\"\"\"\"\"\""] + ]], + ["interpolation-string", [ + ["string", "\"\"\"foo\"\"\""] + ]], + ["interpolation-string", [ + ["string", "\"\"\"foo\r\nbar\"\"\""] + ]], + + ["string", "''''''"], + ["string", "'''foo'''"], + ["string", "'''foo\r\nbar'''"], + + ["interpolation-string", [ + ["string", "\"\""] + ]], + ["interpolation-string", [ + ["string", "\"fo\\\"o\""] + ]], + ["string", "''"], + ["string", "'fo\\'o'"], + + ["interpolation-string", [ + ["string", "/foo/"] + ]], + ["interpolation-string", [ + ["string", "/fo\\/o/"] + ]], + + ["interpolation-string", [ + ["string", "$/fo$/"], + ["interpolation", [ + ["interpolation-punctuation", "$"], + ["expression", ["o"]] + ]], + ["string", "/$"] + ]], + ["interpolation-string", [ + ["string", "$/foo\r\nbar/$"] + ]], + ["interpolation-string", [ + ["string", "\"foo /* comment */ bar\""] + ]], + ["string", "'foo // bar'"], + ["string", "'''foo\r\n/* comment */\r\nbar'''"], + ["string", "'''hell\\'''o'''"], + ["interpolation-string", [ + ["string", "\"\"\"foo\r\n// comment\r\nbar\"\"\""] + ]], + ["interpolation-string", [ + ["string", "\"\"\"hell\\\"\"\"o\"\"\""] + ]] +] + +---------------------------------------------------- + +Checks for single quoted, triple single quoted, double quoted, +triple double quoted, slashy and dollar slashy strings. diff --git a/tests/languages/hoon/strings_with_escapes.test b/tests/languages/hoon/strings_with_escapes.test new file mode 100644 index 0000000000..5691f4f333 --- /dev/null +++ b/tests/languages/hoon/strings_with_escapes.test @@ -0,0 +1,7 @@ +"blah\"blah" + +---------------------------------------------------- + +[ + ["string", "\"blah\\\"blah\""] +] diff --git a/tests/languages/java/annotation_feature.test b/tests/languages/java/annotation_feature.test index 3c645542c8..cc8a6a4ca1 100644 --- a/tests/languages/java/annotation_feature.test +++ b/tests/languages/java/annotation_feature.test @@ -16,7 +16,7 @@ ["punctuation", "("], "value", ["operator", "="], - "SOURCE", + ["constant", "SOURCE"], ["punctuation", ")"], ["annotation", "@Target"], @@ -24,9 +24,9 @@ "value", ["operator", "="], ["punctuation", "{"], - "PACKAGE", + ["constant", "PACKAGE"], ["punctuation", ","], - "TYPE", + ["constant", "TYPE"], ["punctuation", "}"], ["punctuation", ")"] ] diff --git a/tests/languages/java/constant_feature.test b/tests/languages/java/constant_feature.test new file mode 100644 index 0000000000..34fbdd6516 --- /dev/null +++ b/tests/languages/java/constant_feature.test @@ -0,0 +1,61 @@ +public class Test { + private static final String AAAA = "aaaaaa"; + + private String str = "1"; + + public static void main(String[] args) { + str += AAAA + "AAAA"; + } +} + +---------------------------------------------------- + +[ + ["keyword", "public"], + ["keyword", "class"], + ["class-name", ["Test"]], + ["punctuation", "{"], + + ["keyword", "private"], + ["keyword", "static"], + ["keyword", "final"], + ["class-name", ["String"]], + ["constant", "AAAA"], + ["operator", "="], + ["string", "\"aaaaaa\""], + ["punctuation", ";"], + + ["keyword", "private"], + ["class-name", ["String"]], + " str ", + ["operator", "="], + ["string", "\"1\""], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "static"], + ["keyword", "void"], + ["function", "main"], + ["punctuation", "("], + ["class-name", ["String"]], + ["punctuation", "["], + ["punctuation", "]"], + " args", + ["punctuation", ")"], + ["punctuation", "{"], + + "\r\n str ", + ["operator", "+="], + ["constant", "AAAA"], + ["operator", "+"], + ["string", "\"AAAA\""], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for all constants. diff --git a/tests/languages/markup!+javascript/javascript_inclusion.test b/tests/languages/markup!+javascript/javascript_inclusion.test index ccff9d0e81..eba69b2974 100644 --- a/tests/languages/markup!+javascript/javascript_inclusion.test +++ b/tests/languages/markup!+javascript/javascript_inclusion.test @@ -143,10 +143,7 @@ let foo = ''; ["attr-value", [ ["punctuation", "="], ["punctuation", "\""], - "this.textContent=", - ["punctuation", "'"], - "Over!", - ["punctuation", "'"], + "this.textContent='Over!'", ["punctuation", "\""] ]], ["punctuation", ">"] diff --git a/tests/languages/markup/issue3441.test b/tests/languages/markup/issue3441.test new file mode 100644 index 0000000000..61c101aecd --- /dev/null +++ b/tests/languages/markup/issue3441.test @@ -0,0 +1,27 @@ + + +---------------------------------------------------- + +[ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "google-chart" + ]], + ["attr-name", ["data"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "[[\"Month\", \"Days\"], [\"Jan\", 31]]", + ["punctuation", "'"] + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] +] diff --git a/tests/languages/metafont/boolean_feature.test b/tests/languages/metafont/boolean_feature.test new file mode 100644 index 0000000000..496578fe2f --- /dev/null +++ b/tests/languages/metafont/boolean_feature.test @@ -0,0 +1,12 @@ +true false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] + +---------------------------------------------------- + +Checks for booleans. \ No newline at end of file diff --git a/tests/languages/metafont/command_feature.test b/tests/languages/metafont/command_feature.test new file mode 100644 index 0000000000..c130fef0b4 --- /dev/null +++ b/tests/languages/metafont/command_feature.test @@ -0,0 +1,68 @@ +addto +batchmode +charlist cull +display +errhelp errmessage errorstopmode everyjob extensible +fontdimen +headerbyte +inner interim +let ligtable +message +newinternal nonstopmode numspecial +openwindow outer +randomseed +save scrollmode show showdependencies showstats showtoken showvariable shipout special + +---------------------------------------------------- + +[ + ["command", "addto"], + + ["command", "batchmode"], + + ["command", "charlist"], + ["command", "cull"], + + ["command", "display"], + + ["command", "errhelp"], + ["command", "errmessage"], + ["command", "errorstopmode"], + ["command", "everyjob"], + ["command", "extensible"], + + ["command", "fontdimen"], + + ["command", "headerbyte"], + + ["command", "inner"], + ["command", "interim"], + + ["command", "let"], + ["command", "ligtable"], + + ["command", "message"], + + ["command", "newinternal"], + ["command", "nonstopmode"], + ["command", "numspecial"], + + ["command", "openwindow"], + ["command", "outer"], + + ["command", "randomseed"], + + ["command", "save"], + ["command", "scrollmode"], + ["command", "show"], + ["command", "showdependencies"], + ["command", "showstats"], + ["command", "showtoken"], + ["command", "showvariable"], + ["command", "shipout"], + ["command", "special"] +] + +---------------------------------------------------- + +Checks for commands. \ No newline at end of file diff --git a/tests/languages/metafont/constant_feature.test b/tests/languages/metafont/constant_feature.test new file mode 100644 index 0000000000..9085a2fbf7 --- /dev/null +++ b/tests/languages/metafont/constant_feature.test @@ -0,0 +1,97 @@ +% Length constants +bp cc cm dd in mm pc pt + +% Pair constants +down left origin right up + +% Numeric constants +eps epsilon infinity _ % _ is -1, as per Knuth: "internal constant to make macros unreadable but shorter" + +% Path constants +fullcircle halfcircle quartercircle unitsquare + +% Pen constant +nullpen penrazor penspeck pensquare penstroke + +% Picture constants +blankpicture nullpicture unitpixel + +% String constant +ditto + +% Transform constant +identity + +% Other constants +proof relax smoke \ \\ ??? + +---------------------------------------------------- + +[ + ["comment", "% Length constants"], + + ["constant", "bp"], + ["constant", "cc"], + ["constant", "cm"], + ["constant", "dd"], + ["constant", "in"], + ["constant", "mm"], + ["constant", "pc"], + ["constant", "pt"], + + ["comment", "% Pair constants"], + + ["constant", "down"], + ["constant", "left"], + ["constant", "origin"], + ["constant", "right"], + ["constant", "up"], + + ["comment", "% Numeric constants"], + + ["constant", "eps"], + ["constant", "epsilon"], + ["constant", "infinity"], + ["constant", "_"], + ["comment", "% _ is -1, as per Knuth: \"internal constant to make macros unreadable but shorter\""], + + ["comment", "% Path constants"], + + ["constant", "fullcircle"], + ["constant", "halfcircle"], + ["constant", "quartercircle"], + ["constant", "unitsquare"], + + ["comment", "% Pen constant"], + + ["constant", "nullpen"], + ["constant", "penrazor"], + ["constant", "penspeck"], + ["constant", "pensquare"], + ["constant", "penstroke"], + + ["comment", "% Picture constants"], + + ["constant", "blankpicture"], + ["constant", "nullpicture"], + ["constant", "unitpixel"], + + ["comment", "% String constant"], + ["constant", "ditto"], + + ["comment", "% Transform constant"], + ["constant", "identity"], + + ["comment", "% Other constants"], + + ["constant", "proof"], + ["constant", "relax"], + ["constant", "smoke"], + ["constant", "\\"], + ["constant", "\\\\"], + ["constant", "???"] +] + +---------------------------------------------------- + +Checks for constants best not to be redefined. \ No newline at end of file diff --git a/tests/languages/metafont/internal_quantity_feature.test b/tests/languages/metafont/internal_quantity_feature.test new file mode 100644 index 0000000000..301ab8cd1c --- /dev/null +++ b/tests/languages/metafont/internal_quantity_feature.test @@ -0,0 +1,96 @@ +autorounding +boundarychar +charcode chardp chardx chardy charext charht charic charwd +day designsize +fillin fontmaking +granularity +hppp +month +pausing proofing +showstopping smoothing +time tracingcapsules tracingchoices tracingcommands tracingedges tracingequations tracingmacros tracingonline tracingoutput tracingpens tracingrestores tracingspecs tracingstats tracingtitles turningcheck +vppp +warningcheck +xoffset +year yoffset + +% From PlainMETAFONT +blacker currentwindow displaying join_radius o_correction pen_bot pen_lft pen_rt pen_top pixels_per_inch tolerance + +---------------------------------------------------- + +[ + ["quantity", "autorounding"], + + ["quantity", "boundarychar"], + + ["quantity", "charcode"], + ["quantity", "chardp"], + ["quantity", "chardx"], + ["quantity", "chardy"], + ["quantity", "charext"], + ["quantity", "charht"], + ["quantity", "charic"], + ["quantity", "charwd"], + + ["quantity", "day"], + ["quantity", "designsize"], + + ["quantity", "fillin"], + ["quantity", "fontmaking"], + + ["quantity", "granularity"], + + ["quantity", "hppp"], + + ["quantity", "month"], + + ["quantity", "pausing"], + ["quantity", "proofing"], + + ["quantity", "showstopping"], + ["quantity", "smoothing"], + + ["quantity", "time"], + ["quantity", "tracingcapsules"], + ["quantity", "tracingchoices"], + ["quantity", "tracingcommands"], + ["quantity", "tracingedges"], + ["quantity", "tracingequations"], + ["quantity", "tracingmacros"], + ["quantity", "tracingonline"], + ["quantity", "tracingoutput"], + ["quantity", "tracingpens"], + ["quantity", "tracingrestores"], + ["quantity", "tracingspecs"], + ["quantity", "tracingstats"], + ["quantity", "tracingtitles"], + ["quantity", "turningcheck"], + + ["quantity", "vppp"], + + ["quantity", "warningcheck"], + + ["quantity", "xoffset"], + + ["quantity", "year"], + ["quantity", "yoffset"], + + ["comment", "% From PlainMETAFONT"], + + ["quantity", "blacker"], + ["quantity", "currentwindow"], + ["quantity", "displaying"], + ["quantity", "join_radius"], + ["quantity", "o_correction"], + ["quantity", "pen_bot"], + ["quantity", "pen_lft"], + ["quantity", "pen_rt"], + ["quantity", "pen_top"], + ["quantity", "pixels_per_inch"], + ["quantity", "tolerance"] +] + +---------------------------------------------------- + +Checks for internal quantities. \ No newline at end of file diff --git a/tests/languages/metafont/keywords_feature.test b/tests/languages/metafont/keywords_feature.test new file mode 100644 index 0000000000..11e33b2f10 --- /dev/null +++ b/tests/languages/metafont/keywords_feature.test @@ -0,0 +1,104 @@ +also at atleast +begingroup +charexists contour controls curl cycle +def delimiters doublepath dropping dump +else elseif end enddef endfor endgroup endinput exitif exitunless expandafter +fi for forever forsuffixes from +if input inwindow +keeping kern +of +primarydef +quote +readstring +scaled scantokens secondarydef shifted skipto slanted step +tension tertiarydef to transformed +until +vardef +withpen withweight +xscaled +yscaled +zscaled + +---------------------------------------------------- + +[ + ["keyword", "also"], + ["keyword", "at"], + ["keyword", "atleast"], + + ["keyword", "begingroup"], + + ["keyword", "charexists"], + ["keyword", "contour"], + ["keyword", "controls"], + ["keyword", "curl"], + ["keyword", "cycle"], + + ["keyword", "def"], + ["keyword", "delimiters"], + ["keyword", "doublepath"], + ["keyword", "dropping"], + ["keyword", "dump"], + + ["keyword", "else"], + ["keyword", "elseif"], + ["keyword", "end"], + ["keyword", "enddef"], + ["keyword", "endfor"], + ["keyword", "endgroup"], + ["keyword", "endinput"], + ["keyword", "exitif"], + ["keyword", "exitunless"], + ["keyword", "expandafter"], + + ["keyword", "fi"], + ["keyword", "for"], + ["keyword", "forever"], + ["keyword", "forsuffixes"], + ["keyword", "from"], + + ["keyword", "if"], + ["keyword", "input"], + ["keyword", "inwindow"], + + ["keyword", "keeping"], + ["keyword", "kern"], + + ["keyword", "of"], + + ["keyword", "primarydef"], + + ["keyword", "quote"], + + ["keyword", "readstring"], + + ["keyword", "scaled"], + ["keyword", "scantokens"], + ["keyword", "secondarydef"], + ["keyword", "shifted"], + ["keyword", "skipto"], + ["keyword", "slanted"], + ["keyword", "step"], + + ["keyword", "tension"], + ["keyword", "tertiarydef"], + ["keyword", "to"], + ["keyword", "transformed"], + + ["keyword", "until"], + + ["keyword", "vardef"], + + ["keyword", "withpen"], + ["keyword", "withweight"], + + ["keyword", "xscaled"], + + ["keyword", "yscaled"], + + ["keyword", "zscaled"] +] + +---------------------------------------------------- + +Checks for keywords. \ No newline at end of file diff --git a/tests/languages/metafont/macro_feature.test b/tests/languages/metafont/macro_feature.test new file mode 100644 index 0000000000..6953e77a37 --- /dev/null +++ b/tests/languages/metafont/macro_feature.test @@ -0,0 +1,30 @@ +beginchar cullit decr define_pixels div draw downto endchar fill flex incr max min mod mode_setup penlabels penpos shipit showit upto + +---------------------------------------------------- + +[ + ["macro", "beginchar"], + ["macro", "cullit"], + ["macro", "decr"], + ["macro", "define_pixels"], + ["macro", "div"], + ["macro", "draw"], + ["macro", "downto"], + ["macro", "endchar"], + ["macro", "fill"], + ["macro", "flex"], + ["macro", "incr"], + ["macro", "max"], + ["macro", "min"], + ["macro", "mod"], + ["macro", "mode_setup"], + ["macro", "penlabels"], + ["macro", "penpos"], + ["macro", "shipit"], + ["macro", "showit"], + ["macro", "upto"] +] + +---------------------------------------------------- + +Checks for a few important macros. \ No newline at end of file diff --git a/tests/languages/metafont/number_feature.test b/tests/languages/metafont/number_feature.test new file mode 100644 index 0000000000..c9fbb0d971 --- /dev/null +++ b/tests/languages/metafont/number_feature.test @@ -0,0 +1,15 @@ +42 +3.14 +.34 + +---------------------------------------------------- + +[ + ["number", "42"], + ["number", "3.14"], + ["number", ".34"] +] + +---------------------------------------------------- + +Checks for numbers. \ No newline at end of file diff --git a/tests/languages/metafont/operator_feature.test b/tests/languages/metafont/operator_feature.test new file mode 100644 index 0000000000..05986efff4 --- /dev/null +++ b/tests/languages/metafont/operator_feature.test @@ -0,0 +1,83 @@ +: := + +% Boolean operators +and or not <> + +% Numeric operators +< <= >= > = <> +* ** / + - ++ +-+ + +% Path operators +& .. ... -- --- + +% String operators +& < <= >= > = <> + +% Ligature operators +=: :: |=: |=:> =:| =:|> |=:| |=:|> |=:|>> ||: + +---------------------------------------------------- + +[ + ["operator", ":"], + ["operator", ":="], + + ["comment", "% Boolean operators"], + + ["operator", "and"], + ["operator", "or"], + ["operator", "not"], + ["operator", "<>"], + + ["comment", "% Numeric operators"], + + ["operator", "<"], + ["operator", "<="], + ["operator", ">="], + ["operator", ">"], + ["operator", "="], + ["operator", "<>"], + + ["operator", "*"], + ["operator", "**"], + ["operator", "/"], + ["operator", "+"], + ["operator", "-"], + ["operator", "++"], + ["operator", "+-+"], + + ["comment", "% Path operators"], + + ["operator", "&"], + ["operator", ".."], + ["operator", "..."], + ["operator", "--"], + ["operator", "---"], + + ["comment", "% String operators"], + + ["operator", "&"], + ["operator", "<"], + ["operator", "<="], + ["operator", ">="], + ["operator", ">"], + ["operator", "="], + ["operator", "<>"], + + ["comment", "% Ligature operators"], + + ["operator", "=:"], + ["operator", "::"], + ["operator", "|=:"], + ["operator", "|=:>"], + ["operator", "=:|"], + ["operator", "=:|>"], + ["operator", "|=:|"], + ["operator", "|=:|>"], + ["operator", "|=:|>>"], + ["operator", "||:"] +] + +---------------------------------------------------- + +Checks for operators. diff --git a/tests/languages/metafont/ponctuation_feature.test b/tests/languages/metafont/ponctuation_feature.test new file mode 100644 index 0000000000..bc0b78edf3 --- /dev/null +++ b/tests/languages/metafont/ponctuation_feature.test @@ -0,0 +1,25 @@ +{ } + +% Loners +,;() +[] + +---------------------------------------------------- + +[ + ["punctuation", "{"], ["punctuation", "}"], + + ["comment", "% Loners"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "["], + ["punctuation", "]"] +] + +---------------------------------------------------- + +Checks for punctuation and delimiters. \ No newline at end of file diff --git a/tests/languages/metafont/primitive_feature.test b/tests/languages/metafont/primitive_feature.test new file mode 100644 index 0000000000..bc41234000 --- /dev/null +++ b/tests/languages/metafont/primitive_feature.test @@ -0,0 +1,70 @@ +ASCII +angle +char cosd +decimal directiontime +floor +hex +intersectiontimes +jobname +known +length +makepath makepen mexp mlog +normaldeviate +oct odd +pencircle penoffset point postcontrol precontrol +reverse rotated +sind sqrt str subpath substring +totalweight turningnumber +uniformdeviate unknown +xpart xxpart xypart +ypart yxpart yypart + +---------------------------------------------------- + +[ + ["builtin", "ASCII"], + ["builtin", "angle"], + ["builtin", "char"], + ["builtin", "cosd"], + ["builtin", "decimal"], + ["builtin", "directiontime"], + ["builtin", "floor"], + ["builtin", "hex"], + ["builtin", "intersectiontimes"], + ["builtin", "jobname"], + ["builtin", "known"], + ["builtin", "length"], + ["builtin", "makepath"], + ["builtin", "makepen"], + ["builtin", "mexp"], + ["builtin", "mlog"], + ["builtin", "normaldeviate"], + ["builtin", "oct"], + ["builtin", "odd"], + ["builtin", "pencircle"], + ["builtin", "penoffset"], + ["builtin", "point"], + ["builtin", "postcontrol"], + ["builtin", "precontrol"], + ["builtin", "reverse"], + ["builtin", "rotated"], + ["builtin", "sind"], + ["builtin", "sqrt"], + ["builtin", "str"], + ["builtin", "subpath"], + ["builtin", "substring"], + ["builtin", "totalweight"], + ["builtin", "turningnumber"], + ["builtin", "uniformdeviate"], + ["builtin", "unknown"], + ["builtin", "xpart"], + ["builtin", "xxpart"], + ["builtin", "xypart"], + ["builtin", "ypart"], + ["builtin", "yxpart"], + ["builtin", "yypart"] +] + +---------------------------------------------------- + +Checks for primitive METAFONT operations. \ No newline at end of file diff --git a/tests/languages/metafont/string_and_comment_feature.test b/tests/languages/metafont/string_and_comment_feature.test new file mode 100644 index 0000000000..9e57b245ed --- /dev/null +++ b/tests/languages/metafont/string_and_comment_feature.test @@ -0,0 +1,21 @@ +% +% comment +"" +"string" +"text%noncomment" +%"not string" + +---------------------------------------------------- + +[ + ["comment", "%"], + ["comment", "% comment"], + ["string", "\"\""], + ["string", "\"string\""], + ["string", "\"text%noncomment\""], + ["comment", "%\"not string\""] +] + +---------------------------------------------------- + +Checks for strings and comments without mangling. \ No newline at end of file diff --git a/tests/languages/metafont/type_feature.test b/tests/languages/metafont/type_feature.test new file mode 100644 index 0000000000..89d45198d2 --- /dev/null +++ b/tests/languages/metafont/type_feature.test @@ -0,0 +1,43 @@ +% Variable type +boolean +numeric +pair +path +pen +picture +string +transform + +% Argument type +expr +primary +secondary +suffix +tertiary +text + +---------------------------------------------------- + +[ + ["comment", "% Variable type"], + ["type", "boolean"], + ["type", "numeric"], + ["type", "pair"], + ["type", "path"], + ["type", "pen"], + ["type", "picture"], + ["type", "string"], + ["type", "transform"], + + ["comment", "% Argument type"], + ["type", "expr"], + ["type", "primary"], + ["type", "secondary"], + ["type", "suffix"], + ["type", "tertiary"], + ["type", "text"] +] + +---------------------------------------------------- + +Checks for typing keywords. \ No newline at end of file diff --git a/tests/languages/metafont/variable_feature.test b/tests/languages/metafont/variable_feature.test new file mode 100644 index 0000000000..79af5da3f4 --- /dev/null +++ b/tests/languages/metafont/variable_feature.test @@ -0,0 +1,53 @@ +% Special variables +#@ @ @# +whatever + +% Chardimen variables +d h w + +% Position variables +x y z + +% Output variables +aspect_ratio localfont mag mode screen_cols screen_rows + +% Other variables +currentpen currentpicture currenttransform +extra_beginchar extra_endchar extra_setup + +---------------------------------------------------- + +[ + ["comment", "% Special variables"], + ["variable", "#@"], ["variable", "@"], ["variable", "@#"], + ["variable", "whatever"], + + ["comment", "% Chardimen variables"], + ["variable", "d"], ["variable", "h"], ["variable", "w"], + + ["comment", "% Position variables"], + ["variable", "x"], ["variable", "y"], ["variable", "z"], + + ["comment", "% Output variables"], + + ["variable", "aspect_ratio"], + ["variable", "localfont"], + ["variable", "mag"], + ["variable", "mode"], + ["variable", "screen_cols"], + ["variable", "screen_rows"], + + ["comment", "% Other variables"], + + ["variable", "currentpen"], + ["variable", "currentpicture"], + ["variable", "currenttransform"], + + ["variable", "extra_beginchar"], + ["variable", "extra_endchar"], + ["variable", "extra_setup"] +] + +---------------------------------------------------- + +Checks for important variables. \ No newline at end of file diff --git a/tests/languages/nsis/keyword_feature.test b/tests/languages/nsis/keyword_feature.test index b8d332c1f3..e541cb9ef4 100644 --- a/tests/languages/nsis/keyword_feature.test +++ b/tests/languages/nsis/keyword_feature.test @@ -76,8 +76,10 @@ GetFunction GetFunctionAddress GetFunctionEnd GetInstDirError +GetKnownFolderPath GetLabelAddress GetTempFileName +GetWinVer Goto HideWindow Icon @@ -85,6 +87,8 @@ IfAbort IfErrors IfFileExists IfRebootFlag +IfRtlLanguage +IfShellVarContextAll IfSilent InitPluginsDir InstallButtonText @@ -197,6 +201,7 @@ StrCpy StrLen SubCaption System +Target Unicode UninstallButtonText UninstallCaption @@ -303,8 +308,10 @@ XPStyle ["keyword", "GetFunctionAddress"], ["keyword", "GetFunctionEnd"], ["keyword", "GetInstDirError"], + ["keyword", "GetKnownFolderPath"], ["keyword", "GetLabelAddress"], ["keyword", "GetTempFileName"], + ["keyword", "GetWinVer"], ["keyword", "Goto"], ["keyword", "HideWindow"], ["keyword", "Icon"], @@ -312,6 +319,8 @@ XPStyle ["keyword", "IfErrors"], ["keyword", "IfFileExists"], ["keyword", "IfRebootFlag"], + ["keyword", "IfRtlLanguage"], + ["keyword", "IfShellVarContextAll"], ["keyword", "IfSilent"], ["keyword", "InitPluginsDir"], ["keyword", "InstallButtonText"], @@ -424,6 +433,7 @@ XPStyle ["keyword", "StrLen"], ["keyword", "SubCaption"], ["keyword", "System"], + ["keyword", "Target"], ["keyword", "Unicode"], ["keyword", "UninstallButtonText"], ["keyword", "UninstallCaption"], @@ -452,4 +462,4 @@ XPStyle ---------------------------------------------------- -Checks for all keywords. \ No newline at end of file +Checks for all keywords. diff --git a/tests/languages/odin/boolean_feature.test b/tests/languages/odin/boolean_feature.test new file mode 100644 index 0000000000..75b3f44ab3 --- /dev/null +++ b/tests/languages/odin/boolean_feature.test @@ -0,0 +1,11 @@ +false +nil +true + +---------------------------------------------------- + +[ + ["boolean", "false"], + ["boolean", "nil"], + ["boolean", "true"] +] diff --git a/tests/languages/odin/character_feature.test b/tests/languages/odin/character_feature.test new file mode 100644 index 0000000000..8cf23a548c --- /dev/null +++ b/tests/languages/odin/character_feature.test @@ -0,0 +1,147 @@ +' ' +'!' +'"' +'0' +'\"' +'\'' +'\000' +'\077' +'\U000000' +'\UFFFFFF' +'\Uffffff' +'\\' +'\a' +'\b' +'\e' +'\f' +'\n' +'\r' +'\t' +'\u0000' +'\uFFFF' +'\uffff' +'\v' +'\x00' +'\xFF' +'\xff' +'a' + +---------------------------------------------------- + +[ + ["char", ["' '"]], + ["char", ["'!'"]], + ["char", ["'\"'"]], + ["char", ["'0'"]], + ["char", [ + "'", + ["symbol", "\\\""], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\'"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\000"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\077"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\U000000"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\UFFFFFF"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\Uffffff"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\\\"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\a"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\b"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\e"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\f"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\n"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\r"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\t"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\u0000"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\uFFFF"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\uffff"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\v"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\x00"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\xFF"], + "'" + ]], + ["char", [ + "'", + ["symbol", "\\xff"], + "'" + ]], + ["char", ["'a'"]] +] diff --git a/tests/languages/odin/comment_feature.test b/tests/languages/odin/comment_feature.test new file mode 100644 index 0000000000..5f91768690 --- /dev/null +++ b/tests/languages/odin/comment_feature.test @@ -0,0 +1,92 @@ +#! +#! A comment +#!! +#!"" +#!#! +#!' ' +#!/**/ +#!// +#!0 +#!`` +#!false +#!if +/* +*/ +/* 1 /* 2 */ 1 */ +/* A comment */ +/*!*/ +/*""*/ +/*"\a"*/ +/*#!*/ +/*' '*/ +/*'\a'*/ +/**/ +/*/**/*/ +/*0*/ +/*`\a`*/ +/*``*/ +/*false*/ +/*if*/ +// +// A comment +//! +//"" +//#! +//' ' +///**/ +//// +//0 +//`` +//false +//if +Not a comment #! A comment +Not a comment /* A comment */ +Not a comment // A comment + +---------------------------------------------------- + +[ + ["comment", "#!"], + ["comment", "#! A comment"], + ["comment", "#!!"], + ["comment", "#!\"\""], + ["comment", "#!#!"], + ["comment", "#!' '"], + ["comment", "#!/**/"], + ["comment", "#!//"], + ["comment", "#!0"], + ["comment", "#!``"], + ["comment", "#!false"], + ["comment", "#!if"], + ["comment", "/*\r\n*/"], + ["comment", "/* 1 /* 2 */ 1 */"], + ["comment", "/* A comment */"], + ["comment", "/*!*/"], + ["comment", "/*\"\"*/"], + ["comment", "/*\"\\a\"*/"], + ["comment", "/*#!*/"], + ["comment", "/*' '*/"], + ["comment", "/*'\\a'*/"], + ["comment", "/**/"], + ["comment", "/*/**/*/"], + ["comment", "/*0*/"], + ["comment", "/*`\\a`*/"], + ["comment", "/*``*/"], + ["comment", "/*false*/"], + ["comment", "/*if*/"], + ["comment", "//"], + ["comment", "// A comment"], + ["comment", "//!"], + ["comment", "//\"\""], + ["comment", "//#!"], + ["comment", "//' '"], + ["comment", "///**/"], + ["comment", "////"], + ["comment", "//0"], + ["comment", "//``"], + ["comment", "//false"], + ["comment", "//if"], + "\r\nNot a comment ", ["comment", "#! A comment"], + "\r\nNot a comment ", ["comment", "/* A comment */"], + "\r\nNot a comment ", ["comment", "// A comment"] +] diff --git a/tests/languages/odin/constant_parameter_sign_feature.test b/tests/languages/odin/constant_parameter_sign_feature.test new file mode 100644 index 0000000000..072cebc8a4 --- /dev/null +++ b/tests/languages/odin/constant_parameter_sign_feature.test @@ -0,0 +1,7 @@ +$ + +---------------------------------------------------- + +[ + ["constant-parameter-sign", "$"] +] diff --git a/tests/languages/odin/directive_feature.test b/tests/languages/odin/directive_feature.test new file mode 100644 index 0000000000..61edb9b9d8 --- /dev/null +++ b/tests/languages/odin/directive_feature.test @@ -0,0 +1,9 @@ +#assert +#no_bounds_check + +---------------------------------------------------- + +[ + ["directive", "#assert"], + ["directive", "#no_bounds_check"] +] diff --git a/tests/languages/odin/discard_feature.test b/tests/languages/odin/discard_feature.test new file mode 100644 index 0000000000..d8f6696171 --- /dev/null +++ b/tests/languages/odin/discard_feature.test @@ -0,0 +1,7 @@ +_ + +---------------------------------------------------- + +[ + ["discard", "_"] +] diff --git a/tests/languages/odin/keyword_feature.test b/tests/languages/odin/keyword_feature.test new file mode 100644 index 0000000000..c3380bec0b --- /dev/null +++ b/tests/languages/odin/keyword_feature.test @@ -0,0 +1,77 @@ +asm +auto_cast +bit_set +break +case +cast +context +continue +defer +distinct +do +dynamic +else +enum +fallthrough +for +foreign +if +import +in +map +matrix +not_in +or_else +or_return +package +proc +return +struct +switch +transmute +typeid +union +using +when +where + +---------------------------------------------------- + +[ + ["keyword", "asm"], + ["keyword", "auto_cast"], + ["keyword", "bit_set"], + ["keyword", "break"], + ["keyword", "case"], + ["keyword", "cast"], + ["keyword", "context"], + ["keyword", "continue"], + ["keyword", "defer"], + ["keyword", "distinct"], + ["keyword", "do"], + ["keyword", "dynamic"], + ["keyword", "else"], + ["keyword", "enum"], + ["keyword", "fallthrough"], + ["keyword", "for"], + ["keyword", "foreign"], + ["keyword", "if"], + ["keyword", "import"], + ["keyword", "in"], + ["keyword", "map"], + ["keyword", "matrix"], + ["keyword", "not_in"], + ["keyword", "or_else"], + ["keyword", "or_return"], + ["keyword", "package"], + ["keyword", "proc"], + ["keyword", "return"], + ["keyword", "struct"], + ["keyword", "switch"], + ["keyword", "transmute"], + ["keyword", "typeid"], + ["keyword", "union"], + ["keyword", "using"], + ["keyword", "when"], + ["keyword", "where"] +] diff --git a/tests/languages/odin/not_a_number_feature.test b/tests/languages/odin/not_a_number_feature.test new file mode 100644 index 0000000000..e05789eac0 --- /dev/null +++ b/tests/languages/odin/not_a_number_feature.test @@ -0,0 +1,31 @@ +0B0 +0D0 +0I +0O0 +0Z0 +0b +0b2 +0d +0h +0h0 +0h00 +0h000 +0h00000 +0h0000000 +0h000000000 +0h000000000000000 +0h00000000000000000 +0h_ +0o +0o8 +0x +0X0 +0xG +0z +0zC + +---------------------------------------------------- + +[ + "0B0\r\n0D0\r\n0I\r\n0O0\r\n0Z0\r\n0b\r\n0b2\r\n0d\r\n0h\r\n0h0\r\n0h00\r\n0h000\r\n0h00000\r\n0h0000000\r\n0h000000000\r\n0h000000000000000\r\n0h00000000000000000\r\n0h_\r\n0o\r\n0o8\r\n0x\r\n0X0\r\n0xG\r\n0z\r\n0zC" +] diff --git a/tests/languages/odin/number_feature.test b/tests/languages/odin/number_feature.test new file mode 100644 index 0000000000..2e2560fda3 --- /dev/null +++ b/tests/languages/odin/number_feature.test @@ -0,0 +1,129 @@ +.0 +0 +0. +0E +0b0 +0b00 +0b01 +0b0_ +0b_ +0b_0 +0b_1 +0b__ +0d0 +0d00 +0d01 +0d0_ +0d_ +0d_0 +0d_1 +0d__ +0e +0e+ +0e+0 +0e+0i +0e+i +0e- +0e-0 +0e-0i +0e-i +0ei +0h0000 +0h00000000 +0h0000000000000000 +0i +0o0 +0o00 +0o01 +0o0_ +0o_ +0o_0 +0o_1 +0o__ +0x0 +0x00 +0x0_ +0x0F +0x0f +0x_ +0x_0 +0x__ +0x_F +0x_f +0z0 +0z00 +0z0_ +0z0B +0z0b +0z_ +0z_0 +0z__ +0z_B +0z_b + +---------------------------------------------------- + +[ + ["number", ".0"], + ["number", "0"], + ["number", "0."], + ["number", "0E"], + ["number", "0b0"], + ["number", "0b00"], + ["number", "0b01"], + ["number", "0b0_"], + ["number", "0b_"], + ["number", "0b_0"], + ["number", "0b_1"], + ["number", "0b__"], + ["number", "0d0"], + ["number", "0d00"], + ["number", "0d01"], + ["number", "0d0_"], + ["number", "0d_"], + ["number", "0d_0"], + ["number", "0d_1"], + ["number", "0d__"], + ["number", "0e"], + ["number", "0e+"], + ["number", "0e+0"], + ["number", "0e+0i"], + ["number", "0e+i"], + ["number", "0e-"], + ["number", "0e-0"], + ["number", "0e-0i"], + ["number", "0e-i"], + ["number", "0ei"], + ["number", "0h0000"], + ["number", "0h00000000"], + ["number", "0h0000000000000000"], + ["number", "0i"], + ["number", "0o0"], + ["number", "0o00"], + ["number", "0o01"], + ["number", "0o0_"], + ["number", "0o_"], + ["number", "0o_0"], + ["number", "0o_1"], + ["number", "0o__"], + ["number", "0x0"], + ["number", "0x00"], + ["number", "0x0_"], + ["number", "0x0F"], + ["number", "0x0f"], + ["number", "0x_"], + ["number", "0x_0"], + ["number", "0x__"], + ["number", "0x_F"], + ["number", "0x_f"], + ["number", "0z0"], + ["number", "0z00"], + ["number", "0z0_"], + ["number", "0z0B"], + ["number", "0z0b"], + ["number", "0z_"], + ["number", "0z_0"], + ["number", "0z__"], + ["number", "0z_B"], + ["number", "0z_b"] +] diff --git a/tests/languages/odin/operator_feature.test b/tests/languages/odin/operator_feature.test new file mode 100644 index 0000000000..fd4752a089 --- /dev/null +++ b/tests/languages/odin/operator_feature.test @@ -0,0 +1,97 @@ +! +!= +% +%% +%%= +%= +& +&& +&&= +&= +&~ +&~= +* +*= ++ +++ ++= +- +-- +-= +.. +..< +..= +/ +/= +< +<< +<<= +<= += +== +> +>= +>> +>>= +? +^ +| +|= +|| +||= +~ +~= + +// ranges +0..<10 + +---------------------------------------------------- + +[ + ["operator", "!"], + ["operator", "!="], + ["operator", "%"], + ["operator", "%%"], + ["operator", "%%="], + ["operator", "%="], + ["operator", "&"], + ["operator", "&&"], + ["operator", "&&="], + ["operator", "&="], + ["operator", "&~"], + ["operator", "&~="], + ["operator", "*"], + ["operator", "*="], + ["operator", "+"], + ["operator", "++"], + ["operator", "+="], + ["operator", "-"], + ["operator", "--"], + ["operator", "-="], + ["operator", ".."], + ["operator", "..<"], + ["operator", "..="], + ["operator", "/"], + ["operator", "/="], + ["operator", "<"], + ["operator", "<<"], + ["operator", "<<="], + ["operator", "<="], + ["operator", "="], + ["operator", "=="], + ["operator", ">"], + ["operator", ">="], + ["operator", ">>"], + ["operator", ">>="], + ["operator", "?"], + ["operator", "^"], + ["operator", "|"], + ["operator", "|="], + ["operator", "||"], + ["operator", "||="], + ["operator", "~"], + ["operator", "~="], + + ["comment", "// ranges"], + ["number", "0"], ["operator", "..<"], ["number", "10"] +] diff --git a/tests/languages/odin/procedure_feature.test b/tests/languages/odin/procedure_feature.test new file mode 100644 index 0000000000..93a59f1c7e --- /dev/null +++ b/tests/languages/odin/procedure_feature.test @@ -0,0 +1,27 @@ +do_math() +fibonacci() +log10() + +cross :: proc(a, b: Vector3) -> Vector3 + +---------------------------------------------------- + +[ + ["procedure-name", "do_math"], ["punctuation", "("], ["punctuation", ")"], + ["procedure-name", "fibonacci"], ["punctuation", "("], ["punctuation", ")"], + ["procedure-name", "log10"], ["punctuation", "("], ["punctuation", ")"], + + ["procedure-definition", "cross"], + ["punctuation", ":"], + ["punctuation", ":"], + ["keyword", "proc"], + ["punctuation", "("], + "a", + ["punctuation", ","], + " b", + ["punctuation", ":"], + " Vector3", + ["punctuation", ")"], + ["arrow", "->"], + " Vector3" +] diff --git a/tests/languages/odin/punctuation_feature.test b/tests/languages/odin/punctuation_feature.test new file mode 100644 index 0000000000..8c4c80c104 --- /dev/null +++ b/tests/languages/odin/punctuation_feature.test @@ -0,0 +1,29 @@ +( +) +, +-> +. +: +; +@ +[ +] +{ +} + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + ["arrow", "->"], + ["punctuation", "."], + ["punctuation", ":"], + ["punctuation", ";"], + ["punctuation", "@"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/odin/raw_string_feature.test b/tests/languages/odin/raw_string_feature.test new file mode 100644 index 0000000000..abb64cccfd --- /dev/null +++ b/tests/languages/odin/raw_string_feature.test @@ -0,0 +1,79 @@ +` +` +`!` +`""` +`"\a"` +`' '` +`'\a'` +`/**/` +`//` +`0` +`\ +` +`\"` +`\'` +`\000` +`\077` +`\U000000` +`\UFFFFFF` +`\Uffffff` +`\\` +`\a` +`\b` +`\e` +`\f` +`\n` +`\r` +`\t` +`\u0000` +`\uFFFF` +`\uffff` +`\v` +`\x00` +`\xFF` +`\xff` +`A raw string.` +`` +`false` +`if` + +---------------------------------------------------- + +[ + ["string", "`\r\n`"], + ["string", "`!`"], + ["string", "`\"\"`"], + ["string", "`\"\\a\"`"], + ["string", "`' '`"], + ["string", "`'\\a'`"], + ["string", "`/**/`"], + ["string", "`//`"], + ["string", "`0`"], + ["string", "`\\\r\n`"], + ["string", "`\\\"`"], + ["string", "`\\'`"], + ["string", "`\\000`"], + ["string", "`\\077`"], + ["string", "`\\U000000`"], + ["string", "`\\UFFFFFF`"], + ["string", "`\\Uffffff`"], + ["string", "`\\\\`"], + ["string", "`\\a`"], + ["string", "`\\b`"], + ["string", "`\\e`"], + ["string", "`\\f`"], + ["string", "`\\n`"], + ["string", "`\\r`"], + ["string", "`\\t`"], + ["string", "`\\u0000`"], + ["string", "`\\uFFFF`"], + ["string", "`\\uffff`"], + ["string", "`\\v`"], + ["string", "`\\x00`"], + ["string", "`\\xFF`"], + ["string", "`\\xff`"], + ["string", "`A raw string.`"], + ["string", "``"], + ["string", "`false`"], + ["string", "`if`"] +] diff --git a/tests/languages/odin/string_feature.test b/tests/languages/odin/string_feature.test new file mode 100644 index 0000000000..4ce66b9186 --- /dev/null +++ b/tests/languages/odin/string_feature.test @@ -0,0 +1,178 @@ +"!" +"" +"' '" +"'\a'" +"/**/" +"//" +"0" +"\"" +"\'" +"\000" +"\077" +"\U000000" +"\UFFFFFF" +"\Uffffff" +"\\" +"\a" +"\b" +"\e" +"\f" +"\n" +"\r" +"\t" +"\u0000" +"\uFFFF" +"\uffff" +"\v" +"\x00" +"\xFF" +"\xff" +"Not +a +string" +"Not\ +a\ +string" +"String" +"String" Not a string" +"`\a`" +"``" +"false" +"if" + +---------------------------------------------------- + +[ + ["string", ["\"!\""]], + ["string", ["\"\""]], + ["string", ["\"' '\""]], + ["string", [ + "\"'", + ["symbol", "\\a"], + "'\"" + ]], + ["string", ["\"/**/\""]], + ["string", ["\"//\""]], + ["string", ["\"0\""]], + ["string", [ + "\"", + ["symbol", "\\\""], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\'"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\000"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\077"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\U000000"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\UFFFFFF"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\Uffffff"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\\\"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\a"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\b"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\e"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\f"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\n"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\r"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\t"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\u0000"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\uFFFF"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\uffff"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\v"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\x00"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\xFF"], + "\"" + ]], + ["string", [ + "\"", + ["symbol", "\\xff"], + "\"" + ]], + "\r\n\"Not\r\na\r\nstring\"\r\n\"Not\\\r\na\\\r\nstring\"\r\n", + ["string", ["\"String\""]], + ["string", ["\"String\""]], " Not a string\"\r\n", + ["string", [ + "\"`", + ["symbol", "\\a"], + "`\"" + ]], + ["string", ["\"``\""]], + ["string", ["\"false\""]], + ["string", ["\"if\""]] +] diff --git a/tests/languages/odin/undefined_feature.test b/tests/languages/odin/undefined_feature.test new file mode 100644 index 0000000000..5347143d3c --- /dev/null +++ b/tests/languages/odin/undefined_feature.test @@ -0,0 +1,7 @@ +--- + +---------------------------------------------------- + +[ + ["undefined", "---"] +] diff --git a/tests/languages/rescript/attr-value_feature.test b/tests/languages/rescript/attr-value_feature.test new file mode 100644 index 0000000000..50a2b5a2d3 --- /dev/null +++ b/tests/languages/rescript/attr-value_feature.test @@ -0,0 +1,20 @@ + + +---------------------------------------------------- + +[ + ["operator", "<"], + ["tag", ["button"]], + ["operator", ">"], + ["tag", [ + ["operator", "<"], + ["operator", "/"], + "button" + ]], + ["operator", ">"] +] + +---------------------------------------------------- + +Checks for tag. diff --git a/tests/languages/scala/keyword_feature.test b/tests/languages/scala/keyword_feature.test index 9e3cfb4d1b..859dac03b9 100644 --- a/tests/languages/scala/keyword_feature.test +++ b/tests/languages/scala/keyword_feature.test @@ -1,15 +1,19 @@ <- => abstract case catch -class def do else -extends final finally -for forSome if -implicit import; lazy +class def derives do +else enum extends extension +final finally +for forSome given if +implicit import; +infix inline lazy match new null object +opaque open override package private protected return sealed self super this throw -trait try type val +trait transparent try +type using val var while with yield ---------------------------------------------------- @@ -17,19 +21,71 @@ var while with yield [ ["keyword", "<-"], ["keyword", "=>"], - ["keyword", "abstract"], ["keyword", "case"], ["keyword", "catch"], - ["keyword", "class"], ["keyword", "def"], ["keyword", "do"], ["keyword", "else"], - ["keyword", "extends"], ["keyword", "final"], ["keyword", "finally"], - ["keyword", "for"], ["keyword", "forSome"], ["keyword", "if"], - ["keyword", "implicit"], ["keyword", "import"], ["punctuation", ";"], ["keyword", "lazy"], - ["keyword", "match"], ["keyword", "new"], ["keyword", "null"], ["keyword", "object"], - ["keyword", "override"], ["keyword", "package"], ["keyword", "private"], - ["keyword", "protected"], ["keyword", "return"], ["keyword", "sealed"], - ["keyword", "self"], ["keyword", "super"], ["keyword", "this"], ["keyword", "throw"], - ["keyword", "trait"], ["keyword", "try"], ["keyword", "type"], ["keyword", "val"], - ["keyword", "var"], ["keyword", "while"], ["keyword", "with"], ["keyword", "yield"] + ["keyword", "abstract"], + ["keyword", "case"], + ["keyword", "catch"], + + ["keyword", "class"], + ["keyword", "def"], + ["keyword", "derives"], + ["keyword", "do"], + + ["keyword", "else"], + ["keyword", "enum"], + ["keyword", "extends"], + ["keyword", "extension"], + + ["keyword", "final"], + ["keyword", "finally"], + + ["keyword", "for"], + ["keyword", "forSome"], + ["keyword", "given"], + ["keyword", "if"], + + ["keyword", "implicit"], + ["keyword", "import"], + ["punctuation", ";"], + + ["keyword", "infix"], + ["keyword", "inline"], + ["keyword", "lazy"], + + ["keyword", "match"], + ["keyword", "new"], + ["keyword", "null"], + ["keyword", "object"], + + ["keyword", "opaque"], + ["keyword", "open"], + + ["namespace", ["override"]], + ["keyword", "package"], + ["keyword", "private"], + + ["keyword", "protected"], + ["keyword", "return"], + ["keyword", "sealed"], + + ["keyword", "self"], + ["keyword", "super"], + ["keyword", "this"], + ["keyword", "throw"], + + ["keyword", "trait"], + ["keyword", "transparent"], + ["keyword", "try"], + + ["keyword", "type"], + ["keyword", "using"], + ["keyword", "val"], + + ["keyword", "var"], + ["keyword", "while"], + ["keyword", "with"], + ["keyword", "yield"] ] ---------------------------------------------------- -Checks for keywords. \ No newline at end of file +Checks for keywords. diff --git a/tests/languages/shell-session/command_string_feature.test b/tests/languages/shell-session/command_string_feature.test index 930d0b62ca..f1ddd20871 100644 --- a/tests/languages/shell-session/command_string_feature.test +++ b/tests/languages/shell-session/command_string_feature.test @@ -97,13 +97,13 @@ y_#!$U48 ["operator", ["="]], "C ", ["function", "tr"], - " -cd ", + ["parameter", "-cd"], ["string", "'a-zA-Z0-9_-;:!?.@\\\\*/#%$'"], ["operator", ["<"]], " /dev/random ", ["operator", ["|"]], ["function", "head"], - " -c ", + ["parameter", "-c"], ["number", "8"] ]] ]], diff --git a/tests/languages/shell-session/info_feature.test b/tests/languages/shell-session/info_feature.test index f8cf93d500..5c3a9bc0ff 100644 --- a/tests/languages/shell-session/info_feature.test +++ b/tests/languages/shell-session/info_feature.test @@ -22,6 +22,7 @@ foo@bar% exit " ~" ]] ]], + ["command", [ ["info", [ ["user", "foo@bar"], @@ -31,9 +32,10 @@ foo@bar% exit ["shell-symbol", "$"], ["bash", [ ["function", "sudo"], - " -i" + ["parameter", "-i"] ]] ]], + ["output", "[sudo] password for foo:\r\n"], ["command", [ ["info", [ @@ -44,11 +46,10 @@ foo@bar% exit ["shell-symbol", "#"], ["bash", [ ["builtin", "echo"], - ["string", [ - "\"hello!\"" - ]] + ["string", ["\"hello!\""]] ]] ]], + ["output", "hello!\r\n\r\n"], ["command", [ ["info", [ @@ -59,6 +60,7 @@ foo@bar% exit ["function", "zsh"] ]] ]], + ["command", [ ["info", [ ["user", "foo@bar"] diff --git a/tests/languages/shell-session/issue2644.test b/tests/languages/shell-session/issue2644.test index a066583735..495624fd90 100644 --- a/tests/languages/shell-session/issue2644.test +++ b/tests/languages/shell-session/issue2644.test @@ -44,7 +44,8 @@ Write down the passphrase. Store both at safe place(s). ["command", [ ["shell-symbol", "$"], ["bash", [ - "borg init --encryption", + "borg init ", + ["parameter", "--encryption"], ["operator", ["="]], "keyfile-blake2 ", ["string", ["\"borg@1.2.3.4:backup\""]] diff --git a/tests/languages/shell-session/issue2871.test b/tests/languages/shell-session/issue2871.test index 3446a14d09..fd84b5419b 100644 --- a/tests/languages/shell-session/issue2871.test +++ b/tests/languages/shell-session/issue2871.test @@ -15,7 +15,8 @@ hello ["bash", [ ["function", "sudo"], ["function", "ls"], - " -l ~/.config ", + ["parameter", "-l"], + " ~/.config ", ["string", "'s'"], ["operator", ["&&"]], ["punctuation", "\\"], diff --git a/tests/languages/wgsl/attributes_feature.test b/tests/languages/wgsl/attributes_feature.test new file mode 100644 index 0000000000..c45480330c --- /dev/null +++ b/tests/languages/wgsl/attributes_feature.test @@ -0,0 +1,209 @@ +@notAnAttribute +@align() +@binding() + +@builtin() + +@builtin(vertex_index) +@builtin(instance_index) +@builtin(position) + +@builtin(front_facing) +@builtin(frag_depth) +@builtin(sample_index) +@builtin(sample_mask) + +@builtin(local_invocation_id) +@builtin(local_invocation_index) +@builtin(global_invocation_id) +@builtin(workgroup_id) +@builtin(num_workgroups) + +@builtin(notABuiltInValue) +something.vertex_index; + +@const +@group() +@id() +@interpolate() +@invariant +@location() +@size() +@workgroup_size() + +@vertex +@fragment +@compute + +---------------------------------------------------- + +[ + ["punctuation", "@"], + "notAnAttribute\r\n", + + ["punctuation", "@"], + ["attributes", "align"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "@"], + ["attributes", "binding"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "vertex_index"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "instance_index"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "position"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "front_facing"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "frag_depth"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "sample_index"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "sample_mask"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "local_invocation_id"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "local_invocation_index"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "global_invocation_id"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "workgroup_id"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + ["built-in-values", "num_workgroups"], + ["punctuation", ")"] + ]], + + ["punctuation", "@"], + ["builtin-attribute", [ + ["attribute", "builtin"], + ["punctuation", "("], + "notABuiltInValue", + ["punctuation", ")"] + ]], + + "\r\nsomething", + ["punctuation", "."], + "vertex_index", + ["punctuation", ";"], + + ["punctuation", "@"], + ["attributes", "const"], + + ["punctuation", "@"], + ["attributes", "group"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "@"], + ["attributes", "id"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "@"], + ["attributes", "interpolate"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "@"], + ["attributes", "invariant"], + + ["punctuation", "@"], + ["attributes", "location"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "@"], + ["attributes", "size"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "@"], + ["attributes", "workgroup_size"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "@"], ["attributes", "vertex"], + ["punctuation", "@"], ["attributes", "fragment"], + ["punctuation", "@"], ["attributes", "compute"] +] diff --git a/tests/languages/wgsl/builtin_feature.test b/tests/languages/wgsl/builtin_feature.test new file mode 100644 index 0000000000..ac8d2733e9 --- /dev/null +++ b/tests/languages/wgsl/builtin_feature.test @@ -0,0 +1,321 @@ +bool +i32 +u32 +f32 +i64 +u64 +f64 +vec2 +vec3 +vec4 +mat2x2 +mat2x3 +mat2x4 +mat3x2 +mat3x3 +mat3x4 +mat4x2 +mat4x3 +mat4x4 + +atomic +array + +override +ptr + +sampler +sampler_comparison +staticAssert + +texture_1d +texture_2d +texture_2d_array +texture_3d +texture_cube +texture_cube_array +texture_multisampled_2d +texture_storage_1d +texture_storage_2d +texture_storage_2d_array +texture_storage_3d +texture_depth_2d +texture_depth_2d_array +texture_depth_cube +texture_depth_cube_array +texture_depth_multisampled_2d + +staticAssert() + +all +any +select +abs +acos +acosh +asin +asinh +atan +atanh +atan2 +ceil +clamp +cos +cosh +cross +degrees +distance +exp +exp2 +faceForward +floor +fma +fract +frexp +inverseSqrt +ldexp +length +log +log2 +max +min +mix +modf +normalize +pow +quantizeToF16 +radians +reflect +refract +round +sign +sin +sinh +smoothstep +sqrt +step +tan +tanh +trunc +countLeadingZeros +countOneBits +countTrailingZeros +firstLeadingBit +extractBits +insertBits +reverseBits +shiftLeft +shiftRight +determinant +transpose +dot +dpdx +dpdxCoarse +dpdxFine +dpdy +dpdyCoarse +dpdyFine +fwidth +fwidthCoarse +fwidthFine +textureDimensions +textureGather +textureGatherCompare +textureLoad +textureNumLayers +textureNumLevels +textureNumSamples +textureSample +textureSampleBias +textureSampleCompare +textureSampleCompareLevel +textureSampleGrad +textureSampleLevel +textureStore +atomicLoad +atomicStore +atomicAdd +atomicSub +atomicMax +atomicMin +atomicAnd +atomicOr +atomicXor +atomicExchange +atomicCompareExchangeWeak +pack4x8snorm +pack4x8unorm +pack2x16snorm +pack2x16unorm +pack2x16float +unpack4x8snorm +unpack4x8unorm +unpack2x16snorm +unpack2x16unorm +unpack2x16float +storageBarrier +workgroupBarrier + +---------------------------------------------------- + +[ + ["builtin", "bool"], + ["builtin", "i32"], + ["builtin", "u32"], + ["builtin", "f32"], + ["builtin", "i64"], + ["builtin", "u64"], + ["builtin", "f64"], + ["builtin", "vec2"], + ["builtin", "vec3"], + ["builtin", "vec4"], + ["builtin", "mat2x2"], + ["builtin", "mat2x3"], + ["builtin", "mat2x4"], + ["builtin", "mat3x2"], + ["builtin", "mat3x3"], + ["builtin", "mat3x4"], + ["builtin", "mat4x2"], + ["builtin", "mat4x3"], + ["builtin", "mat4x4"], + + ["builtin", "atomic"], + ["builtin", "array"], + + ["builtin", "override"], + ["builtin", "ptr"], + + ["builtin", "sampler"], + ["builtin", "sampler_comparison"], + ["builtin", "staticAssert"], + + ["builtin", "texture_1d"], + ["builtin", "texture_2d"], + ["builtin", "texture_2d_array"], + ["builtin", "texture_3d"], + ["builtin", "texture_cube"], + ["builtin", "texture_cube_array"], + ["builtin", "texture_multisampled_2d"], + ["builtin", "texture_storage_1d"], + ["builtin", "texture_storage_2d"], + ["builtin", "texture_storage_2d_array"], + ["builtin", "texture_storage_3d"], + ["builtin", "texture_depth_2d"], + ["builtin", "texture_depth_2d_array"], + ["builtin", "texture_depth_cube"], + ["builtin", "texture_depth_cube_array"], + ["builtin", "texture_depth_multisampled_2d"], + + ["builtin", "staticAssert"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin", "all"], + ["builtin", "any"], + ["builtin", "select"], + ["builtin", "abs"], + ["builtin", "acos"], + ["builtin", "acosh"], + ["builtin", "asin"], + ["builtin", "asinh"], + ["builtin", "atan"], + ["builtin", "atanh"], + ["builtin", "atan2"], + ["builtin", "ceil"], + ["builtin", "clamp"], + ["builtin", "cos"], + ["builtin", "cosh"], + ["builtin", "cross"], + ["builtin", "degrees"], + ["builtin", "distance"], + ["builtin", "exp"], + ["builtin", "exp2"], + ["builtin", "faceForward"], + ["builtin", "floor"], + ["builtin", "fma"], + ["builtin", "fract"], + ["builtin", "frexp"], + ["builtin", "inverseSqrt"], + ["builtin", "ldexp"], + ["builtin", "length"], + ["builtin", "log"], + ["builtin", "log2"], + ["builtin", "max"], + ["builtin", "min"], + ["builtin", "mix"], + ["builtin", "modf"], + ["builtin", "normalize"], + ["builtin", "pow"], + ["builtin", "quantizeToF16"], + ["builtin", "radians"], + ["builtin", "reflect"], + ["builtin", "refract"], + ["builtin", "round"], + ["builtin", "sign"], + ["builtin", "sin"], + ["builtin", "sinh"], + ["builtin", "smoothstep"], + ["builtin", "sqrt"], + ["builtin", "step"], + ["builtin", "tan"], + ["builtin", "tanh"], + ["builtin", "trunc"], + ["builtin", "countLeadingZeros"], + ["builtin", "countOneBits"], + ["builtin", "countTrailingZeros"], + ["builtin", "firstLeadingBit"], + ["builtin", "extractBits"], + ["builtin", "insertBits"], + ["builtin", "reverseBits"], + ["builtin", "shiftLeft"], + ["builtin", "shiftRight"], + ["builtin", "determinant"], + ["builtin", "transpose"], + ["builtin", "dot"], + ["builtin", "dpdx"], + ["builtin", "dpdxCoarse"], + ["builtin", "dpdxFine"], + ["builtin", "dpdy"], + ["builtin", "dpdyCoarse"], + ["builtin", "dpdyFine"], + ["builtin", "fwidth"], + ["builtin", "fwidthCoarse"], + ["builtin", "fwidthFine"], + ["builtin", "textureDimensions"], + ["builtin", "textureGather"], + ["builtin", "textureGatherCompare"], + ["builtin", "textureLoad"], + ["builtin", "textureNumLayers"], + ["builtin", "textureNumLevels"], + ["builtin", "textureNumSamples"], + ["builtin", "textureSample"], + ["builtin", "textureSampleBias"], + ["builtin", "textureSampleCompare"], + ["builtin", "textureSampleCompareLevel"], + ["builtin", "textureSampleGrad"], + ["builtin", "textureSampleLevel"], + ["builtin", "textureStore"], + ["builtin", "atomicLoad"], + ["builtin", "atomicStore"], + ["builtin", "atomicAdd"], + ["builtin", "atomicSub"], + ["builtin", "atomicMax"], + ["builtin", "atomicMin"], + ["builtin", "atomicAnd"], + ["builtin", "atomicOr"], + ["builtin", "atomicXor"], + ["builtin", "atomicExchange"], + ["builtin", "atomicCompareExchangeWeak"], + ["builtin", "pack4x8snorm"], + ["builtin", "pack4x8unorm"], + ["builtin", "pack2x16snorm"], + ["builtin", "pack2x16unorm"], + ["builtin", "pack2x16float"], + ["builtin", "unpack4x8snorm"], + ["builtin", "unpack4x8unorm"], + ["builtin", "unpack2x16snorm"], + ["builtin", "unpack2x16unorm"], + ["builtin", "unpack2x16float"], + ["builtin", "storageBarrier"], + ["builtin", "workgroupBarrier"] +] diff --git a/tests/languages/wgsl/class_name_feature.test b/tests/languages/wgsl/class_name_feature.test new file mode 100644 index 0000000000..ed13952abd --- /dev/null +++ b/tests/languages/wgsl/class_name_feature.test @@ -0,0 +1,9 @@ +ClassName +notAClassName + +---------------------------------------------------- + +[ + ["class-name", "ClassName"], + "\r\nnotAClassName" +] diff --git a/tests/languages/wgsl/comment_feature.test b/tests/languages/wgsl/comment_feature.test new file mode 100644 index 0000000000..55c2923e3d --- /dev/null +++ b/tests/languages/wgsl/comment_feature.test @@ -0,0 +1,15 @@ +//test +// test + +/* multi + line + comment */ + +---------------------------------------------------- + +[ + ["comment", "//test"], + ["comment", "// test"], + + ["comment", "/* multi\r\n line\r\n comment */"] +] diff --git a/tests/languages/wgsl/function_feature.test b/tests/languages/wgsl/function_feature.test new file mode 100644 index 0000000000..f60b075d15 --- /dev/null +++ b/tests/languages/wgsl/function_feature.test @@ -0,0 +1,26 @@ +fn my_function() -> bool { + my_function(); + return true; +} + +---------------------------------------------------- + +[ + ["keyword", "fn"], + ["functions", "my_function"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "->"], + ["builtin", "bool"], + ["punctuation", "{"], + + ["function-calls", "my_function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "return"], + ["bool-literal", "true"], + ["punctuation", ";"], + + ["punctuation", "}"] +] diff --git a/tests/languages/wgsl/keyword_feature.test b/tests/languages/wgsl/keyword_feature.test new file mode 100644 index 0000000000..f42ea39df6 --- /dev/null +++ b/tests/languages/wgsl/keyword_feature.test @@ -0,0 +1,59 @@ +bitcast +break +case +const +continue +continuing +default +discard +else +enable +fallthrough +fn +for +function +if +let +loop +private +return +storage +struct +switch +type +uniform +var +while +workgroup + +---------------------------------------------------- + +[ + ["keyword", "bitcast"], + ["keyword", "break"], + ["keyword", "case"], + ["keyword", "const"], + ["keyword", "continue"], + ["keyword", "continuing"], + ["keyword", "default"], + ["keyword", "discard"], + ["keyword", "else"], + ["keyword", "enable"], + ["keyword", "fallthrough"], + ["keyword", "fn"], + ["keyword", "for"], + ["keyword", "function"], + ["keyword", "if"], + ["keyword", "let"], + ["keyword", "loop"], + ["keyword", "private"], + ["keyword", "return"], + ["keyword", "storage"], + ["keyword", "struct"], + ["keyword", "switch"], + ["keyword", "type"], + ["keyword", "uniform"], + ["keyword", "var"], + ["keyword", "while"], + ["keyword", "workgroup"] +] diff --git a/tests/languages/wgsl/literal_feature.test b/tests/languages/wgsl/literal_feature.test new file mode 100644 index 0000000000..de51e32cba --- /dev/null +++ b/tests/languages/wgsl/literal_feature.test @@ -0,0 +1,57 @@ +0x123 +0X123u +1u +123 +0 +0i +0x3f + +0.e+4f +01. +.01 +12.34 +.0f +0h +1e-3 +0xa.fp+2 +0x1P+4f +0X.3 +0x3p+2h +0X1.fp-4 +0x3.2p+2h + +true +false + +notALiteral20x3f + +---------------------------------------------------- + +[ + ["hex-int-literal", "0x123"], + ["hex-int-literal", "0X123u"], + ["int-literal", "1u"], + ["int-literal", "123"], + ["int-literal", "0"], + ["int-literal", "0i"], + ["hex-int-literal", "0x3f"], + + ["decimal-float-literal", "0.e+4f"], + ["decimal-float-literal", "01."], + ["decimal-float-literal", ".01"], + ["decimal-float-literal", "12.34"], + ["decimal-float-literal", ".0f"], + ["decimal-float-literal", "0h"], + ["decimal-float-literal", "1e-3"], + ["hex-float-literal", "0xa.fp+2"], + ["hex-float-literal", "0x1P+4f"], + ["hex-float-literal", "0X.3"], + ["hex-float-literal", "0x3p+2h"], + ["hex-float-literal", "0X1.fp-4"], + ["hex-float-literal", "0x3.2p+2h"], + + ["bool-literal", "true"], + ["bool-literal", "false"], + + "\r\n\r\nnotALiteral20x3f" +] diff --git a/tests/languages/wgsl/operator_feature.test b/tests/languages/wgsl/operator_feature.test new file mode 100644 index 0000000000..c7f51e192c --- /dev/null +++ b/tests/languages/wgsl/operator_feature.test @@ -0,0 +1,69 @@ +^ +~ +| +|| +&& +<< +>> +! +& ++= +-= +*= +/= +%= +^= +&= +|= +<<= +>>= += +== +!= +<= +>= ++ +++ +% +* +- +-- +/ +-> + +---------------------------------------------------- + +[ + ["operator", "^"], + ["operator", "~"], + ["operator", "|"], + ["operator", "||"], + ["operator", "&&"], + ["operator", "<<"], + ["operator", ">>"], + ["operator", "!"], + ["operator", "&"], + ["operator", "+="], + ["operator", "-="], + ["operator", "*="], + ["operator", "/="], + ["operator", "%="], + ["operator", "^="], + ["operator", "&="], + ["operator", "|="], + ["operator", "<<="], + ["operator", ">>="], + ["operator", "="], + ["operator", "=="], + ["operator", "!="], + ["operator", "<="], + ["operator", ">="], + ["operator", "+"], + ["operator", "++"], + ["operator", "%"], + ["operator", "*"], + ["operator", "-"], + ["operator", "--"], + ["operator", "/"], + ["operator", "->"] +] diff --git a/tests/languages/wgsl/punctuation_feature.test b/tests/languages/wgsl/punctuation_feature.test new file mode 100644 index 0000000000..d1a9746818 --- /dev/null +++ b/tests/languages/wgsl/punctuation_feature.test @@ -0,0 +1,31 @@ +@ +( +) +{ +} +[ +] +, +; +< +> +: +. + +---------------------------------------------------- + +[ + ["punctuation", "@"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "<"], + ["punctuation", ">"], + ["punctuation", ":"], + ["punctuation", "."] +]